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

Loading External Swf

New Here ,
May 21, 2014 May 21, 2014

Hello to everyone! I'm new to the forums here and relatively new to AS3. I use FlashBuilder to code. I'm trying to load a local external .swf into my app. My URLRequest can't seem to be able to find the location of the local swf. I've dropped it everywhere with my app but no matter what I put for the url it can't find the swf. For example, my swf is name game.swf but no matter where I put it in the project folder and any combination of URL, I can't seem to access it. Interestingly enough, if it's in the bin-debug and I put URLRequest("game.swf"), it'll find the one in the bin-debug it seems. Please help and thanks in advance!

TOPICS
ActionScript
466
Translate
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

correct answers 1 Correct answer

LEGEND , May 21, 2014 May 21, 2014

In a Flash Builder project you should put it in the /src folder. The bin-debug is auto-populated with anything you put in /src.

Ideally you should make an /assets folder under /src (so /src/assets) and then load new URLRequest('assets/game.swf');. Flash Builder will copy the /assets folder from /src over to /bin-debug and eventually to your final export folder as well.

Translate
LEGEND ,
May 21, 2014 May 21, 2014

In a Flash Builder project you should put it in the /src folder. The bin-debug is auto-populated with anything you put in /src.

Ideally you should make an /assets folder under /src (so /src/assets) and then load new URLRequest('assets/game.swf');. Flash Builder will copy the /assets folder from /src over to /bin-debug and eventually to your final export folder as well.

Translate
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 ,
May 21, 2014 May 21, 2014

Thanks, that worked and I did manage to get it to work with placing all my swf within my assets folder. Okay so my understanding is that the URLRequest will look within the bin-debug for the .swf and the .swf will be automatically be copied there when I place the .swf into my source folder?

Translate
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
LEGEND ,
May 21, 2014 May 21, 2014

bin-debug is where Flash Builder places the files when you press the Debug or Run buttons. When you export your release build you will choose your own folder to place the final. In both situations, /src is the folder Flash Builder expects all the files you want "packaged" in your app to be in. Arrange them in any folder names you like. Consider the root of /src to be the root of your project. All relative links should be as if you're in that folder.

Translate
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 ,
May 21, 2014 May 21, 2014

Okay awesome! Thanks for the help!

Translate
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
LEGEND ,
May 21, 2014 May 21, 2014
LATEST

If you have any further Flash Builder questions you might want to try the Flash Builder forum. Although there are plenty of us here that use it as well. The products do overlap.

If you're all set please mark any helpful/correct so we can filter unanswered.

You're welcome and good luck!

Translate
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