5 Replies Latest reply on Mar 13, 2010 2:59 PM by AdrianWiecek

    flash component with flex effects


      Hello guys,


      I've created the main navigation for my site in Flash Proffesional adding some basic rollover animation.

      I've imported this into my flex project and it works fine. I can add functionality to the movieclips as well. no problem there either.


      There problem is that I want to use the Flex Effects (like Parallel,Move etc) with the movie clips in the component and I'm getting an error when trying to do that. It says that flash movie clips cant be converted to flex movie clips. something like that.


      If you need the exact error I can post it but I think you get whats wrong.


      Any solutions to that?

      Or do I have to use an external library for the additional animation?

        • 1. Re: flash component with flex effects
          AdrianWiecek Level 3



          Try wrapping your component in UIComponent,  and then apply the effect to this new component.



          Adrian Wiecek

          • 2. Re: flash component with flex effects
            NickDF__ Level 1

            I though about that too.

            I didnt try it but I think its not going to work.


            I have to make the situation a little more clear. The movie clip I'm trying to animate is a child of the whole component. So, I guess that if I try to animate the whole navigation menu then I'm not gonna get an error. But trying to animate a child movie clip of the component throws the error.


            Let me know if I'm assuming something wrong.

            • 3. Re: flash component with flex effects
              AdrianWiecek Level 3



              I'm afraid nearly every spark and halo Effect require UIComponent or IUIComponent as effect target, but I've made some test and it is possible to use AnimateProperty with MovieClip instance and it seems to work fine, here is a very simple example:




              <?xml version="1.0" encoding="utf-8"?>

              <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"





                        <s:Parallel id="seq">


                                  <mx:AnimateProperty property="alpha" toValue="0.2"/>

                                  <mx:AnimateProperty property="alpha" toValue="1"/>


                             <mx:AnimateProperty property="x" toValue="300"/>

                             <mx:AnimateProperty property="y" toValue="300"/>






                             import mx.effects.AnimateProperty;

                             import mx.events.FlexEvent;



                             protected function application1_creationCompleteHandler(event:FlexEvent):void


                                  var mc:MovieClip = new MovieClip();

                                  mc.graphics.beginFill(0, 1);

                                  mc.graphics.drawRect(0, 0, 100, 100);








                   <mx:UIComponent id="uiComp"/>




              Note that this is Flex 4 example.



              Adrian Wiecek

              • 4. Re: flash component with flex effects
                NickDF__ Level 1

                thanks for the reply.


                One question though,


                I cant understand the purpose of this line : uiComp.addChild(mc);


                Eventually, the Sequence will have the mc as a target. so why adding it to a uiComponent?

                Does it matter what's the parent of the movie clip in order to animate the movie clip itself?


                If so, then this solution would definetely work but I would have make some adjustments to my flash components.

                • 5. Re: flash component with flex effects
                  AdrianWiecek Level 3



                  I've wrapped mc in uiComp because in Flex, children of containers have to be UIComponents. If you try to add non UIComponent as a child to Application container or any other container, you'll get an error. It should work in your component, and the best way to check it, is try:)



                  Adrian Wiecek

                  1 person found this helpful