View Full Version : Frame actions not working on child movieclips
andr.in
March 13th, 2009, 11:39 AM
I've found the solutions for most of my many problems with as 3 but this one is really baffling :be:
The frame actions of child-movieclips of dynamically added movieclips are not firing!
If I have movieclip, say "mc", which contains a child-movieclip "submc" which has a timeline animation in it with "stop();" on the last frame and I add "mc" on the stage via addChild() the stop action inside the sub movieclip will not work.
All the frame actions inside "mc" itself work.
Everything works if I drag the movieclip onto the stage manually.
Right now the only way I can see to stop a movieclip on its last frame is by using the ENTER_FRAME event, but that's awfully cumbersome.
Any ideas?
I've attached a very simple example
andr.in
March 14th, 2009, 12:55 PM
bump... anyone?
I would really like to be able to simply stop by animations :D
I added a link to the swf in the zip file:
http://andr.in/stuff/testframeaction.swf
Krilnon
March 14th, 2009, 10:44 PM
Can you post some code or a CS3 version of the FLA (the computer I'm on now only has CS3)?
I tried to recreate your example based on your description, but my stop code seemed to work. I've attached my attempt.
andr.in
March 15th, 2009, 05:59 AM
Thanks for the reply
I got my fla to work... it seems that if I export the child movieclip for actionscript, it works.
so.. yay?
The weird thing is that if I remove the export from your fla, yours still works :stare:
I'm attaching the cs3 version of my fla with the export enabled for the child.
I really can't tell anymore if I'm missing something or if this is some kind of flash weirdness. :crazy:
edit: Another thing, I tried to apply this to my project but it seems to require "Export in first frame" as well, but I have preloader... :|
edit edit: Ok I can make that problem go away by putting all the not-exported-in-first-frame movieclips on frame 2 an skipping that frame ( a technique described here http://senocular.com/flash/tutorials/preloading/ ), which in my opinion is a really hacky way of doing things...
Krilnon
March 15th, 2009, 02:13 PM
I'm attaching the cs3 version of my fla with the export enabled for the child.
I really can't tell anymore if I'm missing something or if this is some kind of flash weirdness.
Not exporting submc works for me using your .fla… strange, I don't really know what's going on there. Probably just Flash weirdness like you suggested. :P
edit edit: Ok I can make that problem go away by putting all the not-exported-in-first-frame movieclips on frame 2 an skipping that frame ( a technique described here http://senocular.com/flash/tutorials/preloading/ ), which in my opinion is a really hacky way of doing things...
It is pretty hacky, but it's also the standard way to do it since there isn't really a nicer way. :-/ You could also dump those MovieClips into their own .swf or .swc files and then load those during the preloading stage, but I don't know if that's any nicer.
andr.in
March 15th, 2009, 03:49 PM
Ok thx krilnon. Now I at least know that it's not always me :P
I'm already having some trouble creating an FLVPlayback instance via actionscript but that's another issue for another thread ;)
thanks a bunch
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.