Re: [flexcoders] Problems using Zoom effect.

2007-05-06 Thread Manish Jethani
On 4/30/07, beecee1977 [EMAIL PROTECTED] wrote:

 mx:Zoom id=zoomEffect zoomHeightFrom=0.5
 zoomHeightTo=1 zoomWidthFrom=0.5 zoomWidthTo=1 /
 mx:Image id=im1 source=im1.png
 rollOver=zoomImg(event) rollOut=zoomImg(event)
 scaleX=0.5 scaleY=0.5 x=28 y=10/
[snip]

 The idea is the have a toolbar where as I scroll over the images are
 zoomed (ala Mac toolbar I think).
 I find that when I move the mouse slowly across the images it behaves
 as expected. However if I move the mouse more quickly all the images
 end up getting zoomed.

Use the rollOverEffect and rollOutEffect styles instead of
triggering the zoom manually. The effect styles should take care of
terminating any existing zoom effect and starting a new one when you
roll over/out the image.


[flexcoders] Problems using Zoom effect.

2007-04-30 Thread beecee1977
Hi, 

I'm having a couple of problems with Zoom effects. Here's my simple 
test application:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; 
layout=absolute
mx:Script
![CDATA[
private function zoomImg(e:Event):void
{
if (zoomEffect.isPlaying)
{
zoomEffect.reverse();
}
else
{
var x:Array = zoomEffect.play
([Image(e.target)],e.type == MouseEvent.ROLL_OUT ? true : false)
}
}
]]
/mx:Script

mx:Zoom id=zoomEffect zoomHeightFrom=0.5 
zoomHeightTo=1 zoomWidthFrom=0.5 zoomWidthTo=1 /
mx:Image id=im1 source=im1.png 
rollOver=zoomImg(event) rollOut=zoomImg(event) 
scaleX=0.5 scaleY=0.5 x=28 y=10/
mx:Image id=im2 source=im2.png 
rollOver=zoomImg(event) rollOut=zoomImg(event)
scaleX=0.5 scaleY=0.5 x=60 y=10/
mx:Image id=im3 source=im3.png 
rollOver=zoomImg(event) rollOut=zoomImg(event)
scaleX=0.5 scaleY=0.5 x=92 y=10/
mx:Image id=im4 source=im4.png 
rollOver=zoomImg(event) rollOut=zoomImg(event)
scaleX=0.5 scaleY=0.5 x=126 y=10/
/mx:Application

The idea is the have a toolbar where as I scroll over the images are 
zoomed (ala Mac toolbar I think).
I find that when I move the mouse slowly across the images it behaves 
as expected. However if I move the mouse more quickly all the images 
end up getting zoomed. 

I'm pretty sure I know the reason why, but I'm not sure what the best 
solution is. I'm guessing the the different zoomInstances are getting 
mixed up as I scroll over the different images, but what's the best 
way to keep track of them? I don't want to have a different 
zoomEffect for each image as I want this to be scaleable.

Thanks in advance.
Bill