I am trying to pass parameters to my .swf generated like this:
file:///C:/Documents%20and%20Settings/admin/Desktop/flash/comm_law/Dominoes.swf?n1=4
And have included the following code in my document class.
private var n1:int = getSWFParam(n1,5);
protected function getSWFParam(num:int, defaultValue:int):int
{
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
if(paramObj[num] != 0)
return paramObj[num];
else
return defaultValue;
}
But somehow the code is executing assuming a value of n1=2, although I have not assigned n1 as 2 anywhere. Where am I going wrong?