0
votes

Built a Flash canvas project using createJS and have some movieclip objects created dynamically. While I am able to reference each one of them just fine by name from external JS (and even read other properties), it appears that calling any of the play methods for the timeline of any one of those objects is ignored. I've tried MC2Play.play() as well as MC2Play.gotoAndPlay(1), etc...

I've tried adding a method within the Flash timeline (both at the root and at the root of the movieclip object of interest) to request the play() method - but the result is the same.

I'm sure it's a reference issue, but I'm not sure how to fix it.

I've tried creating a function at the root level of the Flash timeline to step through each of the objects and assign a reference object = this.object, but that doesn't seem to help either.

Ideas?

Thanks in advance.

1
Can you show how the objects are instantiated? If you just create them in the Flash timeline using var myX = new X(), then they will not be accessible anywhere. In that case, use this.myX = new X() and they will be accessible as a property on that MovieClip instance. - Lanny
As you say, I instantiate them as you've described, but then later add them to a container on the stage like this: exportRoot.someContainer.addChild(myX); I also create a name and set some other properties like x, y, etc. I put all of them in an array so that they can be referenced later and identified on the stage by name. Note that I am able indeed to access them. I can see all of the properties, see that the timeline is paused, etc. It just won't respond to any of the timeline methods (like play(), gotoAndPlay(1), etc). - djsegler

1 Answers

1
votes

OK - I am an idiot, but I guess I already knew that. After careful inspection of the EaselJS docs, I discovered a comment about caching - and how if you have a movieclip cached, you either have to re-cache or update the cache in order to see any changes to the content of a movieclip. DOH!

Needless to say, updating the cache did the trick and now my movieclip timelines play.

Whew!