views:

2240

answers:

2

Hi!!

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??

Thanks!!

+1  A: 

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.

Justin Niessner
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.
AndreMiranda
A: 

Hi,

I have the following action script written in flash: onClipEvent (load){ this._y = 403; } onClipEvent (enterFrame) { var num; if (this._y>=num) { this._y = this._y-13; } else { this._y = this._y; } }

I want to set this 'num' through html. And i am using the following html part to set the value of num:

Where simple3.swf is the name of swf file in which the above action script is written. But variable num is not updated with value passed.

Can anybody figure out whats going wring and how to pass parameter? Thanks in advance.

Rahul Jain