I'm using a LoadManager from way back and I'm trying to use it with a new project. The original code is as follows:
And it comes up with a 'Warning' !!! See below !!!
Description Resource Path Location Type 3608: 'application' has been deprecated since 4.0. Please use 'FlexGlobals.topLevelApplication'.LoadManager.as line 16 Flex Problem
And this Msg. 'Deprecated since 4.0 Please use FlexGlobals.topLevelApplication' ???
Thanks in advance regards aktell2007
since flex 4, use FlexGlobals.topLevelApplication instead of Application.application
ie: FlexGlobals.topLevelApplication.systemManager.stage.addEventListener(Event.ENTER_FRAME, enterFrame);
also, for your example, you dont need the systemManager or stage reference so you can simplify it to: FlexGlobals.topLevelApplication.addEventListener(Event.ENTER_FRAME, enterFrame);
In addition to the instruction provided by Lee Burrows, in the event you're using Flash Builder, make sure you explicitly import it, like so:
Even though it provides the package and class name via 'intelllisense', you'll get an error something like this if you don't:
1120: Access of undefined property in FlexGlobals.