2 Replies Latest reply on Apr 4, 2010 7:29 AM by uygar_yuz

    Flex movieclip size problem

    uygar_yuz

      Hi guys,

       

      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);

      buffer.draw(myMovieClip);

      //...

       

      How can I change the size of the animation properly?

       

      Thanks in advance.

        • 1. Re: Flex movieclip size problem
          Flex harUI Adobe Employee

          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.

          1 person found this helpful
          • 2. Re: Flex movieclip size problem
            uygar_yuz Level 1

            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:

             

            rootMovieClip

                 --> animationMovieClip

                      --->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);

            buffer.draw(rootMovieClip);

            //...

             

            Thanks a lot.