7 Replies Latest reply on Aug 29, 2009 2:44 AM by EnTomBet

    Access to object in xmlns

    EnTomBet

      Hi,

      I've come across such a silly probem shown in example below:

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:views="*" creationComplete="initApp()">
          <mx:Script>
              <![CDATA[
           import mx.controls.Text;
           public function initApp()
           {
            label1.text = "View1 changed";
           }          
           ]]>
          </mx:Script>
          <views:view1 label="view1" width="100%" />
      </mx:Application>

       

      view1.xml file contains:

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%">
      <mx:Label id="label1" x="10" y="50" text="View1"/>
      </mx:Canvas>

       

      It renders error:


      1120: Access of undefined property label1.

       

      How can I access label1 object from main file?