Flash menu / XML help
I am trying to implement a flash menu on my website. I've never done this sort of thing before... I think I'm really close to getting it. I can view the menu in my browser while offline (locally), but i cannot figure out how to "embed" the menu on my webpage. Basically, I have a .swf and an .xml file. I then tried using the following html to insert it, but it doesn't work! HELP!!!
cabs/flash/swflash.cab#version=6,0,29,0" width="width" height="height">
<param name="movie" value="swf file path">
<param name="quality" value="high">
<param name="scale" value="noscale">
<param name="bgcolor" value="background color">
value="xmlConfig=path to configuration file">
<embed src="swf file path" width="width" height="height" flashvars="xmlConfig=path to configuration
file" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shock
wave-flash" scale="noscale" bgcolor="background color"></embed>
Well if the .swf works on your local machine but not when uploaded to your server, the problem is almost always a pathing issue. If you use something like this in your .swf:
var menu:XML = new XML();
Remember that the path to the swf and the xml are relative to the location of the html page which on which you did the "embedding", not simply the relationship used during creation. That means that during testing of the sample show above, the xml had to be placed in a folder called "scripts", which was at the same level as the html page. If the .swf was also placed in there, then the path from the html page to the swf would be:
<param name="movie" value="scripts/menu.swf">
Unless you put the correct path to the xml in while you were doing development (the extra folder depth), it may just read
which would not load from an html page one folder level up. If the menu is duplicated in any subfolders, the relative address to the .swf and .xml will have to be changed to include the "../" up one level markup.
One way to test correct pathing, type the file name directly into your browser address bar.
If you can't download direct, address is wrong, file does not exist, of file is in wrong place. this will also work for the .xml file.
I am a little unsure about the paths, so I just used the full path starting with http://. is this not going to work? i see now that i can change the background color, height, width. i now see a colored box of the specified dimensions, but i still cant get the swf object to appear. grrr.
i am able to direct download the object by typing the path into my address bar. however, the object looks enlarged, blurry, fuzzy, etc. it does not appear as it does on my local drive.
Absolute urls should work also, but you may get a security warning during testing from local machine, just follow the dialog box if it does.
If you can download directly, great! It will appear larger because it has the whole browser to open in... for testing...not a problem. Can you also download the xml?
As far as loading the .swf, the "embed" method is pretty much being phased out in favor of valid code. Here is one example:
You can also use swfobject... a small .js file which is valid code and allows the use of alternate content for non Flash users.
Here's an example of a swf menu with working alt content for non flash users... menu works fine either way. View the source code and notice how the menu buttons use alt content
As for your example, the line that concerns me the most is the
Is this a menu template that you use xml to config and not actually read in the data or ????? Do you suspect any problems with that file?
flashvars="xmlConfig=path to configurationfile"
ugggh. i can't figure this out for the life of me. none of the above examples contain a .xml file in addition to the .swf, so i'm still confused. any other suggestions?
Typically loading the xml is handled inside the actionscript... but not always. In the example I was mentioning
var menu:XML = new XML();
The code is part of the actionscript and not the html. There is a bunch of code to create and fill an array that is placed between these two lines. Now your application may be completely different.
What is the purpose of the xml file? Is it used to config a skin or something for the menu? Or does it provide the text that is used on the nav buttons of the menu?
Do you have access to the Flash .fla file? Is there something like menu.load("menu.xml"); in the ActionScript?
Without seeing the specifics.... I'm just guessing.
its become apparent that i need to have my hand held through this process.
my xml file specifies the menu design as well as the navigation tree. is there any way i can email you the exact files i am dealing with? i would appreciate it tremendously, as i am about ready to give up.
To clarify, is it that you can view the .swf file in the browser by going to www.yoursite.com/menu.swf but you cannot view it embedded on the page?
well, i figured out how to embed it. now my problem is getting the pull down to overlap the html, rather than having a giant blank gap on my page. i understand this is a difficult problem to deal with. is it even possible? thanks!
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)