Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1678
  • Last Modified:

creating an animated sine wave in flash

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
BobHavertyComh
Asked:
BobHavertyComh
1 Solution
 
tomaugerdotcomCommented:
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
 
BobHavertyComhAuthor Commented:
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now