Highlighted

Swipe event controls timeline

Explorer ,
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

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...

Views

309

Likes

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

Swipe event controls timeline

Explorer ,
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

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...

Views

310

Likes

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
Apr 10, 2019 0
Explorer ,
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...

Likes

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
Reply
Loading...
Apr 10, 2019 0
Preran LATEST
Adobe Employee ,
Apr 12, 2019

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Apr 12, 2019 1