3 Replies Latest reply on Mar 18, 2008 11:57 AM by SiHoop

    parentDocument not working

    SiHoop Level 1
      I've used parentDocument several times in the past to embed an image in a DataGrid, but now it won't work. Below is the deconstructed file. I get an error message when I click on the image:
      Error #1069: Property clickMe not found on fileName and there is no default value.
      Why won't parentDocument work? Am I missing something very simple?
      Thanks for looking!
      ________________________

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application width="100%" height="100%" xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Script>
      <![CDATA[
      import mx.collections.ArrayCollection;
      [Bindable]
      private var classesColumn:ArrayCollection;
      private function clickMe():void{
      trace("success")
      }
      private function test():void{
      trace("test")
      }
      ]]>
      </mx:Script>
      <mx:ArrayCollection id="myAC">
      <mx:Array id="myArray">
      <mx:Object label="MI" data="Lansing"/>
      <mx:Object label="MO" data="Jefferson City"/>
      </mx:Array>
      </mx:ArrayCollection>
      <mx:DataGrid id="classesDataGrid" dataProvider="{myAC}" itemClick="test()">
      <mx:columns>
      <mx:DataGridColumn >
      <mx:itemRenderer>
      <mx:Component>
      <mx:HBox>
      <mx:LinkButton click= "parentDocument.clickMe()" width="20"
      upSkin="@Embed(source='../assets/trashCan.png')" overSkin="@Embed(source='../assets/trashCan.png')"/>
      </mx:HBox>
      </mx:Component>
      </mx:itemRenderer>
      </mx:DataGridColumn>
      <mx:DataGridColumn dataField="label"/>
      <mx:DataGridColumn dataField="data"/>
      </mx:columns>
      </mx:DataGrid>
      </mx:Application>