-
1. Re: addEventListener in a function
Ned Murphy Apr 23, 2011 7:25 PM (in response to barpos)What should be avoided, and I know you've heard this before, is nesting functions in other functions.
-
2. Re: addEventListener in a function
Lee Burrows Apr 23, 2011 9:20 PM (in response to barpos)hi
it doesnt work because you used "myStage" instead of stage
-
3. Re: addEventListener in a function
barpos Apr 23, 2011 10:58 PM (in response to Ned Murphy)Then, I'm stuck. When, I put it outside the OnComplete listener function, the resizeDisplay gets executed unexpectedly.
Any workaround to this?
Regards,
Ron
-
4. Re: addEventListener in a function
barpos Apr 23, 2011 11:07 PM (in response to Lee Burrows)Hmmm, the trace() line below never displays anything in the output panel when I resize the Flash movie past a test movie (Ctrl-Enter). Come to think of it, it might be because I'm not in StageScaleMode.SHOW_ALL. I guess I don't need that function anymore under that mode after all.
// Redraw the screen upon browser resizing
// -----------------------------------------------------
function resizeDisplay(event:Event):void
{
trace("I'm in resizeDisplay listener");
// redisplay stage objects to reflect new stage size
stage.scaleMode = StageScaleMode.NO_SCALE;
backgroundPositioning(myStage.stageWidth, myStage.stageHeight);
stage.scaleMode = StageScaleMode.SHOW_ALL;
}
myStage.addEventListener(Event.RESIZE,resizeDisplay);
// -----------------------------------------------------;



