A great resource over at Actionscript blog goes over various ways to extract variables from the GET query string: http://www.actionscriptblog.net/?p=79 . I was recently asked if these variables could actually be used to load images into flash. These are my notes.
Images can easily be loaded into an swf with the MovieClip Loader Object. A simple way to start this type of system is to write the actionscript like so:
stop();
var dogMCL:MovieClipLoader = new MovieClipLoader();
this.frameOneText.text = "The FrameOne var is: "+frameOne;
this.frameTwoText.text = "The FrameTwo var is: "+frameTwo;
dogMCL.loadClip("images/"+frameOne+".jpg",this.frameOneParent.frameOne);
dogMCL.loadClip("images/"+frameTwo+".jpg",this.frameTwoParent.frameTwo);
The results can be seen here: http://www.lancewig.com/queryToSwf/queryToSwf_v2.php?frameOne=Dog1&frameTwo=Dog2 You can try out the changing variables in the address bar query string by using 1 though 10 Dogs (Dog1, Dog2, Dog3 and so on). Once you reload the page, the swf will use the new variables in the query string to load the corresponding image in the server directory.
More information can be found at the action script blog link above about how the swf object in Javascript is taking the query string from http and writing the variables into the swf url on the fly. All this above code is doing is taking advantage of those variables and calling images with the same names using the MovieClipLoader object in Actionscript.