0

I'm making a multi-part introductory animation for a game. It works when I preview in Flash, but not when I export using the CreateJS toolkit to get HTML5 output.

On my scene's timeline, I have this.stop(); on the first frame, as well as a movie clip that contains several seconds of animation (and which may have to change in length as we develop).

My second frame is labeled "sc2" and I would like the animation to pick up there when the first movieclip is finished. To accomplish this, I went into the first movie clip and put this on the last frame:

_parent.gotoAndPlay("sc2");

This works fine in Flash, but perhaps I can't use the _parent object in JS? Is there an alternative way to access the flow of control or another way to accomplish this? My goal is to avoid doing animation on the main timeline and to control the flow by scripting there so that if the length of the individual sections of animation changes, I don't have to change the start and end frames of the various sections in several places.

Joseph
  • 733
  • 1
  • 4
  • 20
  • Is this ActionScript code in the timeline? Toolkit for CreateJS does not convert AS2/AS3, but has some support for JS code. – Lanny Apr 17 '13 at 15:29
  • Ah, yes it is. I guess I got used to the commands being the same between AS2 and the libraries CreateJS uses. I've just been duplicating the code and putting one between the /*js */ tags. I'm the animator actually, so I haven't done much too complicated with the Javascript yet. Is there any kind of equivalent that will let me accomplish this using Javascript? – Joseph Apr 18 '13 at 01:23
  • 1
    The /*JS */ code is limited, but there is support for things like gotoAndPlay, stop, etc in MovieClips. The `.parent` property was added in the latest version of Toolkit (1.2), so ensure you are using the latest from Adobe. – Lanny Apr 18 '13 at 02:43

0 Answers0