I think I have found a solution to my problem.  Dont know if its the best,
but instead of adding a listener to the image, I added a listener to the
stage and found the coordinates and width of image and made my buttons
visible when inside these coordinates.

Cordially
Vayu 


On 6/24/08 7:27 PM, "Vayu Robins" <[EMAIL PROTECTED]> wrote:

> Hi coders.
> 
> I have an issue I cant seem to find a solution to.
> 
> I have an image gallery with invisble next and previous buttons.  When the
> mouse is over the left side of the image, the left button becomes visible
> and follows the mouse.  So far so good. :-)  The problem is that when the
> button is under the mouse the button only moves when the mouse has moved
> away from the button, which creates a very jagged movement.  Furthermore,
> this can be solved if I set prevImg.mouseEnabled = false, but then I disable
> the button.
> 
> So the cursor needs to know when its over the image, even when the button is
> between the mouse and the image.
> 
> Heres code I use:
> 
> private function navigationMove(event:Event):void{
>             var target = event.target;
>             var location:Point = new Point(target.mouseX, target.mouseY);
>             location = target.localToGlobal(location);
>             if(event.target.mouseX < 278) {
>                 prevImg.visible = true;
>                 nextImg.visible = false;
>                 prevImg.x = location.x;
>                 prevImg.y = location.y;
>             }else{
>                 prevImg.visible = false;
>                 nextImg.visible = true;
>                 nextImg.x = location.x;
>                 nextImg.y = location.y;
>     }
> }
> 
> I hope someone can help me on this one.
> 
> Thanks
> Vayu
> 
> 
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to