# Quick Fix- Component Parameters

**URL:** https://forum.kirupa.com/t/quick-fix-component-parameters/274970
**Category:** flash
**Created:** [November 7, 2008, 4:34am UTC](https://forum.kirupa.com/t/quick-fix-component-parameters/274970 "2008-11-07T04:34:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Ibanez1](https://avatars.discourse-cdn.com/v4/letter/i/3bc359/32.png) [@Ibanez1](https://forum.kirupa.com/u/Ibanez1)
#### Post date: [November 7, 2008, 4:34am UTC](https://forum.kirupa.com/t/quick-fix-component-parameters/274970/1 "2008-11-07T04:34:35Z")

</div>

So I have a question that (hopefully) somebody can answer quickly.  
I’m making a component and I’ve found that a parameter that I make inspectable is not getting initialized early enough. Basically, I know I’m doing something wrong in the way I declare/use the variable, but I don’t know what. Perhaps my entire class structure is off.  
Here’s the basic structure of the class:

```auto

package
{
	import fl.core.UIComponent;
	//More import statements...
		
	public class Param extends UIComponent
	{
		//I don't want to initialize this, I'm doing it as an example. I want this value to be set by the user in the parameter inspector-thingie
                protected var _paramSource:String = "pictureIDontWant.jpg";
		//Other variables...
								
		[Inspectable(type="String")]
		public function get paramSource():String
		{
			return _paramSource;
		}
		
		public function set paramSource(param:String):void 
		{
			_paramSource = param;
		}
                

                public function Param():void
		{
		}
		override protected function configUI():void 
		{
			super.configUI();
			var paramLoader:UILoader = new UILoader();
                        trace(_paramSource); //Outputs: pictureIDontWant.jpg
			var paramURL:URLRequest = new URLRequest(_paramSource);
			paramLoader.load(paramURL);
			paramLoader.addEventListener(Event.COMPLETE, loadedHandler);
			paramLoader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
		}
		
		private function errorHandler(e:Event)
		{
			//Does stuff
		}
		
		private function loadedHandler(e:Event)
		{
			//Calls a function to get to the other stuff
                       trace(_paramSource); //Outputs: the user input from the component inspector
                       doSomethingUseful();
		}
       }
}

```

As you can see, the parameter picks up on the user’s input for the parameter, but too late (after the wrong picture is loaded). Is there any way I can get that variable initialized before I load it’s value via paramLoader?  
Any help is hugely appreciated.
