flex - how to use mxml component in another actionscipt -
how use mxml component in mxml component actionscipt code
for ex. in main mxml file
private var warningmessage:warning;//this variable if (!_controller.flashvars.chatsession || _controller.flashvars.chatsession == "") { warningmessage.includeinlayout = true; warningmessage.visible = true; } else { _controller.flashvars.showwarningmessage = "2"; }
private var warningmessage:warning;
(warning external custom component)
warningmessage.visible=true
(and want use in actionscript code
but getting error saying "type not found or not compile time constant:warning
")
there 3 things jump out.
- if component in swc file, make sure reference in project settings
- import namespace or call directly (com.whatever.namespace.warning)
- make sure call
new
generate new object. in code above,warningmessage
null.
private var warningmessage:warning = new warning();
Comments
Post a Comment