Skip to content
baris edited this page Feb 21, 2022 · 4 revisions

Creating tile from AnimateAtlasSheet

var train:AnimateAtlasTile = new AnimateAtlasTile(animateTileAtlasSheet);

Frame Script

var frameNumber:Int = 30;
train.addFrameScript(frameNumber, function(){
    trace("frame 30");
});

Playback

play

train.play();

gotoAndPlay

var frameNumber:Int = 30;
train.gotoAndPlay(frameNumber);

stop

train.stop();

gotoAndStop

var frameNumber:Int = 30;
train.gotoAndStop(frameNumber);

Child Access

var wagon1:AnimateSymbol = train.getSymbolByName("wagon1");
var wagon1Door:AnimateSymbol  = wagon1.getSymbolByName("door");
wagon1Door.gotoAndStop(50); //Close Door instantly without animation

Child Access #2

var wagon1:AnimateSymbol = train.getSymbolByName("wagon1");
var wagon1Door:AnimateSymbol  = wagon1.getSymbolByName("door");
wagon1Door.visible = false; //Make the door invisible

Child Access #3

var wagon1:AnimateSymbol = train.getSymbolByName("wagon1");
var wagon1Door:AnimateSymbol  = wagon1.getSymbolByName("door");
wagon1Door.addFrameScript(50, function(){
    trace("door closed");
});