1 Reply Latest reply on Jan 13, 2010 5:18 PM by Gregory Lafrance

    Inline item <mx:Image ...> in <mx:itemRenderer > could not see the defination of method

    glen08 Level 1

      I have following code and got a compilation error ("possiblely called an undefined function") because the <mx:Image ...> in the <mx:itemRenderer > could not see the defination of "aMethod" method:


      <mx:Form ....>






      private function aMethod(evt:Event):void {
                 // code...


      <mx:Canvas label="Tile View" width="100%" height="100%" >

                <mx:TileList id="photosTileList" dataProvider="{this.photoDP}" width="100%" height="100%"  >
                          <mx:itemRenderer >
                                  <mx:Image horizontalAlign="center" source="{data.url.text()}"
                                      toolTip="{data.caption.text()}" width="55" height="38" complete="aMethod(event)"/>  <!-- It causes the error -->


               <mx:Image .... complete="aMethod(event)"/>  <!-- It is OK here -->





      I do not know why the inline <mx:Image> inside <mx:itemRenderer> can not see the "aMethod" function defination in the same mxml file.

      Any suggestions?