Wednesday, March 7, 2007

Action Script

 Below are the Action Script Codes we have learned:

1. How To Stop Your Movie

put it on the frame...

stop();

2. Button Actions:  
(Remember: put the A.S. on the button, NOT THE FRAME!!!)

Stop Button

on(press){
gotoAndStop(1);
}

Pause Button

on(press){
stop( );
}

Play Button

on(press){
play();
}

3. Replace/Hide Your Cursor

Your cursor is a movie clip symbol, so you need to put the A.S. on the frame.
Don't forget that you will give your instance a name. So, if you call it "cursor", then the code below should also be named cursor between the quotes.

Mouse.hide()
startDrag("name of your instance", true);

4. A Link Button

Remember: put the A.S. on the button, NOT THE FRAME!!!

on(press){
getURL("REPLACE THIS WITH THE URL"); 


4. Drag and Drop 
This is AS 2.0...
Make sure you put this code on the Movie Clip.

on(press){
    startDrag(this);
}
on(release, releaseOutside){
    stopDrag();

No comments:

Post a Comment