1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| stop();
//creation du triangle bleu
this.createEmptyMovieClip("box_mc",this.getNextHighestDepth());
box_mc.beginFill(0x0000FF,100);
box_mc.moveTo(10,100);
box_mc.lineTo(10,100);
box_mc.lineTo(100,100);
box_mc.lineTo(100,10);
//creation du triangle rouge
this.createEmptyMovieClip("box2_mc",this.getNextHighestDepth());
box2_mc.beginFill(0xFF0000,100);
box2_mc.moveTo(10,10);
box2_mc.lineTo(10,100);
box2_mc.lineTo(100,10);
box2_mc.lineTo(10,10);
import mx.transitions.Tween; // on importe la classe Tween
import mx.transitions.easing.*; // on importe les classe easing pour les effets.
box_mc.onRollOver = function () {
if (box_mc._x<=10) {
var maTween:Tween = new Tween( box_mc, "_x", Regular.easeOut, 0, 300, 12, false );
var maTween:Tween = new Tween( box2_mc, "_y", Regular.easeOut, 0, 300, 12, false );
}
else { var maTween:Tween = new Tween( box_mc, "_x", Regular.easeOut, 300, 0, 12, false );
var maTween:Tween = new Tween( box2_mc, "_y", Regular.easeOut, 300, 0, 12, false );
}
} |
Partager