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

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


      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 :


      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 :




      * 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 ...