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.

  1. if component in swc file, make sure reference in project settings
  2. import namespace or call directly (com.whatever.namespace.warning)
  3. make sure call new generate new object. in code above, warningmessage null.

private var warningmessage:warning = new warning();


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -