Distant_storm Posted November 21, 2007 Share Posted November 21, 2007 Ok so I know I can embed flash e.t.c but I want to be able to change which XML document it loads via the embed code ? is this possible and if so does anyone know the flash side of it too ? Thanks Quote Link to comment Share on other sites More sharing options...
obsidian Posted November 21, 2007 Share Posted November 21, 2007 You can easily pass in different XML documents via the query string as you would in some PHP pages. You would have something like this if you were loading a static XML document (my_document.xml): var my_xml = new XML(); my_xml.onLoad = function(success) { if (success) { trace(this); } } my_xml.load("my_document.xml"); trace(my_xml); Then, if you wanted to make that document dynamically passed in via the query string, you would set a variable in your param movie tag (also in your embed tag if you are using embed) like this: <param name="movie" value="myflashmovie.swf?xmldoc=myxmldoc.xml" /> You can pick up those query string values from the root within your flash document, so your XML actionscript may change to something like this: my_xml.load(_root.xmldoc); trace(my_xml); Hope that helps some. Quote Link to comment Share on other sites More sharing options...
Distant_storm Posted November 21, 2007 Author Share Posted November 21, 2007 Thanks thats perfect, a little bit of fiddling round and its good. Thanks alot again obsidian Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.