The mouse wheel events to perform a zoom in and zoom out

Hi all

I have this for my function:


var Mydelta:int;
var zoomAmt:int = 35;

addEventListener (MouseEvent.MOUSE_WHEEL, Myzoom);

function Myzoom(event:MouseEvent):void
{
Mydelta = event.delta;

If (Mydelta > 0)
{
images_mc. Width += zoomAmt;
images_mc. Height += zoomAmt;
}
Else if (Mydelta < 0)
{
images_mc. Width = zoomAmt;
images_mc. Height = zoomAmt;
}
}

But I want to zoom out to stop at the size of the document

Help, please.

Thanks in advance.

scaleX defaults 1.0 use a reasonable increase

var zoomAmt:Number is. 1;

function Myzoom(event:MouseEvent):void

{

Mydelta = event.delta;

If (Mydelta > 0)

{

images_mc. ScaleX += zoomAmt;

images_mc. ScaleY += zoomAmt;

}

Else if (Mydelta<>

{

If (images_mc.width - zoomAmt > = stage.stageWidth)

{

images_mc. ScaleX = zoomAmt;

}

If (images_mc.height - zoomAmt > = stage.stageHeight)

{

images_mc. ScaleY = zoomAmt;

}

}

}

Tags: Adobe Animate

Similar Questions

  • Animate CC - HTML 5 Canvas - on the mouse wheel event necessary Javascript code

    Hi all

    I'm from AS3 transition to JavaScript and it is harder than I thought.

    Can anyone suggest code JS code on the mouse wheel event timeline will play?

    Or even better on scroll down it moves forward and upward timeline scrolling back?

    Very appreciated

    Simon

    document.getElementById('canvas').addEventListener ('mousewheel', f.bind (this));

    document.getElementById('canvas').addEventListener ('DOMMouseScroll', f.bind (this));

    {function equation

    e.Detail

    }

    [left ActionScript 1 and 2 for Adobe host CC - general]

  • Disable the mouse wheel events Flex scrollbar (Flex 3)

    I am currently working on a Flex project where the main of the application can load Flash .swf files or Flex .swf files. Some of these swf files have content (text, movieclips, etc.) that scroll with the scroll bars. That's fine when the .swf file is based Flex, but when the Flash .swf is based event triggers mousewheel scroll bar of the main application and the .swf scrollbar at the same time. Is there a way to disable the event mousewheel on the scroll bar of the main application (or any Flex container)?

    Add an eventlistener with a higher priority and call stopImmediatePropagation

  • Disable the mouse wheel on a scrolling text box?

    I'm quite familiar with Actionscript, and this has baffled me completely. What I'm trying to do is prevent people from scrolling a TextArea with their mouse wheel, as the text box is inside a ScrollPane and now scrolling allows to scroll the other (double scroll). Initially, I tried:

    tArea.textField.mouseWheelEnabled = false;

    However, it did not work. After some research, I found some suggestions to replace the function childrenCreated of my class that extends the text box, ala

    override protected function childrenCreated (): void {}
    super.childrenCreated ();
    textField.mouseWheelEnabled = false;

    }

    but this won't work in Actionscript 2. Finally, after some research, I found some suggestions to intercept and disable events, ala


    this.addEventListener (ScrollEvent.SCROLL, this.disableScrollHandler);
    textField.addEventListener (MouseEvent.MOUSE_WHEEL, disableMouseHandler, true);
    verticalScrollBar.addEventListener (MouseEvent.MOUSE_WHEEL, disableMouseHandler, true);
    addEventListener (MouseEvent.MOUSE_WHEEL, disableMouseHandler, true);
    textField.addEventListener (MouseEvent.CLICK, disableMouseHandler, true);
    verticalScrollBar.addEventListener (MouseEvent.CLICK, disableMouseHandler, true);
    this.addEventListener (MouseEvent.CLICK, disableMouseHandler, true);
    .
    .
    .
    function disableMouseHandler(event:MouseEvent):void {}
    trace ("disableClickHandler");
    Event.preventDefault ();
    event.stopPropagation ();
    }
    function disableScrollHandler(event:ScrollEvent):void {}
    trace ("disableClickHandler");
    Event.preventDefault ();
    event.stopPropagation ();
    }

    But this has not as well. I have something wrong? Is it just not possible? What is the problem here?

    Thank you
    Stephen M.

    Strange... in order to make it work I had to do both methods, that is to say in my TextArea subclass, I put

    textField.mouseWheelEnabled = false;

    and I created a listener to stop the spread of the mouse wheel event:

    addEventListener (MouseEvent.MOUSE_WHEEL, disableMouseHandler, true);
    ...
    function disableMouseHandler(event:MouseEvent):void {}
    event.stopPropagation ();
    }

    It does not exactly what I need it to do, as it make sure the ScrollPane does not receive the scroll event either, but I can ignore it or find a workaround.

  • Zoom using the mouse wheel?

    I just upgraded from PSE 5 to 9.  One of the very practical functions in PSE 5 was the use of the mouse wheel to zoom in or on a photo that you work in the editing workspace.  Now it seems I have to use brackets or the clumsy zoom tool.


    Is there a way I can activate/change something so I can zoom with the mouse wheel?  Thank you.

    In addition, the type on drop-down menus is harder to read than in PSE 5 because the type is small and he is revered in black.  I'll explore the PSE 8 workspace.  Maybe I upgraded from too far.

    Open a photo in "Full Photo editing" mode.

    Select Edition > Preferenes > General.  Check the box that says 'Zoom with scroll wheel. "

    Bob

  • How change the mouse wheel as next/previous in Windows Photo Viewer?

    Hello!
    Is there a way do so mouse wheel it change between PVS moroccoin instead of zoom?
    By default if the mouse has 5 buttons, the 4th and 5th buttons jump to the previous/next image.

    Thank you.

    Hi vanowm,
     
    The mouse wheel is generally used of the Zoom feature in the Windows Photo Viewer. Unfortunately there is no possibility to change the default setting for the mouse in next/previous wheel in the Windows Photo Viewer.

    You could look for some third-party tools to see if there is no possibility to do.

    Warning: This response contains a reference to third party World Wide Web site. Microsoft provides this information as a convenience to you. Microsoft does not control these sites and no has not tested any software or information found on these sites; Therefore, Microsoft cannot make any approach to quality, security or the ability of a software or information that are there. There are the dangers inherent in the use of any software found on the

    Varun j: MICROSOFT SUPPORT
    Visit our Microsoft answers feedback Forum
    http://social.answers.Microsoft.com/forums/en-us/answersfeedback/threads/ and tell us what you think

    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Resizing an Image in the mouse Enter event

    Today is my first time trying this and I saw it at the spinning my wheels.

    I have Adobe Acrobat Pro DC

    I created a PDF form.  I put a button above (set the fill color to orange).

    Under properties I put

    Options

    layout = icon only

    Behavior - Push

    State = reversal

    has chosen the icon and closed.

    When I rollover button orange change button and indicates my icon image correctly.

    I want to take place, when I roll over the button I want the image to grow much larger.

    Can someone get me going in the right direction.

    Thank you

    -dan

    Add another button, make a grand as you want the image to appear, set its icon on the image you want to display, and set read-only. In the other button, set the mouse enter action on "show/hide a field" and configure it to display the image button. In the mouse exit event, do the same thing, but configure it to hide the button image.

  • Mouse wheel events

    Hello!

    Do you know how can I catch mouse wheel events (for example, mouse wheel upwards) with AE SDK? I guess I can do it using the HWND handle (I'm working on Windows), but I am interesting in how to do it using the AE API.

    Thank you!

    AE does not effect with mouse wheel events.

    only, the clicks, drags and when the cursor enters an area of the user interface.

    HWND is the way to go, but I think that you can use if your plug-in is a Palette CEAP.

  • How to scroll by using the mouse wheel on a parent scroll pane

    Hi guys,.
    Imagine a table. In each cell of the table represents a component of a get. All aspects of ahmed are configured so that the scroll bar is visible only when it is necessary.
    Then, ALL cells contain scroll shutters, but only a few of them actually show a scroll bar.
    The entire table (which is very large) is also in a global scroll pane and is drop-down.

    My problem:
    I want to use the mouse wheel to scroll on the entire table. Because the table contains all its cells do scroll panes, the inner scrollpanes takes very quickly focus and global scrolling stops immediately.
    How can I force the weel mouse seize ONLY on the overall scroll pane? So basically not to transfer events to its internal components?

    I tried to disable the mouse wheel on all aspects of internal scroll:
    xxx.setWheelScrollingEnabled(false);
    ... but it doesn't.
    Any idea?

    So basically not to transfer events to its internal components?

    You must manually transfer the events to the external component to scroll.

    Using the concepts presented in [url http://tips4java.wordpress.com/2009/08/30/global-event-listeners/] Global event listeners, you can do something like:

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    
    public class ScrollSSCCE extends JPanel
    {
         public ScrollSSCCE()
         {
              setLayout( new BorderLayout() );
    
              Box tables = Box.createVerticalBox();
              final JScrollPane scrollPane = new JScrollPane( tables );
              add( scrollPane );
    
              for (int i = 0; i < 5; i++)
              {
                   JTable table = new JTable(20, 4);
                   JScrollPane sp = new JScrollPane( table );
                   sp.setPreferredSize( new Dimension(300, 200) );
                   sp.setWheelScrollingEnabled( false );
                   tables.add( sp );
              }
    
              long eventMask = AWTEvent.MOUSE_WHEEL_EVENT_MASK;
    
              Toolkit.getDefaultToolkit().addAWTEventListener( new AWTEventListener()
              {
                  public void eventDispatched(AWTEvent e)
                  {
                       Component source = (Component)e.getSource();
    
                      if (source != scrollPane
                        &&  SwingUtilities.isDescendingFrom(source, scrollPane) )
                      {
                           MouseWheelEvent mwe = (MouseWheelEvent)e;
    
                        MouseWheelEvent event = new MouseWheelEvent(
                                  scrollPane,
                                  mwe.getID(),
                                  mwe.getWhen(),
                                  mwe.getModifiers(),
                                  mwe.getX(),
                                  mwe.getY(),
                                  mwe.getXOnScreen(),
                                  mwe.getYOnScreen(),
                                  mwe.getClickCount(),
                                  mwe.isPopupTrigger(),
                                  mwe.getScrollType(),
                                  mwe.getScrollAmount(),
                                  mwe.getWheelRotation());
    
                             scrollPane.dispatchEvent( event );
                      }
                  }
              }, eventMask);
    
         }
    
         private static void createAndShowUI()
         {
              JFrame frame = new JFrame("ScrollSSCCE");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.add( new ScrollSSCCE() );
              frame.setSize(330, 600);
              frame.setLocationRelativeTo( null );
              frame.setVisible( true );
         }
    
         public static void main(String[] args)
         {
              EventQueue.invokeLater(new Runnable()
              {
                   public void run()
                   {
                        createAndShowUI();
                   }
              });
         }
    }
    
  • By pressing the mouse wheel Center is no longer, a link opens in a new tab.

    By pressing the mouse wheel Center is no longer, a link opens in a new tab. I tried to disable all add-ons, the problem still exists. I tried upgrading my mouse driver, it was already up to date.

    I already tried all the advice from this old question: http://support.mozilla.org/en-US/questions/783155?s=mouse+scroll+wheel+open+new+tab & r = 0 & as = s

    Firefox 14.0.1 on Windows 7. I use a Case Logic wireless mouse. There was a recent update from Windows. The opening in a new ability to tab disappeared after this updated, but not immediately after.

    Do a "Reset Firefox" seems to have solved the problem.

  • My mouse is running on Win XP and when trying to scroll by using the mouse wheel - it 'slides' return

    My mouse works on Win XP and when trying to scroll with mouse wheel - in Excel or IE8 - screen scrolls sometimes or to return to his position earlier some lines and "slips".  I tried with the evolution of the mouse, but a new one made in same way. Two mouse works perfectly on the other PC. Help, please!

    Hi Stamen.

    I understand that you can not correctly scroll with the mouse wheel.

    1. What is the brand and model of the mouse?
    2. is it a mouse wireless or wired mouse?
    3. did you of recent changes to the computer?

    I suggest to see the next procedure and check if it helps.

    Method 1:


    You can read the article and check if it helps.

    The problems with the mouse button or scroll the parameters


    http://support.Microsoft.com/kb/303091

    Method 2:


    You can also check out the article and check if that helps.

    Mouse, touchpad and keyboard with Windows problems


    http://Windows.Microsoft.com/en-in/Windows/help/Mouse-touchpad-and-keyboard-problems-in-Windows

    Hope this solves the problem. If you still experience this issue, then you can get back to us with the result and more information on this issue.

  • HP TouchSmart Desktop PC 600-1120: disable the mouse wheel click

    Hello

    I have a HP TouchSmart 600-1120 Desktop PC, and I want to disable the click of the scroll of the mouse wheel, so it only scrolls up and down and is not clickable. The click is so sensitive, it's difficult to scroll without accidentally clicking the wheel.

    I can't find the right Wizard or the controls for this. Can you tell me the driver please?

    Thank you

    Here are the specifications of your desktop HP TouchSmart 600-1120 According to the specification, this model left the factory with Windows 7 64 bit installed. I have a HP 320-1120 m, which also uses Windows 7 64 bit and I have been unable to locate the mouse settings that would be necessary you to disable this feature. You can search on internet of the possible options.

    Please send Bravo

  • trying to turn the mouse wheel effects by clicking on

    Anyone know how to disable the effect by clicking the mouse wheel?

    Some mice may have a button just behind the two main buttons that switches click or not to click. It's a hardware thing inside the nouse. Look at the manual of the mouse or the reviews on the mouse for more info...

  • InDesign CS5 for windows only allow me to scroll through the functions with the mouse wheel

    Nice day

    InDesign CS5 for Windows only allow me to scroll through the functions with the mouse wheel and for example not allow me to access drop down menus, any help will be much appreciated

    https://helpx.Adobe.com/InDesign/KB/InDesign-tools-panels-Don ' t - respond.html

  • Moving the sliders in CS6 with the mouse wheel?

    In CS3 after clicking on the 'triangle' scabbard I can then adjust it with the mouse wheel.  I don't seem to be able to do this to the CS6.  This can be remedied?

    What operating system do you use?

    Could you give an example of one who has worked in cs3, but not in cs6?

Maybe you are looking for

  • T530 and Webcam clear plate cover

    How to order Kit T530 clear plate and plastic cover Webcam?I did find the items on ebay, but you must order through Lenovo. Thank you NO part number here http://www.manualslib.com/manual/722758/Lenovo-ThinkPad-T530.HTML?page=65#manual http://www.eBay

  • Problem recurring in windows problem reports and Solutions to hpslpsvc32.dll

    I have a HP Photosmart Premium C309g-m printer with a wireless connection to my desktop PC running Windows Vista Home premium with service pack 2. When I turn the PC on a message come saying that windows may help resolve computer problems. When I loo

  • Performance with svchost.exe (Vista)

    I am running Windows Vista with 2 GB of RAM... Whenever I boot, the computer works well for a few moments, but performance falls so seriously... I checked the Task Manager and saw that several processes called svchost.exe... They took good 1.5 GB of

  • After the installation of the OC windows 7 audio driver cannot be installed

    My computer is Toshiba satellite A40-s270 is designed for Windows XP after the installation of the co win 7 the sound is not coming on the icon of speakes I see X in red. What can I do to get the sound [Moved from comments]

  • BlackBerry Smartphones UDPDatagramConnection hangs on receive()

    Hello I'm having a problem using UDPDatagramConnection in my BlackBerry application.  I read a lot on the discussion forums on the UDP connections multithreaded applications the main thread of hunger.  However, my situation is a little different. I h