Reputation: 2265
I've created an animation (right click on timeline and create animation) and given it an object name. If I call tank.stop(), the animation will stop successfully. However, if I call tank.body.stop(), it won't work.
There are 2 object names - the movieClip object name AND the name of the animation itself. I don't know how to stop animating a specific part, not all the parts. If I write tank.animObjectName.stop(), I get an error.
// If I stop animating the main movieclip then all the child will stop
// animating also
main movieclip ->
{
head //how to stop animating head?
body //how to stop animating body?
legs //how to stop animating legs?
}
Upvotes: 0
Views: 2259
Reputation: 456
Created from context menu animations are instances of AnimatorFactory class. http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fl/motion/AnimatorFactory.html
There is no ability to control them (start/stop).
You need use classic scheme of movieclip tree. Root - main movieclip with all content. Every animated part is a movieclip with animation inside root clip. Example:
tank (no animation, only child movieclips, 1 frame at all)
--body (movieclip with animation of body inside)
--weapon (movieclip with animation of gun inside)
--banner (movieclip with animation of banner inside)
To stop body, write tank.body.stop(); Body will paused, but weapon and banner will play. When you want to stop all parts, write command for all parts:
tank.body.stop();
tank.weapon.stop();
tank.banner.stop();
If you have some animations and want to convert them to movieclip:
Maybe there are faster method, but i don't know them...
Upvotes: 1