# Params and loader

**URL:** https://forum.kirupa.com/t/params-and-loader/312082
**Category:** Uncategorized
**Created:** [July 25, 2010, 2:39am UTC](https://forum.kirupa.com/t/params-and-loader/312082 "2010-07-25T02:39:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mikeo1313](https://avatars.discourse-cdn.com/v4/letter/m/5fc32e/32.png) [@mikeo1313](https://forum.kirupa.com/u/mikeo1313)
#### Post date: [July 25, 2010, 2:39am UTC](https://forum.kirupa.com/t/params-and-loader/312082/1 "2010-07-25T02:39:45Z")

</div>

I’m able to get javascript parameters into swf with this code:

// Example from:  
// [www.permadi.com](http://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
