4 Replies Latest reply on Mar 23, 2011 2:38 AM by patrickmfp

    Change the "broken link" picture from a mx:image

    patrickmfp

      Hi all,

       

      I'm on Flex4 in Flash Builder.

      When I'm loading a mx:image source from a XML, and when the balise <sourceImage></sourceImage> of my XML is empty, I've the broken link picture at screen. Normal but ... ugly :

      http://uppix.3dvf.com/images/capturwcw.png

      I would like changed this "broken link" picture, with a full transparent PNG, or hide the mx:image when his source his null.

       

      How can I do that ?

       

       

      Code Samples :

       

      * In my XML :

      <SourceImage></SourceImage>

       

       

      * In Flash Builder :

      <mx:Image id="myImage" width="100" source="{mySource}" />

       

       

      * I tried :

       

      -----

      protected function myImage_showHandler(event:Event):void

       

       

      {

           if (myImage.source == 'null') myImage.source = "nothing.png";

      }

       

      -----

      <mx:Image id="myImage" source="{mySource}" show="myImage_showHandler(event)" />

       

      -----

       

      But nothing ...

       

      Regards,

      Skyrick