Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-14-2012, 10:15 PM   #1
Registered User
Join Date: May 2012
Posts: 12
Default external swfs not loading after embedded on html page?

I have a third party swf file that loads other swfs in to it. When I put it on our server and embed it in other pages it no longer loads the external swfs just the main one. When I type the direct link to the swf file in my browser it works fine. So there's something going on where it can't find the other swf files. I'm not sure what could be causing this. Any ideas?

good_snow is offline   Reply With Quote
Old 06-15-2012, 12:15 PM   #2
Senior Member
Poony's Avatar
Join Date: Aug 2011
Location: Sweden
Posts: 390

Are the paths to the child swf relative or absolute?

The paths should be relative to the Main swf's location.
Poony is offline   Reply With Quote
Old 06-19-2012, 02:52 PM   #3
Senior Member
Join Date: Feb 2010
Posts: 220

Most likely a pathing problem.
Contrary to what you might think:
When I type the direct link to the swf file in my browser it works fine
is a great tip-off that the pathing is wrong!
Contrary to what Poony has posted:
The paths should be relative to the Main swf's location
paths should be relative (starting at) the HTML Web page that the main .swf is placed on... NOT the location of the Main.swf.
In fact, if the main .swf is in a different folder than the HTML page it's placed on, then when you
type the direct link to the swf file in my browser
That's because the paths used in the main.swf to other Flash assets are pathed to work when main.swf is on a Web page, not by itself at it's physical location.
For your review:
Pathing issues

Almost always when it works on the local machine and not the server, it's a pathing problem.
You can put your Flash related files in whatever folders you want, they do NOT have to be in the root, they do NOT all have to be in the same folder. But if you have a problem and if sticking them all in the root folder works, then you know that the issue was a pathing problem.
Just remember that paths used in the .swf become relative to the Web page on which the .swf is placed, NOT itís physical location. So for example, if your .swf is in the flash/data folder and you use that .swf on a Web page in the root folder, you are in effect, removing that .swf from flash/data and putting it in root. So if the .swf is loading any related files (xml, images, video, etc), the path used inside the .swf to load the .xml file has to be relative to it's new location in root and then back down into flash/data. This is true even though when testing the .swf by itself, it can be inside flash/data and work just fine, since relative to it's location, the path is just fine, they are in the same folder. But if that same path is used when the .swf is placed on a page two folder levels up, the relative path has changed, the old "same folder" path will not work.
In fact if you are placing the .swf on a web page in a different folder than the .swf is stored in, and that .swf calls external assets, then direct clicking and opening of the .swf in itís folder should NOT work! Thatís because the paths to the external assets should be relative to the Web page and not the physical location of the .swf.
So just be sure that you use addresses relative to the final Web page locations (not physical file locations) and you can put the Flash related files in what ever folders you want.
Best wishes,
Eye for Video
Best wishes,
adninjastrator is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 03:19 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.