views:

21

answers:

1

Hello all, I have this Flex 4.1 script:

<fx:Script>
    <![CDATA[
        [Embed(source="res/swf/user.swf")]
        [Bindable]
        private var SWFClass:Class; 

        [Bindable]
        public var userClip:MovieClip = new SWFClass();

        protected function test_clickHandler(event:MouseEvent):void
        {
            trace("click");
            userClip.gotoAndPlay(1);
        }
    ]]>
</fx:Script>

<fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<mx:SWFLoader id="userClip1" autoLoad="true"  trustContent="true" source="{userClip}"  />
<mx:Button id="test" click="test_clickHandler(event)" x="100" y="200"/>

I only see the SWF repeating itself, pressing the button has no effect, no errors either.

What am I doing wrong?

A: 

Check out unloadAndStop().

James Ward