armaluca
June 16th, 2009, 08:23 AM
Hi guys!
Im creating an image gallery with XML.
In few words i have a buttons' array
for(i=0;i<array_buttons.lenght;i++){
array_buttons[i].id=i;
}
I use the property ID for calling the image from the XML file, by a listener associated with the CLICK event on the buttons in my "array_buttons".
[..]
function load_image(event:MouseEvent):void{
var image_url = my_images[event.currentTarget.id].@IMAGE;
[..]
}
the gallery works fine but i added to the gallery a "next" button .
By clicking on the "next" button i wanna show the next image (if i have Image1 on stage, clicking "next" im gonna see image2 !)
my function getNextImage has a counter "CurrentImage", but i dont know how to pass it the ID of the last button that i've clicked (so that i can show the next image!)
anybody can help?
thanx
Im creating an image gallery with XML.
In few words i have a buttons' array
for(i=0;i<array_buttons.lenght;i++){
array_buttons[i].id=i;
}
I use the property ID for calling the image from the XML file, by a listener associated with the CLICK event on the buttons in my "array_buttons".
[..]
function load_image(event:MouseEvent):void{
var image_url = my_images[event.currentTarget.id].@IMAGE;
[..]
}
the gallery works fine but i added to the gallery a "next" button .
By clicking on the "next" button i wanna show the next image (if i have Image1 on stage, clicking "next" im gonna see image2 !)
my function getNextImage has a counter "CurrentImage", but i dont know how to pass it the ID of the last button that i've clicked (so that i can show the next image!)
anybody can help?
thanx