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

Animate curve path as3

Contributor ,
Mar 23, 2016 Mar 23, 2016

flash has every easy even code snippet for Animate horizontally .

but what about curve path ? i searched internet a lot for this but did not get any satisfactory easy to to animate along this curve . i need code . no motion tween

can you suggest me any blog or article for that?

note : i will draw curve using brush tool so pls refer no code to draw curve , rather give me code  for the movieclip (ex: man ) to run on the curve

ccc.png

TOPICS
ActionScript
1.4K
Translate
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

Community Expert , Mar 24, 2016 Mar 24, 2016

use:

stage.addEventListener(KeyboardEvent.KEY_DOWN,keydownF);

function keydownF(e:KeyboardEvent):void{

if(e.keyCode==whatever){

skateboarder.play();

}

}

Translate
LEGEND ,
Mar 23, 2016 Mar 23, 2016

One way to do this is to duplicate the blue line onto a new layer. Then you can make that layer a guide layer for the character. Here's a useful tutorial on the concept: Flash Guide Layer Tutorial

Translate
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
Community Expert ,
Mar 23, 2016 Mar 23, 2016

i don't really think you want to use actionscript for that motion, but if you do, you can use greensocks' bezier plugin for tweenmax.  otherwise, use a guide layer like rob suggested.

Translate
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
Contributor ,
Mar 23, 2016 Mar 23, 2016

its a simple car game sir . i just need to run the man in the curve using up arrow key . thats all

Translate
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
Community Expert ,
Mar 24, 2016 Mar 24, 2016

read that guide layer tutorial.

Translate
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
Contributor ,
Mar 24, 2016 Mar 24, 2016

sorry, i need to run it using keyboard event . guide layer is for only animation . i need event handling

Translate
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
Community Expert ,
Mar 24, 2016 Mar 24, 2016

use:

stage.addEventListener(KeyboardEvent.KEY_DOWN,keydownF);

function keydownF(e:KeyboardEvent):void{

if(e.keyCode==whatever){

skateboarder.play();

}

}

Translate
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
Contributor ,
Mar 24, 2016 Mar 24, 2016

is acceleration possible for this guide method ? because we are not using value here . so how will we multiply value to accelerate ?

thansj

Translate
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
Community Expert ,
Mar 25, 2016 Mar 25, 2016
LATEST

yes, you can use any of the easing properties available in animate.

Translate
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