Hi,

 

I have a repeater with a thumbnail in it.

 

Code:

 

<mx:Repeater id="rptGallery" dataProvider="{arrMdta}">

<ui:thumb imagePath="{Mdta(rptGallery.currentItem).fileName}" />                                                                        

</mx:Repeater>            

 

In my script I have

 

[Bindable]

public var arrMdta:Array = [new Mdta("assets/image001.jpg")];

 

So far so good, I see my image (inside my thumb component there’s an mx:image, nothing fancy

 

Now the harder part, I try to bind the repeater to the array (as I’m doing here, but when I change my array, it doesn’t get updated automatically.

 

In my applicationComplete, I call function init();

 

private function init():void

{

for(var i:Number = 1; i < 100; i++)

            {

var filePath:String = "assets/image";

                        if(i.toString().length == 1) filePath += "00"; // just because images have filenames image001.jpg, etc

                        if(i.toString().length == 2) filePath += "0";

                        filePath += i.toString() + ".jpg";

                        arrMdta.push(new Mdta(filePath));

}

}

 

This doesn’t work, only when I put the following line:

 

rptGallery.dataProvider = arrMdta;

 

Why is it only working if I re-force the dataProvider? I thought that was the point of binding my data?

 

Thanks for any help,

Jonas

 

Jonas Windey

Web Developer

T. +32 3 216 86 47

 

Pixco Interactive Division

T. +32 3 216 86 40

F. +32 3 216 86 49

 

http://www.pixco.com

 

__._,_.___

--
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