jeudi 23 février 2017

Hi, can anyone explain this whole code to me? I need a better understanding of it. Thanks

import flash.display.MovieClip;

import flash.events.Event;

import fl.transitions.Tween;

import fl.transitions.easing.*;

var rat1:Rat = new Rat();

var rat2:Rat = new Rat();

addChild(rat1);

addChild(rat2);

rat1.rotationX += 180;

rat1.rotationZ += 270;

rat1.x =0;

rat1.y =400;

rat2.rotationX += 180;

rat2.rotationZ += 100;

rat2.x = 2;

rat2.y = 90;

rat2.alpha -= 0.6

enterStage(rat1);

function enterStage(mc:MovieClip)

{

var speed = 50;

mc.addEventListener(Event.ENTER_FRAME, comeIn);

function comeIn (e:Event)

{

    mc.x += speed;

    speed -= 3;

    if (speed <=0)

    {

        mc.removeEventListener(Event.ENTER_FRAME, comeIn);

    }
}

}

var ratTween:Tween = new Tween(rat2,"x", Strong.easeOut,stage.stageWidth, 200, 1, true);

ratTween.start();

Aucun commentaire:

Enregistrer un commentaire