PDA

View Full Version : how to make source path dynamic


mahehsan
07-29-2009, 06:29 AM
hi,
i'm new in flex.Here is my problem

<mx:HorizontalList id="horizontalList" height="100" columnCount="6" dataProvider="{arr}">
<mx:itemRenderer>
<mx:Component>
<mx:Image width="100" height="100" source="../../user/mahedi/weeding/album/{data}"/> /mx:Component>
</mx:itemRenderer>
</mx:HorizontalList>

i want to make source path dynamic. i mean i collected userName and albumName from php and i could print in flex.But when i use in source like this this way source="../../user/{userName}/{albumName}/album/{data}" i fond error. how can i solve that please help me

shubs6
07-29-2009, 01:31 PM
Do one thing. when you read the variables userName and albumNamefrom PHP then make a string variable src like,



var src:String = "../../user/" + userName + "/" + albumName + "/album/";
img.source = src; //img is the id of yr image tag



This should do the trick. And if this does not then use



img.load(src);

mahehsan
07-30-2009, 03:30 AM
Hi,
Shubhra.Thank you very much for your reply.

shubs6
07-30-2009, 05:56 AM
No problem Mahesh :-)

shubs6
07-30-2009, 05:57 AM
sorry for spelling yr name wrong mahehsan (http://www.actionscript.org/forums/search.php3?do=finduser&u=92030&starteronly=1) :-)