Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Flash




Random / Floating Movement



Hi

I have a few Movie Clips that I'd like to attach some code to give them a kind of floating movement.

The thing is, I don't want the movie clip to move very far from its original position. It just needs to gently float a up a bit, left a bit, down a bit, etc, etc.

If anyone could help, I'd be really grateful - as I'm not great at scripting.

Thanks




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Random 'floating' Movement
hi does anybody know how to make an object 'float' around the screen? The object will move to random co-ordinates but it will ease into each coordinate.. also before it slows down completely it will move off in the direction of the new coordinate - giving a 'floating' impression. anyway that is the way i figure it maybe not the way its done.. Ive seen this kind of thing around. any ideas. just trying to save time as im not yet a programming whizz!

thanks

Random 'floating' Movement
hi does anybody know how to make an object 'float' around the screen? The object will move to random co-ordinates but it will ease into each coordinate.. also before it slows down completely it will move off in the direction of the new coordinate - giving a 'floating' impression. anyway that is the way i figure it maybe not the way its done.. Ive seen this kind of thing around. any ideas. just trying to save time as im not yet a programming whizz!

thanks

Floating Button With Random Movement
Hello all. I need help with this floating button thing. What I would like is for a button to appear (fade in) on the stage and then randomly float around slowly and of course it would bounce off the x and y axis. I would like to achieve this with actionscript alone and have more than one button floating (it's a links page so each button is a link)

Any ideas folks? Thanks

peace out,
daddy

Floating Buttons And Random Movement Help
hi there. hope tat someone could help me. i got tis script with the random movements of the buttons. the thing is, i cant get it to stop on mouse over. anyone have any idea how to do it, n yeah, on rollover would like it to change color or something n when click will go to the next frame. i have upload the fla files if u guys want it. any help is greatly appreciated. thanks alot. rame. i have upload the fla files if u guys want it. any help is greatly appreciated. thanks alot.

Help - Random Movement: Floating Balloons
Hi all,
Recently, I want to create four floating balloons which are tied up together with a thin core. Now, I need some AS in order to make them look like floating in air smoothlyand slowly along with a thin core. Also wanna give the ballons random scale motion as well. Can anyone help me please?
Thanks!

Help - Random Movement: Floating Balloons
Hi all,
Recently, I want to create four floating balloons which are tied up together with a thin core. Now, I need some AS in order to make them look like floating in air smoothlyand slowly along with a thin core. Also wanna give the ballons random scale motion as well. Can anyone help me please?
Thanks!

Floating Buttons And Random Movement Help Flash Mx
hi there. hope tat someone could help me. i got tis script with the random movements of the buttons. the thing is, i cant get it to stop on mouse over. anyone have any idea how to do it, n yeah, on rollover would like it to change color or something n when click will go to the next frame. i have upload the fla files if u guys want it. any help is greatly appreciated. thanks alot. rame. i have upload the fla files if u guys want it. any help is greatly appreciated. thanks alot.

Random Floating Orb
Okay, say I have an orb thing, how could I make it randomly move around and randomly get smaller and larger within parameters?
If you want to know what I am talking about check out www.towardthesky.com and the fireflies effect is what I am trying to do. Can anyone point me to any good tutorials?

Random Floating Bubbles
I ma trying to work out how to make a floating bubble that has been randomly scaled and moves gently in around in circular movements (randomly)... I have no idea where to start, can u help?

The bubble is a Movie Clip where i have made serveral replications of this, where different objects are placed in each one. But animating the template movie clip makes them all move in exactly the same way... So I thought making the bubble scale randomly (squash & stretch) and move in random circles is the best solution...

btw. the action script needs to be inside the bubble MC itself

er... have any ideas on how i should even start this (or is there another solution maybe

Cheerz

Random Floating Text (in MX Or MX2004)
Hello,

I've done a search and can't seem to find the right actionscript to add to a movieclip to make it appear as though it was just floating in place. Nothing complicated just a small random floating action where it's almost as though the letter is just sitting there in 0 gravity. Just slight enough movement to give it a little bit of interest.

I could make keyframes in a movieclip that would do this, but I'd like it to be a little bit more random than that. Plus, actionscripting the effect would lowere the file size.

Any tutorials, references or actionscript that could be added to a movieclip would be appreciated.

Thanks,

derek1147

How To Create A Bunch Of Random Floating Pieces?
Hi, I'm looking for a tutorial to do something like this site's header:
www.non-linear-design.com
can anyone point me in the right direction?
Thanks, Matt

Display Random Text On Stage, Floating Across Randomly
Hi

Can anyone help with a script for doing the following.

I would like to have a box where random sentances from a text file would move across at different trajectories, speeds, colors and sizes. Having more than one in view at any one time.

The application is for a musical group, we want to put our song list into a text file, then use the script to display the contents in random order. We have over 400 songs so doing this in a list would be boring.

I only have basic knowledge of Flash (using Flash MX). Im a PHP programmer.

Any ideas

Thanks Terry

Random Rotation To Equal Random Movement Direstion?
k i finally got it so that my things randomly move around the screen and have walls etc etc.. anyways now i wanna know how to make it so that my randomly moving ship will rotate to face there direction if you want i can post the code i am using for random movement and thanks in advance

Random Movement, Random Opacity?
I want to create a mc, where a box(50x200) should duplicate itself, and change width randomly. But width should stay in ranges between 50 - 250 px. The boxes should move from left to right, right to left randomly. Also they should have random opacity and random colors(different variations of blue,and red). When the boxes overlap=the opacity should change accordingly, also color changes as they mix. Is creating something like this, or similiar possible?
If so does anybody have examples.
Thnx

Random Movement AND Random Speed
So I got this from the tut on this site and it's works great.

I can't figure out though how to make the speed random as well as the movent.

I want all my little clips to move at random speeds in adition to direction.

Any clues?

Thanks!
---------------------------------------


function getdistance(x, y, x1, y1) {
var run, rise;
run = x1-x;
rise = y1-y;
return (_root.hyp(run, rise));
}
function hyp(a, b) {
return (Math.sqrt(a*a+b*b));
}
MovieClip.prototype.reset = function() {
//specify the width and height of the movie
width = 600;
height = 400;
//-------------------
var dist, norm;
this.x = this._x;
this.y = this._y;
this.speed = Math.random()*4+5;
this.targx = Math.random()*width;
this.targy = Math.random()*height;
dist = _root.getdistance(this.x, this.y, this.targx, this.targy);
norm = this.speed/dist;
this.diffx = (this.targx-this.x)*norm;
this.diffy = (this.targy-this.y)*norm;
};
MovieClip.prototype.move = function() {
if (_root.getdistance(this.x, this.y, this.targx, this.targy)>this.speed) {
this.x += this.diffx;
this.y += this.diffy;
} else {
this.x = this.targx;
this.y = this.targy;
if (!this.t) {
this.t = getTimer();
}
if (getTimer()-this.t>1000) {
this.reset();
this.t = 0;
}
}
this._x = this.x;
this._y = this.y;
};

--------------------------------
onClipEvent(enterFrame){
move();
}

[F8]random Scaling, But With Random Movement?
i am a bit lost. i make a prototype function that randomly scales a box when i click on the stage. i got the scaling right, but why does it move around when it scales?
here is the swf: scaleEase
here is the code:

ActionScript Code:
MovieClip.prototype.scaleEaseTo = function(ease){    onMouseDown = function ()    {        newWidth = 1 + Math.random() * 250;        newHeight = 1 + Math.random() * 250;    };    this._xscale += (newWidth - this._xscale) / ease;    this._yscale += (newHeight - this._yscale) / ease;};dot.onEnterFrame = function(){    scaleEaseTo(5);};

thanks in advance.

Random Movement AND Random Speed
So I got this from the tut on this site and it's works great.

I can't figure out though how to make the speed random as well as the movent.

I want all my little clips to move at random speeds in adition to direction.

Any clues?

Thanks!
---------------------------------------


function getdistance(x, y, x1, y1) {
var run, rise;
run = x1-x;
rise = y1-y;
return (_root.hyp(run, rise));
}
function hyp(a, b) {
return (Math.sqrt(a*a+b*b));
}
MovieClip.prototype.reset = function() {
//specify the width and height of the movie
width = 600;
height = 400;
//-------------------
var dist, norm;
this.x = this._x;
this.y = this._y;
this.speed = Math.random()*4+5;
this.targx = Math.random()*width;
this.targy = Math.random()*height;
dist = _root.getdistance(this.x, this.y, this.targx, this.targy);
norm = this.speed/dist;
this.diffx = (this.targx-this.x)*norm;
this.diffy = (this.targy-this.y)*norm;
};
MovieClip.prototype.move = function() {
if (_root.getdistance(this.x, this.y, this.targx, this.targy)>this.speed) {
this.x += this.diffx;
this.y += this.diffy;
} else {
this.x = this.targx;
this.y = this.targy;
if (!this.t) {
this.t = getTimer();
}
if (getTimer()-this.t>1000) {
this.reset();
this.t = 0;
}
}
this._x = this.x;
this._y = this.y;
};

--------------------------------
onClipEvent(enterFrame){
move();
}

Random Movement
Can anybody help please?

I want a movie clip to move randomly after a certain length of time, then keep looping over the same amount of time and changing the movie clips position randomly. Is there a script which will wait before executing an action, then keep looping that action until anougher condition tells it to do something else?

I tried

if (Number(getTimer()>=500){
---then do a random move function
{

The problem with this is it doesn't keep executing the script until I tell it to stop.

Thanx in advance

Nick

Random Movement
quite a simple one i'm sure.....


I have a series of objects and i want them to randomly move up and down the stage, no interaction necessary, i just don't want to have to tween 10 or so objects.

Is this possible, and is it also possible to replicate the effect of 'easing in and out'

thanks in advance....

Random Movement
i have 10 vertical bars that i want to randomly move across the screen left to right. i dont know how to accomplish this and am hoping that someone would be kind enough to expalain it to me. thank you.
josh
i_am_brucelee@hotmail.com

Random Movement For Mc
Hi everybody,
I am trying to get a movieClip to randomly move around within
a confined area of my stage. When I try to do this it moves very
irraticly and doesnt stay within any boundries.

this is what I tried:
onClipEvent(enterFrame){
this._x=Math.random()*50;
this._y=Math.random()*50;
}

I want a nice fluid motion that will stay in some defined boundries.

Thanks for the Help

Random Movement
u wud think that this wud be simple ah. simple to do, and even simpler to find. nope ..

does anyone know how i may create randomlly moving elements. ie, i want thesse incy wincy things to float around the stage. no collision detect, no nuffin'

i have looked all over this site .. i have found a couple of movie examples, but one is button triggered, and the other is waaaaaaaaaaaaay to complicated.

help Much appreciated.

thx
b

Random Movement
hej venner
could anybody helpme with a script that makes an object (button) move in an nice smooth random path (infinitly , and in an area slightly exceeding the visible)?
i would be most appreaciative@
thank you in advance
[Edited by sjovefro on 06-04-2002 at 12:23 PM]

Random Movement
I'm making a menu and when I go over the buttons I want them to shake. So i guess this would mean some random movment of some kind. Now I'm not very good at A.S., could someone code this up for me. I need the instance to shake, so in other words move from frame to frame move from one location to an other very quickly in a small amount of space.

Thank You,
Sebastien Couture

Random Movement Of MC
Please can anyone please suggest me how can i have a random movement of an movieclip using actionscript.
Arup

Random Movement
is there code that i can use to make a graphic move randomally within a rectangle on screen?

Random Movement
hey all

having some trouble with a game im making. i need an MC to reappear at a random location inside a box. im using this code

setProperty (_root.object, _y, _root.object._y=random(100-350)
setProperty (_root.object, _x, _root.object._x=random(300-250)

im only a beginner and im probably doin somthing stupid here so it would be much appreciated if someone could point me in the right direction??

cheers

Random Movement AS?
Hey,

Does anyone have any code,tips or tutorials involving random movement of an object? I don't mean random x or y values, but fluid movement. A good example would be like a fish moving around - that sort of thing...

Random Movement
Hi There,

I am using the below code to ease a movie clip to a random target, which it does, but I want it to then ease to another random target, once it reaches the target before, so in effect, it is constantly moving to random targets. Any ideas????

On frame 1:

_y=100;
targety=n;
n=random(100-600);
speed=32;


On Frame 2:

distancey=targety-_y;
amount=distancey/speed;
_y+=amount;


On Frame 3;

gotoAndPlay(2);


Thanks in advance!!!

Barry

Random Movement
Im making a game and I needs o have butterflys moving in a random way, I would be very happy for any help. I want then to curve instead of just a sharp corner.

Thanx in advance,

Random Movement
I am making a flash movie for a screen saver I have a Movieclip I want to move all around the stage on a Random basis. How would I code or script the (motion)Movieclip to move around randomly?
If you know some code or a tutorial I would appreciate the help.

Thanks.

Random Movement?
Hey everybody.

Just wondering:
How to make an as moving a MC randomly around a swf.

Example:
An ant moving around the page randomly..

Thank you for your time

Need Random Movement
anybody know of a good tute for making an object move randomly about the stage area.

Random Movement
I'm sure I’ve seen something like this before an image to move up, down, left, right and diagonally randomly using AS.

I plan to have a box let's say size 100x100 and within that box will be an image about 200x200 in size, so all you can see of the image is 100x100 (sort of masking), then the image to move randomly in all directions and if possible with random speed.


Please can someone point me in the right direction.


Many thanks


Michael

Random Movement
Hi,

I looked at some flash-sites and one site draw my attention.
I'm talking about www.derbauer.de.
In there you see a very nice flash-site.
But what I'm interested in is the background.

You see screens opening and closing, stuff appearing and so on....
At first it doesn't look so hard but the thing is, it looks like is doing that randomly.

And that the part i don't get, how does he do that?
Does anyone here know how to do something like that?
Because I don't and I would really like to know.

So would anyone be so nice and tell me or give me an example of how it is done?

Thx

Random Movement
hi everyone,

i need some action script to work with random movement. basically i need fish to swim randomly over the movie but also if they change direction the instance movies needs to be flipped.
Could anyone help me with this problem
thanks.

Random Movement
Im creating a game in which i need to make a load of objects randomly move. Does anyone know how i can do this? I also need them not to disappear off screen. If anyone could help i'd be very greatful.

Thanks

Random Movement
I would like to create some random movement for a mc i made. my stage size is 790 x 600 but the area i want the movie clip to move is is only 720 x 268. www.izzos.com/beta is where the site is and you will see the roll your own text at the top. I only want it to move within that green background area. I have used some scripts before but all of them make my text scroll around the entire stage area. Any help is appreciated, thanks.

Random Movement
Is it possible to have random movement for a movieclip within a restricted area?

If so , anyone have a clue on how to do it?

Random Movement
I'm making a game in an overhead type of view and want to know how to make a movieclip Randomly move around the map and face the direction that it is moving. I have the movie clip moving but it doesn't face the direction that it faces. Which looks really bad.

Random Movement Etc.
Hi,

I'm trying to make these fireflies: http://listic.dk/324fireflies.swf

I have loaded the thing into a flash decompiler, but I must be doing something wrong, because it doesn't work, my .fla can be found here: http://listic.dk/fireflies.fla

I would very much appreciate if one of you experts maybe could take a look at the scripting and see where I'm doing it wrong :-)

All the best

Andrew

Random Movement...
Im trying to get a movieclip to be placed on the stage (from a button press) and move randomly in one direction at one speed.


Eventually ill write the code for it to stop when it hits the edge but im just looking for the random directional movement right now...

any help would be greatly appreciated

Random Movement
you can i make a few movie clips move in a randomly around the stage?

Random Movement
Does anybody have any random code I can slap on a movieclip that will look like a bird (seagull) moving in the distance? I tried tweening it it but it just looks too repititive and boring.

Please!!!

Random Movement
Hey guys,

i'm slowly but surely piecing parts of my game together, but I was wondering if you could help...

I want a target to move around the window at random, bouncing off of the walls and then continuing on. Is this possible to do, and secondly is it easy to do, coz I have no flash skill whatsoever and this has to be completed in the next few hours.

I have the target already made into a movie clip within Flash, I just need help with the actions that have to be attatched.

any help that you can provide is greatly appreciated. Thanks.

Random Movement
Hey guys,

i'm slowly but surely piecing parts of my game together, but I was wondering if you could help...

I want a target to move around the window at random, bouncing off of the walls and then continuing on. Is this possible to do, and secondly is it easy to do, coz I have no flash skill whatsoever and this has to be completed in the next few hours.

I have the target already made into a movie clip within Flash, I just need help with the actions that have to be attatched.

any help that you can provide is greatly appreciated. Thanks.

Random Movement
Hey guys,

i'm slowly but surely piecing parts of my game together, but I was wondering if you could help...

I want a target to move around the window at random, bouncing off of the walls and then continuing on. Is this possible to do, and secondly is it easy to do, coz I have no flash skill whatsoever and this has to be completed in the next few hours.

I have the target already made into a movie clip within Flash, I just need help with the actions that have to be attatched.

any help that you can provide is greatly appreciated. Thanks.

[CS3] Random Movement
Hi everyone

i have a 779 x115 movie with text in the middle. I have a few squares which randomly move around the movie using this actionscript

onClipEvent (enterFrame) {
_x = random(779);
_y = random(115);
_alpha = random(100);
}

if i want the squares to just randomly move around the area where the text is how do i tell it to do that? corodinates are top left: 263, 65 bottom right: 515,74 probably very easy to do but im not very good at script yet.

thanks very much for your help

AS3 Random Movement
Hi there,

I'm looking to do something like this: http://www.samburdge.co.uk/developme...2#comment-8835 in AS3 and wondered if anyone could help. I'm new to Flash in general and can't seem to figure it out. Basically I want a number of move clips on the stage (preferably moving in some way) and when the mouse hits off them, they scatter/move out of its way.

Any help would be greatly appreciated.

Daria

Copyright © 2005-08 www.BigResource.com, All rights reserved