2 Replies Latest reply on Dec 18, 2009 8:44 AM by BoydMills

    .mxml .as syntax question

    BoydMills Level 1

      login.mxml file:
      <?xml version="1.0" encoding="utf-8"?>

      width="600" height="400" horizontalCenter="0" verticalCenter="0"
      backgroundAlpha="0.3"  backgroundSize="100%"


      <mx:Image scaleX="0.3" scaleY="0.3" left="5" id="WelcomeVCILogo"  />


      loginbase.AS FILE:
            WelcomeVCILogo.data = VCIConfigurationData.Image;

      generates error:
      1120: Access of undefined property WelcomeVCILogo. VCI/src/com/vcicontrols/gui LoginBase.as line 150 1261149262122 3420

      The odd thing is that when I comment out the offending line and step over it with the debugger, the variable WelcomeVCILogo is viewable.

      If I change the code to put brackets around the variable:  (WelcomeVCILogo.data)  the program compiles and executes but nothing happens.  The value of .data does not change.

      In the flex builder environment, it does not autosense when I place the dot at the end of  WelcomeVCILogo to show a list of available properties.

      Note this is not the application level - it is an offspring.

      What is the proper syntax to resolve the image id at this level?

        • 1. Re: .mxml .as syntax question
          Gregory Lafrance Level 6

          mx.core.Application.application.WelcomeVCILogo.data = VCIConfigurationData.Image;




          parentApplication.WelcomeVCILogo.data = VCIConfigurationData.Image;




          parentDocument.WelcomeVCILogo.data = VCIConfigurationData.Image;


          If this post answers your question or helps, please mark it as such.

          Greg Lafrance

          Flex Development and Support Services

          • 2. Re: .mxml .as syntax question
            BoydMills Level 1

            All three ways of doing it compile and execute

            but all generate the error:



            ReferenceError: Error #1069: Property WelcomeVCILogo not found on VCI and there is no default value.

            at com.vcicontrols.gui::LoginBase/GetConfigurationResult()[C:\from luc 4 point\VCI\src\com\vcicontrols\gui\LoginBase.as:151]

            at flash.events::EventDispatcher/dispatchEventFunction()



            This is frustrating because WelcomeVCILogo can be displayed in the "variables" debug display pane as this.WelcomeVCILogo.


            But I cannot compile this.WelcomeVCILogo !!!!!!!!!!!!!!!!!!