I'm trying to make changes on an existing fla that is used to call an xml file to display some images with a timer.
This is the part of the AS that calls the xml.
Actionscript Code:
import util.GetXML; import util.VarsIroning; varxml = "homeEnglish.xml"; var nodes:XMLNode = newXMLNode(); var shortNode:XML = newXML(); var iron:VarsIroning = new VarsIroning (["partner", "xmlUrl"]); var xmlReg:GetXML = new GetXML (xml, fnLoad, fnError); //var xmlReg:GetXML = new GetXML ("tmp.xml", fnLoad, fnError); var loadedImages:Object = newObject(); var isPlaying:Boolean = false; varcontrol:String; varfps:Number = 25; var prevIndex:Number; var corners_mask_mc:MovieClip;
Now the client wants me to change the fla so the xml is called from the parameters instead. This is because they want to have several of these swf but calling different xmls.
I've some idea of how to do that in the parameters, but not sure the changes I have to do in the AS, could anybody help?
I've placed the myFile=homeEnglish.xml to specify the variable in flash.
This is the section is AS that deals with the xml, the whole code is on the root of the movie:
Actionscript Code:
import util.GetXML; import util.VarsIroning; varxml = myFile; var nodes:XMLNode = newXMLNode(); var shortNode:XML = newXML(); var iron:VarsIroning = new VarsIroning (["partner", "xmlUrl"]); var xmlReg:GetXML = new GetXML (xml, fnLoad, fnError);
Still not working. Sorry my expertise is more design and CSS and some actionscript but not enough to deal with this.
Here's a working example.
I had some trouble making it work because Dreamweaver doesn't automatically add FlashVars everywhere it should.
I had to add it manually:
Code:
'FlashVars', 'myFile=something.xml'
I always use SWFObject to embed SWF files. It simplifies this and other processes...