• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

How to swipe particular area only in Air for IOS

Participant ,
Jul 27, 2016 Jul 27, 2016

Copy link to clipboard

Copied

Dear Friends,

iam creating an app for iOS using Air and AS3. I have a strip below my screen in that I have set of buttons to click and go to particular lessons. iam creating swiping for those buttons. I have this below code:

Multitouch.inputMode = MultitouchInputMode.GESTURE;

stage.addEventListener (TransformGestureEvent.GESTURE_SWIPE, fl_SwipeHandler);

function fl_SwipeHandler(event:TransformGestureEvent):void

{

switch(event.offsetX)

{

  // swiped right

  case 1:

  {

   sw_area.buttons.x += 20;

   break;

  }

  // swiped left

  case -1:

  {

   sw_area.buttons.x -= 20;

   break;

  }

}

}

The above code makes the buttons inside the swipe area strip to move while swiping on the stage... I want the user to swipe on the swipe area strip available blow and move the buttons. if user swipes on the stage it should not move. how can I do it? pls help me friends.

I changed like

sw_area.addEventListener (TransformGestureEvent.GESTURE_SWIPE, fl_SwipeHandler);

it is not working. pls help me to fix this.

Thanks in Advance,

Syed Abdul Rahim

TOPICS
Development

Views

206

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Jul 28, 2016 Jul 28, 2016

hi friends,

I solved it, may be usful to others.. I used stageY to control.

Multitouch.inputMode = MultitouchInputMode.GESTURE;

stage.addEventListener (TransformGestureEvent.GESTURE_SWIPE, fl_SwipeHandler);

function fl_SwipeHandler(event:TransformGestureEvent):void

{

switch(event.offsetX)

{

  // swiped right

  case 1:

  {

     if ( event.stageY > 650) {

        sw_area.buttons.x += 20;

     }

        break;

  }

  // swiped left

  case -1:

  {

     if ( event.stageY > 650) {

        sw_area.buttons.x -= 20;

     }

 

...

Votes

Translate

Translate
Participant ,
Jul 28, 2016 Jul 28, 2016

Copy link to clipboard

Copied

LATEST

hi friends,

I solved it, may be usful to others.. I used stageY to control.

Multitouch.inputMode = MultitouchInputMode.GESTURE;

stage.addEventListener (TransformGestureEvent.GESTURE_SWIPE, fl_SwipeHandler);

function fl_SwipeHandler(event:TransformGestureEvent):void

{

switch(event.offsetX)

{

  // swiped right

  case 1:

  {

     if ( event.stageY > 650) {

        sw_area.buttons.x += 20;

     }

        break;

  }

  // swiped left

  case -1:

  {

     if ( event.stageY > 650) {

        sw_area.buttons.x -= 20;

     }

        break;

  }

}

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines