So im trying to gain access to flash vars but i kept getting this error:
Line 27 1180: Call to a possibly undefined method LoaderInfo.
I have tried putting the below code in and outside of my class but it seems from what i have gathered that it thinks 'LoaderInfo' is another function which it is not.
public function getFlashVars():Object {
var paramList:Object = LoaderInfo( this.root.loaderInfo ).parameters;
var myParam:String = paramList["myParam"];
return myParam;
}
How do i get around this?
Eli
It looks like you forgot the import for flash.display.LoaderInfo
.
But you can probably just as well omit the type cast:
this.root.loaderInfo.parameters;