Hello,
I’m made a map and I want to zoom in and out. The second thing I want is to make a bounding around my MovieClip.
function initDragger(zijde2:MovieClip):void
{
zijde2.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
zijde2.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
}
function mouseDownHandler(e:MouseEvent):void
{
e.currentTarget.startDrag();
}
function mouseUpHandler(e:MouseEvent):void
{
e.currentTarget.stopDrag();
}
initDragger(zijde2);
plus.addEventListener(MouseEvent.CLICK, onImageClick);
min.addEventListener(MouseEvent.CLICK, onImageClick2);
function onImageClick2(Event:MouseEvent):void
{
if (zijde2.scaleX > .05) {
zijde2.scaleX*=.5;
zijde2.scaleY*=.5;
}
}
function onImageClick(Event:MouseEvent):void
{
zijde2.scaleX*=2;
zijde2.scaleY*=2;
}
This is my code so far and I can zoom in and out but I can keep going and going. I want that he stops after 200% or something and when he is 100% you cant zoom out more. Also I want a bounding so I cant move the MovieClip outside his own stage height and width.
Is there someone that can help me with this because I’m really stuck at this point.
Thanks