Solved

creating an animated sine wave in flash

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
Not only does Prezi allow you to create non-linear presentations, it also makes it easy to apply transition animations between your frames. Learn how to apply a fade-in transition to select items and entire frames in this tutorial Select "Edit Path"…

920 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

15 Experts available now in Live!

Get 1:1 Help Now