A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Disabling function

  1. #1
    Junior Member
    Join Date
    Feb 2012
    Posts
    2

    Disabling function

    Hi i am new in AS3.
    I want to make a scope wich can zoom in on button click and go back to previous stage (zoom out) also by clicking a button.

    Now i made it work for zooming in (when i click my button it zooms) but
    when i want to zoom out everything i tried didn't work so please help.

    Here is the code:

    //button for zoom in
    zoom.addEventListener(MouseEvent.CLICK,glassMove);
    function glassMove(event:MouseEvent):void{

    addEventListener(Event.ENTER_FRAME,glassMove);
    var moveX,moveY;

    function glassMove(e:Event) {

    scope.x=m_mc.x=mouseX;
    scope.y=m_mc.y=mouseY;

    moveX = ( ((mag_mc.width-ori_mc.width)/2) * (scope.x-ori_mc.x) )/(ori_mc.width/2);
    moveY = ( ((mag_mc.height-ori_mc.height)/2) * (scope.y-ori_mc.x) )/(ori_mc.height/2);

    mag_mc.x=270-moveX;
    mag_mc.y=135-moveY;

    if(mag_mc.x<216)
    mag_mc.x=216;
    if(mag_mc.x>321)
    mag_mc.x=321;
    if(mag_mc.y<125)
    mag_mc.y=125;
    if(mag_mc.y>195)
    mag_mc.y=195;}
    }

    //button for zoom out
    zoomout.addEventListener(MouseEvent.CLICK,glassMov e2);
    function glassMove2(event:MouseEvent):void{

    //code for disabling function glassMove

    }

  2. #2
    Junior Member
    Join Date
    Apr 2010
    Posts
    18
    OP changed
    Last edited by truimagz; 02-10-2012 at 06:05 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center