ActionScript 2.0 :: Move On Random Sine Wave?

Jun 30, 2010

I want to make a movieclip move on random sine wave. (sine path)I m trying to do this for a week and cant get it good.I want to make the curves random. and acceleration too.(it will be a fish like character swimming)Like as in this game : http:[url]..........(the small character which swim and move smoothly)this is the portion of code im using now.

var tempEnemy:MovieClip = _root.attachMovie("enemy1","enemy_1,1);
tempEnemy._x = 500;
tempEnemy._y = 0;[code]..........

View 1 Replies


Similar Posts:


ActionScript 3.0 :: Create A Sine Wave Using Flash?

Jun 1, 2011

how to create a sine wave using flash as3?and how to add changes to the wave based on changing frequency and wavelength using a slider.

View 2 Replies

ActionScript 2.0 :: Sine Wave Picture Effect?

Jun 11, 2004

how do i make this sine wave picture effect ,wave on the horizontal insted of the vertical

)
( vertical as it is now
)

[code]....

View 11 Replies

ActionScript 2.0 :: Sine Wave/blob Effect?

Jun 8, 2006

I have a logo that I made in Fireworks, and it looks decent, but I was wondering if anyone could mimic it with movement. For example, if someone could use actionscript to make it "wiggle" or wave like a flag in the wind, that would be awesome.

Notice how the blue line itself stays at about the same thickness (it barely starts getting thicker), but the shading around it thickens as it goes more and more to the right.

Here's the image (ignore the text):

View 1 Replies

ActionScript 3.0 :: Generating A Sine Wave And Playing It As A Sound?

Jul 10, 2009

I'm generating a sine wave and playing it as a sound. But When I call  SoundMixer.StopAll() it's causing a click when sounds stops. I think its because it's cutting the sound off in the middle of the wave, I was wondering of a way to make the sine wave slowly ripple out before i stop it. Is there already functions to do this in Action Script 3 or is my sine wave function i need to modify here is my code for the wave.
  
function sineWave(event:SampleDataEvent):void {       var sample:Number    for (var i:int=0; i<8192; i++)      {        sample = Math.sin((i+event.position) * ((2 * Math.PI)/44100) * freq); // freq is just any frequency        event.data.writeFloat(sample * .15);        event.data.writeFloat(sample * .15);     }    }

View 8 Replies

Flash :: Moving And Rotating Objects Along A Sine Wave?

May 27, 2011

There are a couple of problems i'm having with this - the first is how to work out how to find where the tip of each sine curve is (ie the frequency) and the second is to work out how to rotate each object so that it slides sideways along the sine wave(note file is 800 x 600)here's my code: CarouselTest.as:

package
{
import com.greensock.easing.Sine;

[code].....

View 1 Replies

ActionScript 3.0 :: Create A Sine Wave With Any Given Angle Between 2 Points?

Jan 24, 2012

As you can tell from the title I am not very good at math ( sigh ).

Is there a way I can create a sine wave with any given angle between 2 points ?

View 3 Replies

ActionScript 2.0 :: Make A Movie Clip Go In A Sine Wave?

Jun 3, 2004

I am sooooooooo lost. I need help in making a movie clip go in a wave motion with only action script. basically I am trying to make a game and I am so lost on how to make the enemy come in and fly in a wave motion from the left to the right in an up and down motion. I thought it would be easy but I must be using the wrong code since my enemy plane is just fly from left to right and not going up and down.

View 8 Replies

ActionScript 3.0 :: Rotate A Sine Wave To An Arbitrary Angle?

Aug 5, 2011

I want to be able to take a general sine wave y=Math.sin(x) and rotate it around some other angle, so instead of going strictly left-to-right, I'd like to go from, say, the top left corner toward the "center," or from the bottom right to the center, or any other arbitrary angle. Like this: I want to be able to use that wave as a "path" for enemies in a game, but I cannot seem to wrap my head around it. I've tried matrix transformations, but I was missing something there, too, because the origin was wrong.

View 1 Replies

ActionScript 2.0 :: Make A Movie Clip Go In A Sine Wave

Jun 3, 2004

I need help in making a movie clip go in a wave motion with only action script. basically I am trying to make a game and I am so lost on how to make the enemy come in and fly in a wave motion from the left to the right in an up and down motion.I thought it would be easy but I must be using the wrong code since my enemy plane is just fly from left to right and not going up and down.

View 8 Replies

ActionScript 3.0 :: Create Sine Wave And Its Speed Will Change Depends On Change In Freequency And Wavelength

Jun 3, 2011

i want to create a sine wave and its speed will change depends on change in freequency and wavelength . and stop the wave movement when we click stop button.[code]

View 0 Replies

Flex :: Move An Object Along A Spline Or Sine Function?

Jan 20, 2011

I am trying to create a similar effect to what is used in CityVille for dropping coins and experience icons, they do a custom move animation and it first moves a little bit up and then down. It looks like it is following a spline or a sine function.

View 2 Replies

ActionScript 2.0 :: Move A Movie Clip In A Wave Motion

Jun 3, 2004

I need to move a movie clip with action script. I am writing action script to one of the layers and calling my movie clip "bird". I want to move the clip in a wave motion(like a sine wave). I am using the bird._x and bird._y and setting them equal to a variable. But the _y part of it is not moving. The movie clip is only moving from right to left and there is no upward or downward movement.

View 2 Replies

ActionScript 2.0 :: Random Interval For Wave Effect?

Jun 10, 2006

I made a semi-sinewave effect (view attachment) and it works fine with one exception. I want for it to wave on random intervals (from 1-15 seconds) instead of continuously, but I can't get it working right. Here's the code:

[AS]
pts = 5;
sine = 0;

[code].....

View 4 Replies

Flash :: Move Objects In An Array Producing A Stadium Wave Effect?

Jan 29, 2010

I want to move all objects in an array producing a stadium wave effect, how do i do that?I want to move the objects based on their y-value on the stage... all my squares are of 50x50 in size. I want to move them up then move them down

import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;

[code].....

View 1 Replies

ActionScript 2.0 :: [FMX] Random Easing - Move The Different Squares Random With A Interval

Aug 1, 2004

I have a picture on the stage covered by 12 squares (sq1, sq2, sq3.......sq12)
When the movie opens I want the squares to move down, but i want a random sequence ( 3, 9, 2, 12...........8). I already made de function for the movement:

[Code]...

View 6 Replies

ActionScript 3.0 :: Get A Mc To Move Around The Screen At Random?

Oct 20, 2009

but i have a problem i am triing to get a mc to move around the screen at random and bounce off the walls so it doesnt go off screen

View 1 Replies

ActionScript 2.0 :: Ball To Move In A Random Direction 0-360?

Sep 6, 2005

I would like the Ball to move in a random direction 0-360,Then i would like the Ball to richoche off of the BallBoundry in its reflected direction.

View 2 Replies

IDE :: Can Make Objects Move With Random Speed

Dec 16, 2010

how i can make objects move with random speed.i have 3 objects but their speed is handeled by the timeline how i can make them move with random speed

View 4 Replies

ActionScript 3.0 :: Random Move Not Working With Movies In Array?

Jan 5, 2012

I would like to randomly move three movie clips, placed in an array, within a set box. The script below worked with used with one movie clip, but not with all in an array.

var clipSpeed:Number= 1;
var speedX:Number = 0
var speedY:Number = 0

[code]....

View 3 Replies

ActionScript 2.0 :: Movieclip - Move To A Random Location Within Certain Boundries

Jul 27, 2004

I want to code a button to duplicate a movieclip instance and I want it to move to a random location within certain boundries. I can duplicate it okay but i can't figure out how to move it.

View 1 Replies

ActionScript 2.0 :: Random Motion - Objects Don't Move Off The Screen

May 11, 2005

I am using the random motion code found here at Kirupa. [URL]I have the code working fine but I have a question about fixing it to my needs. The way it is now, you change the height and width variables so that the objects don't move off the screen. This works fine, if you are using the whole screen area at:

[Code]...

View 2 Replies

IDE :: Sine Waves And Stuff?

Aug 4, 2009

I have a specific request or a general pondering really.I know you can create a sine wave type thing with as, could you then perhaps create movie clips, letter by letter that would move along and up and down on this sine wave?could you then, instead of setting the size and scale of the sine wave have it react to the input levels of a mic.i've been hunting for something that will help for a while and have drawn a blank

View 5 Replies

ActionScript 2.0 :: Function - Movie Move In Random Directions Instead Of The Glass Shard?

Apr 2, 2005

I am making a game that involves a function that makes a bottle randomly explode in all directions. The function is on the main frame of my game and is linked to several movie clips inside the bottle. When the conditions are right, the movie clips should call the function and then fly out in random directions. The problem is, when i put the code directly onto the movie clips it works fine, but when i attempt to use it as a function is makes the entire movie move in random directions instead of the glass shard. My only guess as to why this happens is because this '_this.' command somehow applies to my main frame because that is where the function originates.

View 4 Replies

IDE :: Random Movement - Randomly Move A Ball Inside A Bigger Circle

May 26, 2009

I am trying to figure out a way to randomly move a ball inside a bigger circle. The motion has to be smooth and completely random.

View 1 Replies

ActionScript 2.0 :: [F5] - Random Loading Image Layer - Can't Move On With The Page Or Site

Sep 1, 2003

I've tried 3 different scripts for a random loading image layer and none of them work. Does anyone have code/script for this that will work for Flash 5? I'm totally hung up at this stage and can't move on with the page or site until I have this aspect resolved.

View 12 Replies

ActionScript 2.0 :: [Flash MX] Draw Sine And Other Functions Using The Drawing Api?

Sep 17, 2003

how draw sine and other functions using the drawing api ? so far all my efforts have yielded amazing random designs but not the desired functions.

View 5 Replies

ActionScript 2.0 :: Dynamic Text On Sine Curve Path?

Mar 16, 2005

Basically I need to have text from a dynamic/input textfield to appear in a wavy line pattern automatically. Now I'm pretty sure it can be done fairly easily with the right knowledge but I unfortunately lack that knowledge.

The idea I had was that a string is broken into individual letters and each is placed along a sine curve of a set length/width - the string/characters are repeated if necessary in order that the full width of the curve is covered. Also note that the text need not be rotated to match the lines, only _x and _y values need to be adjusted.

I have to produce a design with dynamic text similar to this (my ascii art skills are crap so please imaging that these are wavy lines rather than zig zags):

/////////////////
/////////////////
/////////////////
/////////////////
/////////////////

I have nothing to offer apart from the satisfaction of producing a wavy text pattern and from knowing that you have saved me from a breakdown.

View 3 Replies

ActionScript 3.0 :: Sine Waves - Create A Wind Variable To Make A Kite Fly

Jul 17, 2009

With Keith Peter's "Actionscript 3.0 Animation" book it's dead easy to make one that oscillates smoothly between two fixed values but I need one that varies it's oscillation randomly (within reason of course). Imagine the teeth of a saw, up-down-up-down-up-down, very dull. What I want is more like a range of mountains, the same smooth change in height but less regular.

View 8 Replies

ActionScript 2.0 :: Create A Loop Which Generates A Single Series Of Sine Results Ranging From 0 To 1 Based On 100 Loops?

Jan 20, 2006

I'm trying to create a loop which generates a single series of sine results ranging from 0 to 1 based on 100 loops ( ie 0 ,0.011 ,0.1111........up to 1 in a single run)The results I want start at 0 and increment in a series up to 1 and then stop. I suppose this would be one half of a sine wave I have tried the following but it goes from 0 to 1 ,1 to 0 , 0 to 1 etc whereas I want a single straight run of 100 values from 0 to 1

I tried :

for(var i:Number=0;i<=100;i++){
trace((0.5*Math.sin(i)) + 0.5);
}

This does not work.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved