Try constructing the entire URL in script and assign it to the image!
 
var imgSource:String = "http://www.mySite.com/pictures/"+photoID+".jpg"
 
<mx:Image id="myImage"
source="
{imgSource}"/>
 
Sree
----- Original Message -----
From: yaagcur
Sent: Saturday, January 21, 2006 12:07 AM
Subject: [flexcoders] Sourcing an image using a variable in URL (Flex 2)

I have a line

<mx:Image id="myImage" source="http://www.mySite.com/pictures/1234.jpg"/>

which I want to generalise using a variable photoID to something like

<mx:Image id="myImage"
source="http://www.mySite.com/pictures/"+photoID+".jpg"/>
This produces a compile error as the " appears before end of URL. I
tried the &quot; option but just get the broken image icon as a result

Any ideas what correct dode is , please








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




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to