Overview:
I have a SWF banner ad template which loads in JSON from a platform that I have developed and then cycles through some products that were specified in that JSON. Each product is made up of your standard title, price and image.
On the platform, the user has the ability to modify the JSON feed via some UI tools such as image upload, title change etc.
Once they've done this, they can save and preview the ad. The preview is a SWF file embedded on the current page with some FlashVars that reference the location of the JSON they just created.
The request:
The user wants the ability to be able to archive all versions that they have created locally (as SWFs on their drive).
I offered a few solutions such as:
- Download a bundle containing a HTML page with the SWF embedded with the appropriate FlashVars define in the HTML (this is easy).
- Download a bundle that contains an XML document in the same directory as the SWF, which the SWF can load (this is a slightly altered version of the SWF) and obtain the JSON URL from.
Unfortunately, they are pushing to have a single SWF downloaded which they can save as an encapsulated file. The idea is that this eliminates an abundance of files down the track, as well as the ability to place components in the wrong directories, etc.
Question:
I need to use PHP (if possible) to do the following:
- Create a copy of the SWF template.
- Alter the value of the variable inside the copied SWF containing the URL to the appropriate archived JSON URL.
- Save that version and then begin downloading it.
Is this possible? If so, how?