Professional Documents
Culture Documents
A Complete Guide To Adobe Flash Scripting
A Complete Guide To Adobe Flash Scripting
A Complete Guide To Adobe Flash Scripting
Flash Scripting
Full Screen Command
Select the First frame right click actions
fscommand("fullscreen", "true");
Quit Command
Create button actions
on (release) {
fscommand("quit");
}
Go to Next Page
Select & right click the button actions
on (press) {
gotoAndPlay("type the scene name",
1);
}
URL Command
Select the Button actions
on (release) {
getURL("type the folder name",
"_self");
}
On mouse Command
http://vishnur-online.blogspot.com
First create the Movie clip drag the movie clip in
to the current scene
Actions
onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
onClipEvent (enterFrame) {
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}
}
Juke box Command
Import the sound in to the library press F11
right click the sound linkage
Tick Export for action script and give a Name
create the button Actions
on (press) {
stopAllSounds();
mysound = new Sound();
http://vishnur-online.blogspot.com
mysound.attachSound("type the sound
name");
mysound.start();
}
Mouse Trail
Select the first frame right click actions
http://vishnur-online.blogspot.com
this._x += (this.prevClip._x-
this._x+5)/speed;
this._y += (this.prevClip._y-this._y)/speed;
};
} else {
mc.onEnterFrame = function() {
this._x += (_root._xmouse-
this._x+10)/speed;
this._y += (_root._ymouse-this._y)/speed;
};
}
}
Game Command
First create a Movie Clip apply the actions
onClipEvent (enterFrame) {
if ((Key.isDown(Key.LEFT)) &&
!(Key.isDown(Key.RIGHT))) {
this._x -= 5;
this._rotation=270;
}
if ((Key.isDown(Key.RIGHT)) &&
!(Key.isDown(Key.LEFT))) {
this._x += 5;
this._rotation=90;
}
if ((Key.isDown(Key.UP)) &&
!(Key.isDown(Key.DOWN))) {
http://vishnur-online.blogspot.com
this._y -= 5;
this._rotation=0;
}
if ((Key.isDown(Key.DOWN)) &&
!(Key.isDown(Key.UP))) {
this._y += 5;
this._rotation=180;
}
if ((Key.isDown(Key.UP)) &&
(Key.isDown(Key.RIGHT)) &&!(Key.isDown(Key.DOWN))
&& !(Key.isDown(Key.LEFT))) {
this._rotation=45;
}
if ((Key.isDown(Key.DOWN)) &&
(Key.isDown(Key.RIGHT)) &&!(Key.isDown(Key.UP)) &&
!(Key.isDown(Key.LEFT))) {
this._rotation=135;
}
if ((Key.isDown(Key.DOWN)) &&
(Key.isDown(Key.LEFT)) &&!(Key.isDown(Key.UP)) &&
!(Key.isDown(Key.RIGHT))) {
this._rotation=225;
}
if ((Key.isDown(Key.UP)) && (Key.isDown(Key.LEFT))
&&!(Key.isDown(Key.RIGHT)) &&
!(Key.isDown(Key.DOWN))) {
http://vishnur-online.blogspot.com
this._rotation=315;
}}
http://vishnur-online.blogspot.com