Andrew Cassidy
Andrew Cassidy

Reputation: 255

Downloading new SWF after passing in variables via FlashVars

I'm passing text to an SWF file via the FlashVars parameter in the HTML object. This is working fine and I can see the new text in my SWF in the browser.

What I'd like to be able to achieve now is for the user to be able to click a "Download" button which saves the SWF that's currently displaying the dynamic text.

Is the possible or is there an alternative way of passing text to an SWF via the browser and then saving that SWF with the next text "compiled" inside it.

Thanks,

Upvotes: 0

Views: 150

Answers (1)

Atriace
Atriace

Reputation: 2558

An SWF is compiled code. Your FlashVars are runtime variables that are read into the compiled program. The short answer is, "No". What you're trying to do isn't possible. The SWF will always need to read into itself those variables, and storing them in the SWF isn't the way.

Because the SWF will need to load your data after it opens, the only question is "where to store them?"

  • If the data is specific to an individual's computer, try SharedObject.
  • If the data is general to all users, you could host the data on your site, and the app loads the file using URLLoader with XML/JSON/TXT.
  • If the data is dynamic for each user and needs to run offline, have your website write the XML/JSON/TXT and zip it and your SWF into a single download.

Upvotes: 2

Related Questions