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.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|