Solved

creating an animated sine wave in flash

Posted on 2010-11-18
2
1,523 Views
Last Modified: 2012-05-10
I want to create an animated sine wave in flash where the spikes and valleys keep changing. Is it better to create a movie clip that goes across the stage or is it better to do this as a changing shape tween? Also, does anybody know of a good example of this where someone created this without action script?
0
Comment
Question by:BobHavertyComh
2 Comments
 
LVL 14

Accepted Solution

by:
tomaugerdotcom earned 500 total points
ID: 34173279
I've done exactly this for an audio simulator I created for a client. Like you, I wanted to take the easy way out and "fake" it, rather than actually have to figure out the math behind drawing a real-time sine wave.

My solution was simple: I grabbed an audio file and opened it up in a free audio editor like Audacity (http://audacity.sourceforge.net/). It shows a nice "wave" view of my audio file. I zoomed in to an interesting portion, where it looked more like a sine wave, and then exported the graphic (or took a screenshot - I can't remember which).

After that, the rest was trivial.

1. import the graphic into Flash
2. turn it into a Graphic symbol
3. throw it on a layer in flash (this image should be WAY wider than your SWF document width in order to work well)
4. on a layer above it, create a Mask, so you get a "window" to see a part of your sine wave in
5. now just create a motion tween where the sine wave moves from RIGHT to LEFT

things get a little trickier if you want it to go continuously. You have to do a little Photoshop magic to create a graphic that "loops" - in other words, it looks the same on its left edge as it does on its right edge.

Make sense?
0
 
LVL 9

Author Closing Comment

by:BobHavertyComh
ID: 34176209
OK, so use a larger motion tween that repeats rather than a shape tween. That's what i ended up doing before i saw your answer. I drew the curves and they came out ok, and then created a motion tween behind a mask, because it seemed to be too much of a hassle to have to reshape all of those point if I chose to do a shape tween instead. Thanks..
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question