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

Wavy Line Animation

Community Beginner ,
Feb 12, 2013 Feb 12, 2013

Copy link to clipboard

Copied

Hey I am looking for a example of making a wavy line wave animation.  I have not been able to find one.  Does anyone have one or seen one?

TOPICS
ActionScript

Views

2.5K

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
Guest
Feb 12, 2013 Feb 12, 2013

Copy link to clipboard

Copied

Not sure exactly what you're after, but this should be pretty easy to do - either with something like TweenLite/Max and it's bezier tweening, or with the regular Graphics methods - just clear and draw on each frame...

Here's a simple example - just paste this into frame 1 of a new .fla:

var a:Array = [new Point(10,10), new Point(50,50), new Point(100,10)];

var inc:int = -2;

addEventListener(Event.ENTER_FRAME, update);

function update(e:Event):void

{

          graphics.clear();

          graphics.lineStyle(1,0xff0000);

          graphics.moveTo(a[0].x, a[0].y);

          graphics.curveTo(a[1].x, a[1].y, a[2].x, a[2].y);

 

          a[1].y += inc;

          if(a[1].y < 0 || a[1].y > 150){

                    inc *= -1;

          }

}

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
Community Beginner ,
Feb 12, 2013 Feb 12, 2013

Copy link to clipboard

Copied

I want it to be more like this and the wave move accross the line.

wave.png

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
Community Expert ,
Feb 12, 2013 Feb 12, 2013

Copy link to clipboard

Copied

LATEST

mask the display region, add a full wave (double what you showed) movieclip 1/2 of which is not shown because of the mask and tween the movieclip's x property

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