I have an AS3 class on my Flex project:
package system
{
import mx.managers.PopUpManager;
import ui.Eula;
public class Dialogs
{
public function Dialogs(){}
public static function showEula():void {
var eulaWindow:Eula = new Eula;
PopUpManager.addPopUp(eulaWindow,MyMainMXML,true);
}
}
}
MyMainMXML is my base MXML file. It won't let me reference to it via my class. How do I do that? The compiler error goes as follows:
1067: Implicit coercion of a value of type Class to an unrelated type flash.display:DisplayObject.
The main MXML file is a spark WindowedApplication so I assumed it's part of the DisplayObjects.
EDIT:
I tried using FlexGlobals like the one below but it gives off an error that says 1118: Implicit coercion of a value with static type Object to a possibly unrelated type flash.display:DisplayObject.
package system
{
import mx.core.FlexGlobals;
import mx.managers.PopUpManager;
import ui.Eula;
public class Dialogs
{
public function Dialogs(){}
public static function showEula():void {
var eulaWindow:Eula = new Eula;
PopUpManager.addPopUp(eulaWindow,FlexGlobals.topLevelApplication,true);
}
}
}