Hi,

try
newImage.data = //set here and you can access it in the click handler
newImage.addEventListener(MouseEvent.CLICK, doStuff);

Peace, Mike

On 9/4/07, oneproofdk <[EMAIL PROTECTED]> wrote:
>
>   Hi
>
> I'm adding images to a vbox using as and addchild.
> Only thing is, that I cant figure out how to make the image accept a
> click - see below:
>
> private function updatePageList(data:ArrayCollection):void {
> for (var i:int=0; i<data.length; i++) {
> var newVB:VBox = new VBox();
> newVB.id = i.toString();
> var newImage:Image = new Image;
> newImage.source = data[i].fn;
> newImage.buttonMode = true;
> newImage.useHandCursor = true;
> //newImage.click = "doStuff(data.fn)"; <-- Doesnt work
> newVB.addChild( newImage );
> pagelist.addChild( newVB );
> var newLbl:Label = new Label();
> newLbl.text = data[i].pageno;
> pagelist.addChild( newLbl );
> }
> }
>
> Anyone that can help - please step up :-)
>
> Thanks,
> Mark
>
>  
>



-- 
Teoti Graphix
http://www.teotigraphix.com

Blog - Flex2Components
http://www.flex2components.com

You can find more by solving the problem then by 'asking the question'.

Reply via email to