0 Replies Latest reply on Dec 28, 2006 6:25 PM by phi2265

    accessing a component outside of application

    phi2265 Level 1
      First off, this is for a photo gallery. The gallery works right now to the point where you see a thumbnail for each set of images, and when you click on that thumbnail you see the rest of the images for that selection, this is done with tileLists and States. I need to add another state so that when one of the thumbnails is selected, you see the full image. I'm running into trouble when I specify the data field to be .selectedItem from a component not on this form. It gives me an error that it is undefined. Heres the states code...

      <mx:State name="gallerySelect">
      <mx:RemoveChild target="{galTl}"/>
      <mx:AddChild relativeTo="{gallery}" position="lastChild">
      <ns1:galSel width="100%" height="100%" data="{galTl.selectedItem}" id="galsel1">
      </ns1:galSel>
      </mx:AddChild>
      <mx:AddChild relativeTo="{canvas1}" position="lastChild">
      <mx:LinkButton id="back" label="Back to Gallery" click="currentState=''" x="33" y="107" color="#000000" themeColor="#FFFFFF" width="98" height="15"/>
      </mx:AddChild>
      </mx:State>
      <mx:State name="thumbSelect">
      <mx:RemoveChild target="{back}"/>
      <mx:AddChild relativeTo="{canvas1}" position="lastChild">
      <mx:LinkButton id="back0" label="Back to Thumbnails" click="currentState='gallerySelect'" x="33" y="107" color="#000000" themeColor="#FFFFFF" width="122" height="15"/>
      </mx:AddChild>
      <mx:AddChild relativeTo="{gallery}" position="lastChild">
      <ns1:thumbSel width="100%" height="100%" data="{galSelTl.selectedItem}" id="thumbSel1">
      </ns1:thumbSel>
      </mx:AddChild>
      <mx:RemoveChild target="{galsel1}"/>
      <mx:RemoveChild target="{galTl}"/>
      </mx:State>

      the error i get is 1120: Access of undefined property galSelTl.
      if i do galSel.galSelTl (because galSel is the form where galSelTl is) i get this error..
      1119: Access of possibly undefined property galSelTl through a reference with static type Class.


      i'm stuck. any thoughts? thanks.