SWF not loading.

33 views
Skip to first unread message

stoffershorty

unread,
Jul 30, 2009, 11:11:47 AM7/30/09
to SWFObject
Dear all,
Here's hoping someone will be able to help me as I have a really
bizarre problem with SWFObject. I have posted this everywhere but as
yet have not received a workable solution. The scenario is this:
I have a SWF menu that works fine locally with the generated HTML code
and by opening the file directly. However, when uploaded to the
company website and used on a test page it won't work at all.
Selecting the page with the cursor reveals that the Flash container is
there but it just won't load. I know it can find the JS files OK
because it comes up with alternate content if the file paths are
wrong. All the files are in a folder on the server root called
"icpmenu_es". The test page is here: http://www.ideal-country-property.com/es/test
and the code I'm using is this:
<HTML>
<HEAD>
<title>ICP Spanish Menu</title>
<script type="text/javascript" src="/icpmenu_es/swfobject.js"></
script>
<script type="text/javascript" src="/icpmenu_es/flying.js"></
script>
</HEAD>
<BODY>
<!-- ICPmessage www.ideal-country-property.com -->
<div id="ICPmessage" style="position:absolute; top:100px; padding-
left:0px; z-index:0;">
You need to upgrade your Flash Player or allow javascript to
enable the ICP menu. </br>
<a href="http://www.adobe.com/go/getflashplayer">Get the FREE
Flash Player from Adobe</a>
</div>
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject ("http://ideal-country-property.com/
icpmenu_es/menu.swf", "menuES", "185", "440", "8", "#000000");
so.addVariable("page_code", "a_b_c");

so.addParam("wmode", "transparent");
so.addParam("scale", "noscale");
so.addParam("salign", "TL");
so.write("ICPmessage");
// ]]>
</script>
</BODY>
</HTML>

I've tried the paths without the "/" and with the full address. If I
put all the files in the root directory (as I don't need to set the
paths) it works fine but I don't want to do that as I have other SWF
files to upload and they access files with the same name. I don't
think it's a problem with the website as I know the files are there in
the correct locations. This is driving me mad... really so ?d really
appreciate your help. Cheers. Chris.

Jim Berkey

unread,
Jul 30, 2009, 11:29:14 AM7/30/09
to swfo...@googlegroups.com
Try this - instead of:
<script type="text/javascript" src="/icpmenu_es/swfobject.js"></script>

try
<script type="text/javascript" src="../icpmenu_es/swfobject.js"></script> 
or
<script type="text/javascript" src="http://www.ideal-country-property.com/icpmenu_es/swfobject.js"></script>

jimbo

stoffershorty

unread,
Jul 30, 2009, 12:00:18 PM7/30/09
to SWFObject
Hi Jimbo,
Tried all of those. As I mentioned, I don't think the problem is with
the script path per se as if I put in a wrong path for example, then I
get the alternative content. Currently I've implemented your
suggestion on all the links to the SWF & JS files. It's a wierd one
alright!
Thanks for the suggestions though ... and keep them coming please. I'd
love to get this sorted out!
Chris.

Vincent Polite

unread,
Jul 30, 2009, 12:07:59 PM7/30/09
to swfo...@googlegroups.com
The issue is the location of your menu_data.xml file.  In your test pages current state it can't find that file, so you need to move it to match your SWF's expectations.  If there's a way to pass in the path of where the menu_data.xml file is supposed to be, then you want to do so, otherwise you will need to move it so that it is in the expected location.

(Perhaps you forgot to upload the file?)

I identified this using a tool called Firebug, clicking the Net Tab and noting that the browser was looking for a file called menu_data.xml but couldn't find it.

Move that file, pass in a path so your swf looks for that file where you've put it, and you'll have solved your issue.

Vincent

stoffershorty

unread,
Jul 30, 2009, 12:24:35 PM7/30/09
to SWFObject
Hi Vincent,
You're a GENIUS! At least the route of the problem has been
identified. However, I have not changed the folder structure at all. I
have just uploaded the entire folder via FTP so there shouldn't be any
change. Is there any way to tell the SWF file where it needs to look?
I have Flash CS4 (but am a complete beginner) but the menu was created
in a program called "Flash Menu Labs Pro v2" and there are no options
to rename any of the files. If there were, I could just place ALL the
files for both SWF menus in the same root directory.
You mentioned "Move that file, pass in a path so your swf looks for
that file where you've put it, and you'll have solved your issue."
That is indeed I think, the solution but how do I do it?!
Thanks so much for pointing out both the problem and the solution.
Chris

On 30 jul, 18:07, Vincent Polite <vpol...@socialnetconnect.com> wrote:

Vincent Polite

unread,
Jul 30, 2009, 1:14:45 PM7/30/09
to swfo...@googlegroups.com
Aran is the genius.  I just regurgitate what he told me a few months ago when I had a similar issue.  :)
 
In regards to your pathing... SWFObject is not going to be in control of where your SWF file "looks" for an external data file.  If that can be controlled, then you'd have to look at the documentation of Flash Menu Labs to see where, relative to the swf (or technically the page calling the swf) it should be located. 
 
If it helps your troubleshooting, it's looking for the file in a folder called:
 
Interestingly enough, when I go to this link directly I see SOMETHING that looks like a happy flash menu and website.  I'm not sure what that xml file is SUPPOSED to contain, but I'm kind of surprised that surfing to an xml file regurgitates a full on web page, but I haven't looked at what the file really contains.
 
Verify that your menu_data.xml files are the same between your production server and your test box.  Also verify that your test pages are in the same place relative to the root of your test box and production server.  Is your test box running an actual web server or are you just navigating to a file and just opening it up?  That can make a difference depending on how you define your paths.
 
You may also want to check to see if your XML at http://www.ideal-country-property.com/icpmenu_es/menu_data.xml is well formed.  When I surfed directly here I got a hellacious error message.  This may be a red herring though.  I was just looking to see if the swf knows where it is in the file structure and then looks for menu_data.xml in THAT directory.  Again, your test page --- it's looking for the xml file at the link location I put at the top.
 
Hope this helps somewhat.
 
Vincent Polite

stoffershorty

unread,
Jul 31, 2009, 4:09:49 AM7/31/09
to SWFObject
Hello again Vincent,
The plot thickens eh. With reference to the XML files you mentioned.
When you click on the link http://www.ideal-country-property.com/es/menu_data.xml
the reason it shows the company website is because ModX is configured
to go to the home page when an invalid page is requested. There is no
folder called "ES". This has to do with your previous message about
the SWF looking for the XML file in the "ES" folder. Our ModX
configuration was set up by the company that providers our Real Estate
software and they configured it so that each page needs to have an
alias which ends in the language extension. English pages have "_en"
on the end and Spanish ones "_es" so that when the page is loaded the
URL appears as /en (or es)/page name. This could indeed be what ius
causing my horrendous problems getting the SWF to load. The current
"happy flash menu" that you see is just one SWF file that doesn't
depend on any external files. I used another program for that but it
doesn't have the vertical dropdown option so when a user clicks on it
on certain pages, the submenus are hidden by the text on the main
page, but I digress.
As for your other point about the XML giving you a "hellacious error
message", that is because the file is encrypted. It's the menu program
that does that (goodness knows why). It creates the one you mention
plus another that is editable called "open_menu_data.xml" if you fancy
a butcher's (a look) at it.
Thanks again for your quick response and for tracing the root of the
problem, something that in weeks of posting, no one else has managed
to do.
I will keep you updated on the progress (or lack of it knowing me)!
Cheers.
Chris.

Vincent Polite

unread,
Jul 31, 2009, 6:54:54 AM7/31/09
to swfo...@googlegroups.com
The notion of language based localization is a good one, as it allows to create multiple versions of your menu based on what languages you want to support in a relatively sane way.  What is unclear to me is why the page works for you in your test environment but not in your production environment.  Do you have localization files on your test server that aren't on your production server?  Also another thing to consider (just stabbing in dark here) is whether or not your files have some sort of web address dependency.  i.e. it looks to see if it's on url: http://foo.com and because you're on http://web.foo.com, it uses a different set of configuration files, that sort of thing.

Wasn't clear if you had solved your problem or not, but the other thing you can do is use Firebug's NET panel to see what files it's looking for on your test system to see if it's any different than what it's looking for on your production system.  Otherwise it seems like you just need to provide those localization files and/or find those params to pass that might let you control WHERE those files should be, and at least you'll be a step forward?

Good luck,

Vincent

stoffershorty

unread,
Jul 31, 2009, 7:24:19 AM7/31/09
to SWFObject
Unfortunately I've not solved the problem but you did help me to find
out WHY, it isn't working.
My test environment is just my lowly PC (as I can't afford a Mac &
neither can my boss!) so it works fine there as all the files are in
the same folder.
However, I use ModX to actually test the web pages and it doesn't work
there either. The only way I can get it to work (so you can see that
there really does exisit a nice little SWF menu) is by putting a BASE
reference in the HEAD section and pointing it to the "icpmenu_es"
folder. However, that would screw up the rest of the links and
references etc if I actually used that BASE on the live pages. The
working menu is here: http://www.ideal-country-property.com/es/test2
for example purposes.
As for web dependency, I have no idea whatsoever. I shouldn't think so
though. As far as I can tell, it just looks for the "_en" or "_es" at
the end of the page alias to decide which to display and then in any
link I have to create the link as if it were in a "/en" or "/es"
folder. If you fancy a look at ModX (if you don't use it already) you
can test it online and download it free from here: http://modxcms.com/
I'm using version MODx 0.9.6.3. At the end of the day I'm only a very
basic web-designer and what little I know has only been learnt from
the likes of helpful people like yourself. At least now that I know
the problem, I can search around for solutions. Cheers.

Aran Rhee

unread,
Jul 31, 2009, 8:45:16 AM7/31/09
to swfo...@googlegroups.com
Have you tried to use the base parameter for the flash object only rather than the whole page?  As Flash is the one loading the XML, this should still work, and base is a valoid param for the flash object.
 
 
BTW - I notice that you are still using the old swfobject 1.x implementation. Any particular reason, or is it just habit?
 
 
Aran

stoffershorty

unread,
Jul 31, 2009, 10:11:46 AM7/31/09
to SWFObject
Oh my LIFE! It's finally working... I can hardly believe it. Thanks
soooooo much Aran & Vincent. If you guys are ever down this way in
Málaga, I seriously owe you some beers (or beverages of your choice)!
I was looking for a way to add the base just to that file after
Vincent's quick spotting of the problem and you came up with it Aran.
I'm going to try putting it into play on the main pages this afternoon
so stop by the site and let me know what you think (I'm always open to
constructive critiscism).
As for using "SWFOject 1.x", I didn't really know what version I was
using until you told me. Is there a new version available for ModX
then? Do you guys ever use the ModX system? If it is available and I
can implement it, would you recommend the change over?
Thanks once again. You've saved me from a heavy beating from my
bosses! Have a great weekend. I know I will now. Muchísimas gracias
chicos. Chris.

Aran Rhee

unread,
Jul 31, 2009, 10:31:08 AM7/31/09
to swfo...@googlegroups.com
Hey Chris.
 
I'm glad you finally got to the bottom of it. Having some helpful debugging tools definitely keeps you from pulling your hair out!
 
In regards to swfobject 1.x vs. 2.x, if ModX has support (only) with 1.x, then stick with that as you don;t want to make your life any harder. 1.x works (but we all like 2.x better, and it what we currently support on the lists / in svn)
 
I would love to get over to Spain sometime (and drink beer :). I think the closest I will come this year is being in Vienna in October for a conference, but that is still many km's away. That being said, most places are far from here in Australia :)
 
 
Cheers,
Aran
Reply all
Reply to author
Forward
0 new messages