• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Very basic question (embedding swf)

New Here ,
Jan 31, 2011 Jan 31, 2011

Copy link to clipboard

Copied

Hello, I'm new to Flash Builder and trying to do something that I think should be very simple, but having a hard time with.

I'm trying to embed a Flash game I've developed into a Flash Builder application. I use the following code:

<mx:SWFLoader id="game" source="../games/flashGame.swf" scaleContent="false" autoLoad="true" width="800" x="0" height="600" y="0" minWidth="800" minHeight="600" />

But when I click the run button I only get a blank white pop-up, nothing is displayed. What am I doing wrong?

Regards,

Steve

Views

1.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 01, 2011 Feb 01, 2011

Copy link to clipboard

Copied

Do you have the <mx:SWFLoader> element wrapped inside the <mx:Application>. Please see the documentation here for more information http://livedocs.adobe.com/flex/3/html/help.html?content=controls_15.html

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 01, 2011 Feb 01, 2011

Copy link to clipboard

Copied

Does putting flashGame.swf in the src folder help?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 04, 2011 Feb 04, 2011

Copy link to clipboard

Copied

Thanks for the help. Unfortunately neither adding the <mx:Application> tags nor putting the game in the "src" folder worked. It may just be a problem with my computer, I'm going to try it on another computer to see if that helps.

Steve

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 08, 2011 Feb 08, 2011

Copy link to clipboard

Copied

LATEST

Hi Steve,

Try putting this code in your main MXML file:

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

    <mx:SWFLoader id="loader1" source="flashGame.swf"/> 

</mx:Application>

Make sure flashGame.swf is in the src folder. This should do the trick.

If it still does not work, a possibility to think of is whether flashGame.swf runs by itself or if it has code in it that prevents it from being loaded via a swfloader.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines