Hi All,
I’m running into something that has me stumped. I’m trying to access a variable that I’ve added on my main timeline. I’m trying to access that variable in my .as file. I’ve been doing some research, and it said to use:
root.loaderInfo.parameters.yourVariableName
but when I try that and run a trace, I get “undefined”. It seemed to have worked for someone else (where I was reading the post) but it’s not working for me. Is there something I’m doing wrong?
My code is something like this:
Main Timeline
var stage_height:Number = stage.stageHeight;
.as File
trace(root.loaderInfo.parameters.stage_height)
result:
undefined
(Note: The stage.stageHeight changes on resize, which is set on the Main Timeline, that’s why I’m not calling stage.stageHeight directly from the .as file) Can someone tell me what I’m doing wrong?