2

I have a html for render Flash swf files and this has its parameter "movie" and this "movie" value is the url of the swf.

And in my swf, I have a method loadXml("myXMLFile.xml") that reads a xml, get its attributes and show them in swf. So far so good...

But, what I'm looking for is to pass a QueryString in the movie value, such as "myMovie.swf?myFile=anotherXMLFile.xml" and makes the swf loads this querystring parameter and loads the "anotherXMLFile.xml" instead of the "myXMLFile.xml".

That is... I want to dynamically send to swf the XML File I want to load...

Is there a way to do that??

1 Answer 1

2

You can check out this post:

Flash: Passing Variables to Flash from HTML via Query String

If that doesn't take care of what you're looking for, you can also check out:

SwfObject

SwfObject gives you a way to load up a SWF and pass parameters to the SWF via javascript. You could access your page query string variables and pass them to the SWF that way.

Sign up to request clarification or add additional context in comments.

2 Comments

Justin, I used swfobject and aldo chekcked the link you passed me... hehehe But, My doubt is to get this parameter in Flash... I this the example in the link very complicated and should be an easier way to accomplish this.
This is helpful but the basic solution as far as retrieving that variable in Flash using AS3, for me, has been to pull it in as a string like so: var myFileVar:String = root.loaderInfo.parameters.myFile as String and then use it from there. I'm not sure if as String is necessary, but it's safer than not. I'm definitely not an AS3 expert, but this was what I found when searching around and I thought I'd leave my solution here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.