Stop/play and other inserted movieClip code

Hi . If I import clip

var clip = Assets.getMovieClip("swf-library:Test1");
		
		addChild(clip);
		
		clip.x = 480;
		clip.y = 118;

Clip ignores inner code such as stop/ gotoAndPlay…and so on. Its a bug, or feature ?

I usually control that by setting Labels and checking for current frame being played. IN MIDDLE OUT sort of thing. Don’t even know if it is supposed to run any code in it though.

Hi,

it won’t read the code you put on frames as per i noticed , you need to control it by yourself .

clip.stop();
clip.gotoAndPlay("frame_name");
clip.gotoAndStop("frame_name");

You can add frame scripts at runtime, like:

clip.addFrameScript (0, function () {
   clip.gotoAndPlay ("frame_name");
});

Keep in mind that addFrameScript is zero-index based