I have an image that I am setting from a variable ("path") that is 
set by a webservice call. The problem is some of the images are 
missing. In that case, I want to substitute a default image. Here is 
the code I used that loops through for each item:

<mx:Image id="img" height="160" source="{path}" ioError="setDefaultImg
();" showBusyCursor="true" />

It works great for the images that are there, and when an image is 
missing it calls the setDefaultImg function. However that is where I 
have problems. Here is that function:

public function setDefaultImg():void
{
        img.load('assets/pic/defaultITM.jpg');
}

My understanding from the Flex help is that the <mx:Image> tag 
inherits from the SWFLoader which is supposed to have a method 
of "load". It doesn't give me an error when I save the file, but when 
I run it I get an error of "TypeError: Error #1006: load is not a 
function."

Can anyone tell me what I am doing wrong? Thanks! 

David




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to