Search tutorials
Adding the Actions
Step 7 : Add the Actions to the Candy Button
Right click on the Candy button and choose Actions from the pop up menu as shown. When the action panel appears. Press Ctrl-E to get into the expert mode and type in the following code into the blank area in the panel.
on(press){
StartDrag("",true);
}
on (release){
stopDrag();
if(this.hitTest(_root.eatman)){
setProperty(_root.choc,_visible,false);
}
}
Note: The "this" object in the above actionscript means "this object the actionscript is in", in other words the "choc" movie clip. Thus we are testing to see if the MC "choc" is touching the MC "boogie" which resides on the root level (main timeline).
Now go back to the main timeline and drag an instance of the movie clip that we named "choc" onto the stage. Give the instance the name "choc" by right clicking on it and choosing the instance panel like we did before.
| » Level Intermediate |
|
Added: 2000-10-19 Rating: 6 Votes: 74 |
| » Author |
| A flash lover, programmer and one happy guy! |
| » Download |
| Download the files used in this tutorial. |
| Download (19 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!