3 Replies Latest reply on Jul 17, 2007 8:18 AM by joe28sfl

    Actionscript in a Custom Component

    joe28sfl
      Can anyone tell me if you can put actionscript inside of a custom component? It throws errors anytime I try to do it.

      I have a horizontallist component that is being populated with an itemrenderer which holds an image component. The horizontallist takes fifteen images and loads them into the itemrenderers, creating a scrollable image slideshow.

      I am trying to get it to check to see if the image loaded successfully, and if not, either set the visibility of that image component to false, or remove it.

      Here is the code for the horizontallist:
      <mx:HorizontalList
      id="imageBar"
      itemRenderer="listingImage"
      height="330"
      width="925"
      paddingLeft="5"
      paddingRight="5"
      rollOverColor="#FFFFFF"
      selectionColor="#FFFFFF"
      >

      And the code for the custom component.....
      <mx:Canvas
      xmlns:mx=" http://www.adobe.com/2006/mxml"
      height="320"
      width="400"
      verticalScrollPolicy="off"
      horizontalScrollPolicy="off"
      >
      <mx:Image
      source=" http://www.urladdress.com/idx/rmls/images/resimages/{data.id}_{data.imageNum}.jpg"
      height="300" scaleContent="true"
      />
      </mx:Canvas>

      I'm pretty new to Flex, so any help would be great!