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

Reply via email to