Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Posts: 57
Registered: ‎05-04-2009
My Device: 9550
My Carrier: Verizon
Accepted Solution


I'm trying to capture a general swipe, and have not been able to.  Here's the code:



public class MySwipeTest extends Sprite	{
    public function MySwipeTest() {
        var myLabel:Label = new Label();
	myLabel.text = "swipe this";
	myLabel.addEventListener(TransformGestureEvent.GESTURE_SWIPE, function(event:TransformGestureEvent):void {
	    myLabel.text="label swiped";

addEventListener(TransformGestureEvent.GESTURE_SWIPE, function(event:TransformGestureEvent):void { myLabel.text="swipe"; }); } }



Can anyone point out what I might be doing wrong?  Thanks in advance!


                addEventListener(TransformGestureEvent.GESTURE_SWIPE, function(event:TransformGestureEvent):void {
                    //if (event.offsetY == -1) {

Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: TransformGestureEvent.GESTURE_SWIPE

I have been trying to capture this event as well with no luck.

Like all of my posts
Posts: 192
Registered: ‎09-23-2009
My Device: 9860/PlayBook/Dev Alpha
My Carrier: Plus GSM

Re: TransformGestureEvent.GESTURE_SWIPE

Touch events are inaccessible in simulator at this moment. You my simulate them with some touch enabled devices (on mac it this large expensive trackpad which name has gone from my mind), maybe on windows or linux there is something else, but I wasn't looking.

Found my post helpfull? Like it! It solves your trouble? Help others and accept it as solution. Search before asking.
My apps: Secret Cod3s | Should my tablet be banned?
Jakub Nietrzeba
PGS Software S.A.
Your reliable partner in Poland - IT Outsourcing - BlackBerry, iPhone, Web and Standalone applications
Posts: 19
Registered: ‎03-08-2011
My Device: Bold 9700
My Carrier: Wind

Re: TransformGestureEvent.GESTURE_SWIPE


private function initView():void {
    addEventListener(TransformGestureEvent.GESTURE_SWIPE, onSwipe);


private function onSwipe(event:TransformGestureEvent):void {
    // A swipe to the left means the offsetX property will be -1
    // A swipe to the right means the offsetX position will be 1
    if(event.offsetX == -1) {
    } else if(event.offsetX == 1) {
    // The same principle applies to the vertical swipe gesture, so
    // a swipe to the top means the offsetY position will be -1
    // A swipe to the bottom means the offsetY position will be 1
    if(event.offsetY == -1) {
    } else if(event.offsetY == 1) {



Check this out


Posts: 20
Registered: ‎01-05-2011
My Device: Playbook 16GB, Curve 9300
My Carrier: MTN

Re: TransformGestureEvent.GESTURE_SWIPE

I've added an event listener for the GESTURE_SWIPE event and it is firing when I run the app on the device however the event is firing multiple times (at least 3 times) for each swipe action. Has anyone else had this problem? There is only one instance of the object registered as the event listener.

Posts: 1,008
Registered: ‎12-12-2010
My Device: Passport (Red Limited Edition)
My Carrier: Mobile Vikings

Re: TransformGestureEvent.GESTURE_SWIPE

A swipe gesture has multiple states: BEGIN, UPDATE and finally END if I recall correctly.

BlackBerry Certified Builder for Native Application Development -- Proud member of the Belgian BlackBerry Developer group
Samples: Park in Ghent
Feeling generous? Nominate me for BB Elite member!
Posts: 20
Registered: ‎01-05-2011
My Device: Playbook 16GB, Curve 9300
My Carrier: MTN

Re: TransformGestureEvent.GESTURE_SWIPE

[ Edited ]

Thanks for the tip zezke. Thats what I was missing. I added the folllowing check to make sure my code only executed at the end of the swipe event:



private function    onSwipe(event:TransformGestureEvent):void{				
	if(event.phase == GesturePhase.END){