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


If you need to handle things at a lower level, maybe you need your component to monitor the application close event. This code is used to monitor a process for closure. (It will also work if someone does an End Task from the task manager.)

Process MyMonitoredProcess = null;
private void Form1_Load(object sender, EventArgs e) 
{
    Process[] p = Process.GetProcessesByName("processName", "machineName");
    if (p.Length > 0)
    {
        MyMonitoredProcess = p[0];
        MyMonitoredProcess.EnableRaisingEvents = true;
        MyMonitoredProcess.Exited += TestProcessEndedEvent;
    } 

}

private void TestProcessEndedEvent(object sender, System.EventArgs e)
{
    // Tasks to be done if application closes.
} 

Hope this helps.

4

1 に答える 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.

于 2009-05-22T04:09:20.407 に答える