I’m able to get javascript parameters into swf with this code:
// Example from:
// www.permadi.com
function loaderComplete(myEvent:Event)
{
this.myParams=this.loaderInfo.parameters;
this.myParamsLoaded=true;
this.useParams();
}
function useParams()
{
userNameTextField.text=this.myParams.im;
[COLOR=Red]var image_loader:Loader = new Loader();
image_loader.load(new URLRequest(this.myParams.im));
addChild(image_loader);[/COLOR]
}
var myLoaderInfo=new Object();
myLoaderInfo.myParamsLoaded=false;
myLoaderInfo.loaderComplete=loaderComplete;
myLoaderInfo.useParams=useParams;
I added the code in red to load a picture since I intend to use the parameter for a name of a jpg file to be loaded.
It actually works BUT the image just flashes on screen for a second, how do I fix that?
I’d also like for the “image_loader” to load inside a container with certain size constraints. I found code that does the resize but I don’t know how to make the bridge between the image_loader, a possible movieclip container and the resize function as I might use the loaded image in more then one place of different sizes. If I atleast pull it off with 1 I’ll just use more swf’s to pull off the effect if its otherwise too complicated. Thanks