----- Original Message -----
Sent: Friday, April 15, 2005 5:09
PM
Subject: RE: [flexcoders] problem with
TileList
Duccio,
I think the problem is this line:
img.load=data.thumb;
You are using "load" as if it were a settable property,
but it is actually a method of the the Image class and would therefore be used
with the following syntax:
img.load(data.thumb)
Alternately, you could set the "source" property of the
img object to achieve the same result:
img.source = data.thumb
Kris
--
Kristopher Schultz
Developer
Resource Interactive
p: 614.410.2123
Hi,
i am studying the Foto viewer
example. I have a problem loading images in a TileList, seems
like no image loads. If i use cellRenderer and dataProvider of
TileList everything's ok. Here is the source code:
Application intialize
function initApp()
{
albumSrv.send();
}
function albumSrvResult(event)
{
album=albumSrv.result.album;
photoCount=album.photo.length;
list.selectedIndex=0;
currentPhoto=album.photo[list.selectedIndex];
var
thumb:Thumbnail;
for (var i=0; i<photoCount; i++)
{
thumb=new Thumbnail();
thumb.setValue(i,
album.photo[i]);
list.addItem(thumb); //the
TileList
}
}
<?xml version="1.0"
encoding="utf-8"?>
Thumbnail.mxml
function setValue(str: String, item: Object)
{
if
(data == item)
return;
if (item==undefined)
{
visible =
false;
return;
} else
{
img.visible =
false;
data=""> img.load=data.thumb;
img.visible=true;
visible=true;
mx.core.Application.alert("data
thumb :"
+data.thumb);
}
}
function
setWidth(width: Number)
{
//mx.core.Application.alert("testProperty :"
+width);
img.width=width;
}
</mx:Script>
<mx:Image id="img" />
</mx:VBox>
No virus found in this incoming message.
Checked by AVG
Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.11 - Release Date:
14/04/2005