Hi All,
I am using item renderer for displaying image in one of the columns of datagrid. The problem is, when I am providing the full path like - "/User/Images/icon.png", image is not being rendered. However when I put that image in "src/assets" folder and give path like - "assets/icon.png", image gets displayed.
Could anyone please suggest what is going wrong?
Here is the code snippet for item renderer
//Start
<mx:Image xmlns:mx="http://www.adobe.com/2006/mxml"
width="250"
height="40"
source="{data.Icon}"
verticalAlign="middle"
horizontalAlign="left"
scaleContent="false"
maintainAspectRatio="true"/>
//End
When data.Icon is "/User/Images/icon.png": Not being displayed.
When data.Icon is "assets/icon.png" : Being displayed.
I guess, I have to provide relative path.
Thanks,
D.A
To further expand on Zak's response:
The reason it was not working was that you need to provide a valid url for a File object.
For more details on the format of urls and nativePaths pertaining to local files, take a look at the AIR File documentation:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/fla sh/filesystem/File.html
Harbs
North America
Europe, Middle East and Africa
Asia Pacific