Skip to main content
Annihil8ted
Participating Frequently
May 21, 2014
Answered

Loading External Swf

  • May 21, 2014
  • 1 reply
  • 583 views

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!

This topic has been closed for replies.
Correct answer sinious

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.

1 reply

sinious
siniousCorrect answer
Legend
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.

Annihil8ted
Participating Frequently
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?

sinious
Legend
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.