object become partly invisible when rolled over with the cursor
1. create any graphic object and covert to a movie clip
2. select the instance on the stage and give it the following
script:
on (rollOver)
{
this._alpha = this._alpha =10;
Mouse.hide();
}
on(rollOut){
this._alpha=this._alpha =100;
Mouse.show();
}
object move around the stage using the arrow keys
1. create any graphic object and covert to a movie clip
2. select the instance on the stage and give it the instance
name “thing_mc”
3. add a new layer named “actions” and add the following frame
script
var speed:Number = 3;
_root.onEnterFrame = function() {
if (Key.isDown(Key.RIGHT)) {
thing_mc._x += speed;
} else if (Key.isDown(Key.LEFT)) {
thing_mc._x -= speed;
}
if (Key.isDown(Key.UP)) {
thing_mc._y -= speed;
} else if (Key.isDown(Key.DOWN)) {
thing_mc._y += speed;
}
}
random graphic with button
1. create a button
symbol and an graphic object movie-clip symbol
2. put a button instance on the stage and a movie-clip instance
off the stage
3.
name the movie-clip instance “ball_mc”
4. attach script to button symbol to make a random
graphic size and location
on (release) {
_root.ball_mc._xscale = random(500);
_root.ball_mc._yscale = random(500);
_root.ball_mc._x = random(400);
_root.ball_mc._y = random(300);
_root.ball_mc._alpha = random(100);
}
random graphic
1.
attach script to movie clip symbol to make a continual random graphic change
onClipEvent (load) {
this._xscale = 200;
this._yscale = 200;
}
onClipEvent (enterframe) {
this._xscale = random(1600);
this._yscale = random(1600);
this._alpha = random(100);
this._x = random(100);
this._y = random(100);
}
random graphic easeinto position
1. attach script to movieclip symbol
that will change randomly
onClipEvent (load) {
_root.targXscale = 50;
_root.targYscale = 200;
}
onClipEvent (enterFrame){
cXscale = this._xscale;
cYscale = this._yscale;
difXscale = cXscale-_root.targXscale;
difYscale = cYscale-_root.targYscale;
setProperty(this, _xscale, cXscale-(difXscale/5));
setProperty(this, _yscale, cYscale-(difYscale/5));
}
2. attach script to button symbol that will trigger the graphic
change
on (release) {
_root.targXscale = random(500);
_root.targYscale = random(500);
}