Developing Webs logo
Google
Web DW-Main DW-Photoshop
Visit the message board for solutions or post a question Check out the Classes offered for free at Developing Webs Voice Chat submit a tutorial, resources, article, font for publication consideration and earn a one way link back to your site Get more specifics about the Developing Webs Voice chat room and its room members View the current news at Developing Webs alternative sites which are resources for your d3evelopment needs Join Developing Webs Chat Link to us on your web page to help support this resource! Check out Developing Webs At yahoo groups! Developing Webs Home Adobe Photoshop Tutorials Macromedia Flash Tutorials Jasc Paint Shop Pro Tutorials Adobe Illustrator Animation basics Some Basic PHP tutorials Perl Tutorials HTML Tutorials Cascading Style Sheets javascript Front Page Tutorials Macromedia Dream Weaver Tutorials dreamweaver Publishing your site, FTP, ChMod, Promotions Tools to help you create your site Free and shareware fonts to download Photographs to use in your projects Shop for your site needs Free Online classes REcommend this site to others Log in or edit your information when logged in Developingwebs Log Out Change My Account details and preferences
RSS Newsfeed
for your site
DW News
Calendar
DW Forum
Right click on button and copy shortcut

Add to My Yahoo!

Reminder
Remember to book mark this site!



Request a Tutorial

Coin Project 4: Limiting the travels of the coin so it does not go off stage

by Leanne Richer

You will need the results of this tutorial to complete this series of tutorials.

OBJECTIVE: In Flash MX we will script a movie clip on the X and Y axis and use a condition to keep the movie clip on the stage.

1. Open your Flash Coin Movie from the last tutorial. We have 2 variables that cycle through a set of numbers and begins again. Now we can set the _x property and _y property according to that variable.

2. Click in frame 2 of the main timeline actions layer. Click on the bottom line of the script to be able to add a script to the following line. In this tutorial we will use the shorthand for set property. It is written in a set variable statement. You write the statement in the following form:

pathtothetarget.target.property = value


Click Action=> Variables=> Set Variable. Click in the variable field and hit your target button. Find your coin1. Set it to dot formula and absolute pathway. you will see _root.coin1 appear in the variable field. Add a period and then add the property for _x so the variable appears as

 _root.coin1._x.

Click in the value field. Type in the variable mania and check expression so it will be evaluated.
3. Click on the full script line in the actions panel. Right click and select copy. Right click again and select paste. Edit this script so that the property that is being changed is _y and the value is ruby.

 

4. test your movie. You will see that the coin moves across the screen. When it gets to the right or bottom edge. it appears on the opposite side, or the value is reset the the other side of the range.

 

Congratulations on a job well done!  Next tutorial is setting some button actions to control position of the coin.



"Building The Web Into a Nicer Place -- One Site At A Time"
Developing Webs Group Copyright © 2001-2012 All Rights Reserved
Privacy and Legal




iSECURE Network Security