how to use mxml component in another mxml component actionscript code
for ex. in my main mxml file
private var warningMessage:Warning;//this is variable
if (!_controller.flashVars.chatSession || _controller.flashVars.chatSession == "")
{
warningMessage.includeInLayout = true;
warningMessage.visible = true;
}
else
{
_controller.flashVars.showWarningMessage = "2";
}
private var warningMessage:Warning;
(warning is external custom component)
warningMessage.visible=true
(and i want use it like this in my actionscript code
but i am getting error saying "Type was not found or was not compile time constant:warning
")
There are three things that jump out.
new
to generate a new object. In your code above, warningMessage
is null.private var warningMessage:Warning = new Warning();