05-07-2012 06:02 AM
Hai,
I am added 3 images in a container and place the container into a scrollpane but unfortunatly i couldn't add listner to that component anybody have the idea abou that please help me
Thanks
Deepu
05-07-2012 07:42 AM
05-14-2012 11:58 PM
I add listner to the images
05-15-2012 12:34 AM
How are you adding the images?
I've used the Event.COMPLETE on qnx.ui.display.image
var yourImage = new Image();
yourImage.setImage("sweetPic.png");
yourImage.setPosition(100, 100);
yourImage.addEventListener(Event.COMPLETE, yourFunction);
addChild(yourImage);
private function yourFunction(e:MouseEvent):void {
yourImage.setSize(500, 500);
}
You might need to adjust this for the new fuse.ui stuff (setActualSize vs. setSize, etc...)
05-21-2012 12:37 PM
If you are using mxml for it then the following code will do it :-
<s:Image id="myImage" x="497" y="171" source="assets/myImage.png" click="myImage_clickHandler(event)" />
obviously change the myPic to what you want and the x and y co-ords.
then you need a fuction is AS3 :-
protected function myPic_clickHandler(event:MouseEvent):void
{
\\ To Do
}
05-21-2012 12:51 PM
05-21-2012 01:06 PM - edited 05-21-2012 01:08 PM
Thanks for catching that jtegen! I missed the reply and the massive mistake in my sample code!
Edit: JT, you're a lot taller in person than I imagined, it was great meeting you at Jam!
05-21-2012 01:13 PM
05-21-2012 01:16 PM - edited 05-21-2012 01:21 PM
Yeah thats what i thought he wanted, clicking on the image, sorry for the confusion.
05-21-2012 01:22 PM
He might want it for when clicked on the image, the Event.COMPLETE would need to be changed accordingly in my code. Event.COMPLETE will fire when the image is loaded (so if another function changes the image, Event.COMPLETE will fire accordingly, allowing you to resize for instance.