1 Reply Latest reply on Jun 2, 2009 4:14 PM by Michael Borbor

    Is that possible to add a listener to a class that bind with a image?

    zubinshi

      Hello, I am trying to add listener to a class that binds with image.  For example, I want to add listener to customDividerSkin(see example below, i bold and underline the text), so when user click the customdividerSkin image haloGreen box will be hided. Thanks,

       

      <?xml version="1.0" encoding="utf-8"?>

      <!-- http://blog.flexexamples.com/2008/09/18/customizing-the-divider-skin-on-a-dividedbox-conta iner-in-flex/ -->

      <mx:Application name="HDividedBox_dividerSkin_test"

      xmlns:mx="http://www.adobe.com/2006/mxml"

      layout="vertical"

      verticalAlign="middle"

      backgroundColor="white"

      initialize="init();">

       

      <mx:Script>

      <![CDATA[

      [Embed("arrowLeft.png")]

      private const customDividerSkin:Class;

       

      private function init():void

      {

      dividedBox.setStyle("dividerSkin", customDividerSkin);

      }

      ]]>

      </mx:Script>

       

       

      <mx:HDividedBox id="dividedBox"

      horizontalGap="24"

      width="100%"

      height="100%">

      <mx:ViewStack id="AddFormViewStack"

        width="100%"

        height="100%">

      <mx:Box id="box1"

      backgroundColor="haloGreen"

      width="100%"

      height="100%"

      minWidth="100"/>

      <mx:Box id="box2"

      backgroundColor="haloBlue"

      width="100%"

      height="100%"

      minWidth="100"/>

      </mx:ViewStack>

      </mx:HDividedBox>

       

      </mx:Application>