Flash MX 2004
Basic Action Script
Commands
The following are the most basic of the action script
commands for beginners.
Button Commands:
Go to and Play (Frame Number – Current Scene)
on (release) {
gotoAndPlay(1);
}
Go to and Play (Frame Number –Scene Number)
on (release) {
gotoAndPlay("Scene
2", 1);
}
Go to and Stop (Frame Number – Current Scene)
on (release) {
gotoAndStop(1);
}
Go to and Stop (Frame Number –Scene Number)
on (release) {
gotoAndStop("Scene
2", 1);
}
Go to and Play (Frame Label – Current Scene)
on (release) {
gotoAndPlay("name_of_label");
}
Go to and Play (Frame Label –Scene Number)
on (release) {
gotoAndPlay("Scene
2", "name_of_label");
}
Go to and Stop (Frame Label – Current Scene)
on (release) {
gotoAndStop("name_of_label");
}
Go to and Stop (Frame Label –Scene Number)
on (release) {
gotoAndStop("Scene
2", "name_of_label");
}
Play
on (release) {
play();
}
Stop
on (release) {
stop();
}
Stop All Sounds
on (release) {
stopAllSounds();
}
Get URL
on (release) {
getURL("http://www.flashdesigntemplates.com",
"_blank");
}
Quit
fscommand("quit");
Frame Commands:
Go to and Play (Frame Number)
gotoAndPlay(1);
Go to and Stop (Frame Number)
gotoAndStop(1);
Go to and Play (Frame Label)
gotoAndStop("name_of_label");
Go to and Stop (Frame Label)
gotoAndStop("name_of_label");
Play
play();
Stop
stop();
Stop All Sounds
stopAllSounds();
FS Commands
Full Screen
fscommand("fullscreen", "true");
fscommand("fullscreen", "false");
Allow Scale
fscommand("allowscale", "true");
fscommand("allowscale", "false");
Show Menu
fscommand("showmenu", "true");
fscommand("showmenu", "false");
Trap All Keys
fscommand("trapallkeys", "true");
fscommand("trapallkeys", "false");
Execute
fscommand("exec", "name_of_exe_file");
Note: Your exe file must reside in a folder labeled exec.
Quit
fscommand("quit");
Get URL
getURL("http://www.flashdesigntemplates.com",
"_blank");
Load Movie (Level)
loadMovieNum("name_of_movie.swf", 0);
Load Movie (Target)
loadMovie("name_of_movie.swf",
"movie1");