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

Swipe event controls timeline

Explorer ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

Hi!...

I am sorry about my silly questions but i really need your help...

I need to create an app for a touch screen where I move the screen along a landscape where I will have buttons with some information. The problem is I would like to move the landscape swiping the finger on a touch screen.

Is there any way I can use a swipe event to change frames along the time line? if so is there a way I can control only part of the timeline? I need to have some places (frames) where the swipe doesn't work.

I want to publish with AIR for desktop and I am using the latest animate cc (19.2) andI have been trying to use this code but it's not working very well...

stage.addEventListener(MouseEvent.MOUSE_DOWN, mDown);

stage.addEventListener(MouseEvent.MOUSE_UP, mUp);

var prevMouseX:int;

function mDown(event:MouseEvent):void {

prevMouseX = stage.mouseX;

   this.addEventListener(Event.ENTER_FRAME,mMove);

}

function mUp(event:MouseEvent):void {

   this.removeEventListener(Event.ENTER_FRAME,mMove);

}

function mMove(event:Event):void {

              

        var activeMouseX = stage.mouseX;

     

        if (activeMouseX > prevMouseX){

            if(currentFrame == 1){

                gotoAndStop(totalFrames);

            } else {

                prevFrame()

            }

        }

        if (activeMouseX < prevMouseX){

            if(currentFrame == totalFrames) {

                gotoAndStop(1);

            } else {

                nextFrame()

            }

        }

prevMouseX = stage.mouseX

Views

553

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

Explorer , Apr 10, 2019 Apr 10, 2019

Ok, I found a way to do it... using scenes and this same code to move the movie along the time line... If anyone can give me some opinion or more ideas about how to do it in a better way I would appreciate.

Thank you all for your help

... and once again I'm sorry if the questions are really silly...

Votes

Translate

Translate
Explorer ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

Ok, I found a way to do it... using scenes and this same code to move the movie along the time line... If anyone can give me some opinion or more ideas about how to do it in a better way I would appreciate.

Thank you all for your help

... and once again I'm sorry if the questions are really silly...

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
Adobe Employee ,
Apr 12, 2019 Apr 12, 2019

Copy link to clipboard

Copied

LATEST

There's nothing like a silly question, we all keep learning through experiments. Thank you for posting on this forum, and for sharing your solution.

Have a wonderful weekend.

Preran

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