Would this work with Flash Menus?

Permalink Browser Info Environment
Would this work to embed a flash menu using xml to set menu names and urls?

Type: Discussion
Status: New
Pixelfixer
View Replies: View Best Answer
elyon replied on at Permalink Best Answer Reply
elyon
Absolutely. Here's how it would work:

1. Upload your SWF and XML files
2. Add a new Flash Embed block
3. Select the SWF file on the first tab
4. Select the XML file on the second tab

Done!

If you need to edit the XML, you can do so from the file manager, or you can even do it from inside the block. Go to the second tab, click the XML file and select "Edit"

The XML editor includes color highlighting, and also includes shortcuts so you can browse for files or pages in the file manager or sitemap, and it will drop in the links for you.

The big thing you would need to do is make sure that your Flash supports a "flashvar" for the path to its XML file. It's possible to workaround a Flash file that has a hard-coded path, but its way easier when it isn't.

In AS2, the code would look something like this:


var xmlPath = _root.xml;

(load the XML);


If "xml" conflicts with other variables in the SWF, you can also use a different variable name ... just make it match on the second tab of the Flash Embed block.


In AS3, the code would look like this:


var xmlPath:String = stage.loaderInfo.parameters.xml;


The variables won't conflict in AS3, so you should be safe to use the default "xml" variable name. If the Flash file doesn't already support a variable like this, you can use this snippet of code, and replace a hard coded path (like "MyXML.xml") with xmlPath instead
Pixelfixer replied on at Permalink Reply
Pixelfixer
Wow! Great answer! Thanks for your time. I think I'll go with the Pretty URL approach you offered in my other thread, for now. But I'd like to work this into my future applications.

Thanks again!

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.