Solved

creating an animated sine wave in flash

Posted on 2010-11-18
2
1,471 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Learn how to download your full Prezi presentation for offline presenting. Prezi doesn’t have to be viewed and shared in a web browser, even with a free account you can download your full presentation to share with others. Be sure to download any vi…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now