Bug: SWFLoader doesn’t load in TabNav / ViewStack

This is bug report SDK-11280 where having a SWFLoader in multiple views of a TabNavigator or ViewStack doesn’t work correctly. Take the following code:

<mx:ViewStackwidth=”100%” height=”100%” creationPolicy=”all”>
<mx:Canvas id=”view1″ label=”View 1″>
<mx:SWFLoader id=”image1″ source=”img1.swf” width=”100%” height=”100%”/>
</mx:Canvas>
<mx:Canvas id=”view2″ label=”View 2″>
<mx:SWFLoader id=”images2″ source=”img2.swf” width=”100%” height=”100%”/>
</mx:Canvas>
</mx:ViewStack>

In this example, the first loader will show up fine. When you switch to the second view, you don’t see anything.

Solution: Add a minWidth and minHeight to your SWFLoader. This will solve your problem – <mx:SWFLoader id=”images2″ source=”img2.swf” width=”100%” height=”100%” minWidth=”100″ minHeight=”100″ />

3 responses

  1. I have tried use ViewStack and place SWFLoader inside of a Canvas, like:

    ………….

    However, the swf size cannot be 100%…
    There is a warning: “Cannot create SWFLoader because ViewStack is not a valid parent for that kind of item.”

  2. Thanks for telling the world this bug 🙂
    this help me in solving my problem with TabNavigator

  3. Thanks a lot for information.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: