I have exported a swc movieclip for Flex and can see the animation play, no problem. But the problem is when I change the width and height properties of the movieclip, the animation size doesn't change, only the background size changes, but I want to change the size of the animating object. The code fragmet is as follows:
var myMovieClip:MovieClip = new MyMovieClipClass();
myMovieClip.width = someWidth;
myMovieClip.height = someHeight;
var buffer:BitmapData = new BitmapData(someWidth, someHeight, false, 0xFFFFFF);
How can I change the size of the animation properly?
Thanks in advance.
If the animation is attached to the root instead of the movieclip you might
have a problem like that. It depends on why the animation does not respond
to the parent size.
Ok, as you said, when I created the animation movieclip inside another movieclip, which both can be seen in the library pane, the problem is solved. The hierarchy is as follows:
--->animation (the actual timeline)
and the usage is as follows:
var rootMovieClip:MovieClip = new MyMovieClipClass();
var childMovieClip:MovieClip = rootMovieClip.getChildAt(0);
rootMovieClip.width = someWidth;
rootMovieCip.height = someHeight;
childMovieClip.scaleX = someScale;
childMovieClip.scaleY = someScale;
var buffer:BitmapData = new BitmapData(rootMovieClip.width, rootMovieClip.height, false, 0xFFFFFF);
Thanks a lot.