I am in the process of making some form of Image Gallery.
I get the information from the server, then loop over the results and
add them to a display panel using "addChild"
As I am creating each image, I assign the "showEffect" so that when it
show it look nice.
Then I am also assigning the mouseUpEffect and rolloutEffect, with the
idea when the image is clicked it grows (using a Zoom effect) and when
the mouse leaves the image it returns back to thumb nail size.
Here is my example code from the data retrived handler function :
================================================================
[SOME STUFF HERE]
_aFiles = event.result as ArrayCollection;
for(var i:Number = 0; i < _aFiles.length ; i ++)
{
var imgNewImage:Image = new mx.controls.Image();
imgNewImage.id = "albumImage" + i.toString();
imgNewImage.addEventListener("complete",imageCompleteHandler);
var sSource:String = "[URL TO FILE]" + _aFiles[i].PATH;
imgNewImage.source = sSource;
imgNewImage.height = 150;
imgNewImage.width = 150;
imgNewImage.cacheAsBitmap = true;
imgNewImage.visible = false;
imgNewImage.setStyle("showEffect",myShowEffect);
imgNewImage.setStyle("mouseUpEffect",myMouseUpZoomEffect);
imgNewImage.setStyle("rollOutEffect",myMakeitAThumbNailAgainEffect);
//add to display tile
imageDisplayTile.addChild(imgNewImage);
}
[ETC ETC]
=============================================================
the problem is this:
When an image is clicked EVERY image runs the "mouseUpEffect".
Since I am declaring a new image every iteration, I was expecting the
styles to be separate too. I thoght maybe assigning an ID would fix
it, but this didn't help.
Am I missing something, or is this expected behaviour, or is it a bug?
Any ideas?
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/