Pinch gesture scaled

private function onGesturePinch(e:TransformGestureEvent):void{
                var pinchMatrix:Matrix = this.transform.matrix;
                var pinchPoint:Point = pinchMatrix.transformPoint(new Point((this.width/2), (this.height/2)));
                pinchMatrix.translate(-pinchPoint.x/2, -pinchPoint.y/2);
                pinchMatrix.scale(e.scaleX, e.scaleY);
                pinchMatrix.translate(pinchPoint.x/2 , pinchPoint.y/2);
                this.transform.matrix = pinchMatrix;
}

is there a better way to do this? I find that this method is very nervous and I lose the picture often. Does anyone have a beautifully clean and smooth to scale a Sprite using pinch without losing the image off-screen. This method is inside a .as class that extends the Sprite class, there is also a similar method for the movement of rotation in this class. Thank you!!!

Keep a private in your class as attribute:

private var delay_response_id: int = 0;

Depending on your event, which received the pinch:

If (this.delay_response_id > 0) clearTimeout() don't (this.delay_response_id);

also hides the data needed for the late response

This.delay_response_id = setTimeout (MyDelay, 500); 0.5 second delay.  Change as needed

Then in your delayed function:

private void MyDelay(): void

{

This.delay_response_id = 0; reset

process cached information

clear the cached information

}

Hope that helps.

Tags: BlackBerry Developers

Similar Questions

  • Pinch the touch gesture event

    My code:

    int _lastX = - 1;
    int _lastY = - 1;
    protected boolean touchEvent (TouchEvent message)
    {
    Retrieve the new x and y of touch positions
    int x = message.getX (1);
    int y = message.getY (1);

    Boolean isGesture = false;
    int eventCode = message.getEvent ();

    if(eventCode == TouchEvent.Down)
    {
    If this event is followed by a move event, we will need
    to know the starting point.
    _lastX = x;
    _lastY = y;

    }

    if(eventCode == TouchEvent.GESTURE)
    {
    GHG TouchGesture = message.getGesture ();
    int gesEventCode = ges.getEvent ();
    If (gesEventCode == TouchGesture.PINCH_END | gesEventCode == TouchGesture.PINCH_UPDATE) {}
    isGesture = true;

    float pinchM = ges.getPinchMagnitude ();
    -To zoom out.
    If (pinchM< 0="" ){_renderer.zoom-="">
    -Zoom.
    If (pinchM > 0) {_renderer.zoom += pinchM / 2.0f ;}}
    }

    }
    {if(!isGesture)}
    if(eventCode == TouchEvent.Move)
    {
    _renderer.isAlt = true;

    Calculation of the crossing points
    int XmoveSize = x - _lastX;
    int YmoveSize = y - _lastY;
    If (XmoveSize<>
    If (XmoveSize > 0) {_renderer.rotateRX () ;}

    If (YmoveSize<>
    If (YmoveSize > 0) {_renderer.rotateUZ () ;}

    _lastX = x;
    _lastY = y;

    }

    }

    if(eventCode == TouchEvent.up) {}
    _renderer.isAlt = false;
    We have lost contact with the screen, set the last x and y
    _lastX = - 1;
    _lastY = - 1;
    }
    Returns true;
    }
    ________________________________________________________

    Hello
    I took the code above the screen touchscreen blackberry example project and modified a bit to accept the pinch gesture.
    Now I get one problem with it, the getPinchmagnitude() method always return a positive value, so how do to be able to know if it was a pinch on or a pinch in the event.

    Any response will help.
    I thank.

    Note something I've tried, but read the API, you must keep the PINCH_BEGIN value and action about the magnitude of the change between this and your greatness of PINCH gesture currently detected.  Don't forget that users might get STUCK in and out in a single step (where the use of PINCH_UPDATE), it is not only a start and end value.

  • People with disabilities multitasking gestures / Keynote

    I disabled multitasking gestures on my ipad pro, but 4-5 finger pinching gesture is always enabled when I'm in an opening statement. If I don't want the bosses to leave the presentation, I use the ipad as an interactive kiosk. When the gesture is applied, the presentation ends and returns to Keynote slide editor screen.
    Thoughts? (Note: there are various buttons on multiple slides, so using the guided access function does not really help for this application)

    It is not possible to Keynote on an iPad.

  • Since I downloaded Firefox 9 does not pinch to zoom in on my macbook. All the patches?

    I recently had a new hard drive installed on my macbook pro running Mac OS X 10.6. Now I can't pinch to zoom on Firefox. Pinch to zoom works fine on Safari, but I prefer to use Firefox. No reason or any suggestions to fix this?
    Thank you.

    The pinch gesture has been disabled by default because it was causing problems for some users. For more information, see this link: https://bugzilla.mozilla.org/show_bug.cgi?id=613909

    You can install the Add-on Pinchy to reactivate these gestures.

  • He can't handle the Pinch Zoom events?

    Hi all

    I use the following example to the event of Pinch Zoom malleable.

    protected boolean touchEvent(TouchEvent message)
    {
       switch(message.getEvent())
       {
          case TouchEvent.GESTURE:
             TouchGesture gesture = message.getGesture();
             switch(gesture.getEvent())
             {
               case TouchGesture.PINCH_END:
                 Dialog.alert("Focal point: " + message.getX(1)
                 +            ", " + message.getY(1)
                 +            "\nFinal zoom value: " + gesture.getPinchMagnitude());
                 return true;
             }
       }
       return false;
    }
    

    But this isn't woked for me. I put the breakpoint and there he never struck. My application cannot handle this event.

    Can someone tell me why?

    Thank you!
    I just found the reason that I have not activated the pinch gestures.

  • Pinch Zoom blackberry 6

    Hi all

    I use the new "Pinch Zoom" feature in my application on JDE 6.0.029.

    To do this pinch zoom on a simulator, I activated the Multitouch (Alt + M) mode and put two point

    on the screen. But I do not have TouchEvent.GESTURE TouchEvent.

    Please help (it is possible on a simulator?)

    I found the Solution

    ByDefault gestures of scanning is enable but pinching gestures is not.

    To activate this add following code:

    InputSettings inputSetting = TouchscreenSettings.createEmptySet();
    inputSetting.set(TouchscreenSettings.DETECT_PINCH,1);
    inputSetting.set(TouchscreenSettings.DETECT_SWIPE,1);
    this.addInputSettings(inputSetting);
    

    To toggle the touchEvent InputSettings can be used.

  • Pinch &amp; Zoom works in the content viewer but not the developer application

    I have all articles in PDF format, version of the viewer just tried 24. The work of pinch & zoom very well in viewer content but I just tried to create the application (simple edition for now), and the p & z does not work in the application of the developer. If that is not allowed in simple edition or am I missing something?

    The zoom allow PDF has been checked in the application builder DPS as well as advanced options in the first window.

    As always, thanks for the help!

    Yes, that makes sense. Some customers have reported problems pinch and zoom to trigger reliably with the pinch gesture. We're investigating.

    Neil

  • iOS 9.3: buttons don't work anymore on Air iPad

    After the update to iOS 9.3 the buttons on an iPad Air no longer work. Even with assistive touch enabled, you cannot let an app. What works, however, is the pinch gesture. Is there a way to fix this?

    Force restart your iPad and see if help.

    Press and hold the Home and Sleep/Wake buttons for at least ten seconds, until you see the Apple logo.

  • How to manage actions

    Hello

    I wonder how to handle gesture events, such as sliding your finger or the pinch gesture. Everyone already knows that?

    I tried but I could not find this information.

    Thank you

    -----------------

    Hello

    This is possible and supported by air. You will find all the documentation you need on the livedocs:

    http://help.Adobe.com/en_US/AS3/dev/WSb2ba3b1aad8a27b0-6ffb37601221e58cc29-8000.html

    For now, you can't simulate a gesture on a Playbook Simulator, but if you have an android device (or a mac of a paved touch multitouch), you can try on it with the same code

    Fun .

    Fabien

  • BlackBerry 10 productivity and Emails!

    I've been a user Palm and webOS until last year that I got a Galaxy Note 3. After a year of vkb, I had enough and looked at Blackberry, due to see a movie where a sheriff used a BB constantly ;-)

    However, one of my main actions on smartphones I've had is and has always been EMAILS and now I actually discovered, even BB is supposed to be the God of emails, you started with that as the first professionally - it seems that you have left out or forgotten what follows:

    -arrow indicating that I responded to an email; When I reply to an email I usually keep until the matter is closed. Now going through my emails on my Q10 and PP I don't see (using gmail) that I had already responded to this communication, there is no indication of an E-mail answered - no arrow. It costs me more time to go to the folder send to look for if I had answered or not; This option is absent and somehow seems to work with outlook accounts, but also it it shows an arrow, when sent by the mobile device.

    -by opening an E-mail on my computer or Mac app should I see on my mobile device (had with Palm and webOS and same Galaxy) that this email has been opened, ergo read by myself, so he would show also open or read on your handheld - default, this option is not available.

    I don't know how others think about it or manage their emails - but for me it is very important and makes me lose a lot of productivity on my BB moble device, I had actually expected have solved even better with the first expert mobile E-mail in the world-, but didn't... looks a bit to have stayed in time.

    This is an entry, and I wish I had a solution, but actually don't think there is one, that works for the user of the business not!

    ... or I am mistaken and there is a way to handle this?

    Lol there should be no need to display the folder sent on the BlackBerry smartphone. Go to the Hub. Display settings. Select view and Actions. Near or at the top is a drop down to select the way in which messages are displayed. I recommend that you select the option chat. Farther down is a toggle to enable or disable the display of messages sent. Seems to me that you have it. When enabled, your sent messages will be visible and identified by a check box to the left of the message. In other words, the two messages received on the device and messages sent from the device are together on the same screen. If you group by conversation, you have the entire wire together.

    I have not mentioned, but you can use the pinch gesture to hide and expose read the message, or even to define the action of pinch for another function you want in the Hub settings.

    I do not use Google and have not been paying attention to what others say. If nobody answers here, a search can be useful. Sorry I can't help with that.

  • In Lightroom for mobile, how to get back to show images less.

    In the segmented view, sorted by year, it shows some pictures and the last of them was a sign + on this topic (with the number of other images) to show to the rest. Once I press on the + sign, show all of the photos for this year. That's very nice, but I can't go back to showing images less.

    Is there a way?

    That you can do to collaps (and expand) the segment is again a 2-finger vertical pinch gesture. I hope this helps. -Guido

  • I'm the only one who run out of ideas of Adobe and can't if used to Adobe draw?

    II have tried very hard to get used to draw Adobe, after love with Adobe ideas since the day wherever she launched.

    just the fact that there is no button to remove the last action is so confused. I can't count how many times I slide a return and I see a line instead of the last deleted action, and the contrary takes place also. I even liked the better graphics.

    I am on my knees. ADOBE, if you please, bring back updated for Adobe ideas. maybe having two apps autour isn't the worst idea.

    ! What do you think of everything? I can't be the only one here !

    So, you can use the pinch gesture to get an overview of all projects, if you missed that.

    Also, if you purchase a bluetooth stylus, you can use the pen to cancel slide 2 fingers instead.

  • How can I stop my font size to change?

    Hi all

    I use pdf on my tablet to read ebooks and every time I turn a page changes the font size.  I don't see an icon to choose a font size.  I can find one to add text and highlights and if I want to read 1 continuous page, etc., but nowhere at all to set a font size to fit my view.

    I hope someone can help,

    Bravo and thank you

    Christine

    Unfortunately, you can not change the size of the font of the text in a PDF document. However, you can zoom in/out of the document based on your condition. You can do this by double tap or pinch gesture.

  • After one of the recent Firefox update the touchpad MAC cannot pinch and press (zoom) material has been checked, any ideas?

    seyit irgend einem the last Firefox update works die zoom-Funktion of touchpads to MACs nicht mehr nur bei Seiten im browser Firefox however!

    Some actions have been removed in versions of Firefox 4 +.

    You can restore the zoom feature by changing the related values of downtown on the topic: config page.

    • Browser.Gesture.Pinch.in -> cmd_fullZoomReduce
    • Browser.Gesture.Pinch.in.Shift-> cmd_fullZoomReset
    • Browser.Gesture.Pinch.out-> cmd_fullZoomEnlarge
    • Browser.Gesture.Pinch.out.Shift-> cmd_fullZoomReset
    • Browser.Gesture.Pinch.Latched-> false

    To open the topic: config page, type Subject: config in the address bar (address) and press the 'Enter' key, as you type the url of a Web site to open a Web site.

    If you see a warning then you can confirm that you want to access this page.

    • Use the filter at the top bar of the on: page config to more easily spot a preference.
    • Preferences that have changed also show "BOLD" (user set).
    • Preferences can be reset to the default value using the context menu if they are set of users
    • Preferences can be changed via the context menu: Edit (string or integer) or toggle (Boolean)
  • Since I have downloaded 8.0.1 pinch zoom does not work anymore. How to solve this?

    Since I have downloaded 8.0.1 pinch zoom does not work anymore. How to solve this?

    You can restore the zoom feature by changing the related values of downtown on the topic: config page.

    • Browser.Gesture.Pinch.in -> cmd_fullZoomReduce
    • Browser.Gesture.Pinch.in.Shift-> cmd_fullZoomReset
    • Browser.Gesture.Pinch.out-> cmd_fullZoomEnlarge
    • Browser.Gesture.Pinch.out.Shift-> cmd_fullZoomReset
    • Browser.Gesture.Pinch.Latched-> false

    To open the topic: config page, type Subject: config in the address bar (address) and press the 'Enter' key, as you type the url of a Web site to open a Web site.

    If you see a warning then you can confirm that you want to access this page.

    • Use the filter at the top bar of the on: page config to more easily spot a preference.
    • Preferences that have changed also show "BOLD" (user set).
    • Preferences can be reset to the default value using the context menu if they are set of users
    • Preferences can be changed via the context menu: Edit (string or integer) or toggle (Boolean)

Maybe you are looking for