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




Random Smooth Waving Line



Hi guys,

I've searched the net and I couldn't find anything on this.

I have this line:



And I want it to randomly wave like if it was a hair in the wind, or like a snake moving, or even like a flame waving.

Is there any way of doing it with actionscript?

Is it also possible to make react to the cursor? When I pass through it with the mouse it moves, like if I just touched it.

Thank you very much



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 08-10-2006, 07:03 AM


View Complete Forum Thread with Replies

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

Random Smooth Waving Line
Hi guys,

I've searched the net and I couldn't find anything on this.

I have this line:

http://img216.imageshack.us/img216/3...inglineej8.png

And I want it to randomly wave like if it was a hair in the wind, or like a snake moving, or even like a flame waving.

Is there any way of doing it with actionscript?

Is it also possible to make react to the cursor? When I pass through it with the mouse it moves, like if I just touched it.

Thank you very much

Random Smooth Waving Line
Hi guys,

I've searched the net and I couldn't find anything on this.

I have this line:



And I want it to randomly wave like if it was a hair in the wind, or like a snake moving, or even like a flame waving.

Is there any way of doing it with actionscript?

Is it also possible to make react to the cursor? When I pass through it with the mouse it moves, like if I just touched it.

Thank you very much

Waving Line
Hi, i want to create waving line (like sin or cos) from point A to point B.
Does somebody knows good tutorials or examples about this?

Thanks

[F8] Waving Line, Flagella Cilia
Hey all.

I am working on coding a waving line. The issue I am having is getting each segment movieclips Y position to be at the end of the previous segment with this line of code:


PHP Code:



segment[i]._y = newY+Math.cos(newR)*10;




This is the entire code in the first frame of an empty movieclip.


PHP Code:



/*
VARIABLES
*/
segTotal = 25;
segLength = 10;
rotationLimit = Math.random()*20+15;
rotationSpeed = Math.random()*.01;
rotationRate = Math.random()*.0001;
cycleStart = Math.random();
/*
CONSTRUCT
*/
segment = [];
segment[0] = seg;
this.createEmptyMovieClip("seg", this.getNextHighestDepth());
seg.lineStyle(2, 0x000000, 100);
seg.moveTo(0, 0);
seg.lineTo(10, 0);
for (i=1; i<segTotal; ++i) {
    var segment_mc = seg.duplicateMovieClip('seg'+i, i, {_x:(i)*segLength});
    segment[i] = segment_mc;
}
/*
MOVEMENT
*/
seg1.onEnterFrame = function() {
    for (var i = segTotal; i>1; --i) {
        newY = segment[i-1].y;
        newR = segment[i-1]._rotation;
        segment[i]._y = newY+Math.cos(newR)*10;
        segment[i]._rotation = segment[i-1]._rotation;
    }
    var timer = getTimer();
    var segCycle = timer*cycleStart;
    this._rotation = Math.sin(segCycle*rotationSpeed+Math.cos(segCycle*rotationRate)*Math.PI*2)*rotationLimit;
};

Waving Flag Effect - How Do I Create A Waving
flag for a golf course scene? I'm wondering if there are any tutorials out there, i can't seem to find anything. Thanks!

Waving Flag Effect - How Do I Create A Waving
flag for a golf course scene? I'm wondering if there are any tutorials out there, i can't seem to find anything. Thanks!

[AS]how To Make Line More Smooth?
hi, the code below will let the line to follow my mouse, but the curve is a little bit too sharp, it's not like a smooth curve when I move my mouse...how can I make the follow line more smooth?..thanks


Code:
this.createEmptyMovieClip("test", 1);
onEnterFrame = function(){
lineStyle(1, 0, 100);
lineTo(_xmouse, _ymouse);
}

Drawing Application With Smooth Line
Hello all,
Can anybody tell me how can I create a drawing application with smooth lines without any angles... I actually need some logic for it...
I have very tight deadline... So I dont have much time...
Can anybody help me ?
Best Regards,
Maulik

Drawing Application With Smooth Line
Hello all,
Can anybody tell me how can I create a drawing application with smooth lines without any angles... I actually need some logic for it...
I have very tight deadline... So I dont have much time...
Can anybody help me ?
Best Regards,
Maulik

Smooth Random?
hello!
i got this random script from a flash book. it makes the ball bump around randomly in a area 200x200. is there anyway to make it smooth, instead of the circle popping about here and there?

bluX = random(200);
bluY = random(200);
circle._x = bluX;
circle._y = bluY;

thanks!
nitroblu

Smooth & Random AS Movement
Hi Guys...

Here's the script:

onClipEvent (enterFrame) {
xPos = this._x;
randomNum = Math.round(Math.random()*(max-min+1)+(min1));
trace(randomNum);
this._x = xPos+randomNum;
}

Im trying to move an object (like a cloud), smoothly and randomly across the screen...

But this is a bit jerky, any ideas?

Thanks, Rob

[F8] Smooth Random Movement
i have this code

Code:
offx+=(random(4)-random(4))/5;
offy+=(random(4)-random(4))/5;
if(Math.abs(offx)>2){
offx = Math.floor(offx/2);
}
if(Math.abs(offy)>2){
offy = Math.floor(offy/2);
}
scope._x=_xmouse+offx;
scope._y=_ymouse+offy;

but it is jerky i want it to move smoothly. Anyone know a better way?

Smooth Random Motion?
Hey all,

I'm trying to create a preloader effect with random motion and having a lot of trouble...

Basically, there is a bar into which 10 "pieces" (mcs) fit inside. I want the mcs to float around the stage randomly, and as each 10% of the movie is loaded, one mc stops floating around and slides into place on the loading bar. Hopefully that makes sense? It's been done before, so maybe you've seen the effect out there.

Anyway, no matter what I've tried I can't get the mcs to float around randomly, let alone do what I want them to do. Can someone point me in the right direction? I did manage to get a clip to duplicate 10 times, and then give each clip a random location on the stage. From there, every script I've tried either moves things around WAY too quickly/abruptly, or the pieces all end up moving to the same coordinates. I want each to move individually, and with a nice smooth animation rather than assigning a value and just jumping them around.

I have no idea what I'm doing wrong, and at this point my code is fouled up royally and is all but useless or I would post that. Can someone give me an idea how to do this? Any help would be great! Some code, a tutorial, whatever...I'm open.

Thanks.

Smooth Transition Between Random Colors
how can I make a smooth transition between random colors?
so far I have this done:

this is on the frame action:

myColor= new Color (_root.box);
_root.b1.onRelease = function(){
myColor.setRGB(_global.rndColor)
}

and this is in a movie clip which is off stage, generating a random
value:

onClipEvent (enterFrame) {
_global.rndColor=Math.round(Math.random()*0xffffff );

}

There is a nice one in the tutorials, but I'm not able to use it for some reason. Maybe because it is not for MX 2004.

can anybody help?

Smooth Transition Between Random Colors
how can I make a smooth transition between random colors?
so far I have this done:

this is on the frame action:

myColor= new Color (_root.box);
_root.b1.onRelease = function(){
myColor.setRGB(_global.rndColor)
}

and this is in a movie clip which is off stage, generating a random
value:

onClipEvent (enterFrame) {
_global.rndColor=Math.round(Math.random()*0xffffff );

}

There is a nice one in the tutorials, but I'm not able to use it for some reason. Maybe because it is not for MX 2004.

can anybody help?

Q: Smooth Random Hovering Motion
Hi
I'm trying to achieve a smooth hovering motion (think kite or floating balloons) but so far what I have is too jerky.

Can anyone offer some tips/suggestions??

Flash 5: Stuck Trying To Combine Random Colours With Smooth Transitions.. Please Help
ok im trying to create a clip of a dot that fades randomly between four pre defined colours whilst also randomly varying in the size range 0 - 100%. i am trying to create a smooth size tween also.
this is my attempt:


size = random(100);
setProperty ("purple", _xscale, size);
setProperty ("purple", _yscale, size);
myArray = ["0x399FB6", "0xCBC5D7", "0x5A3084", "0xffffff", "0x399FB6"];
myArray[0] = 0x399FB6;
myArray[1] = 0xCBC5D7;
myArray[2] = 0x5A3084;
myArray[3] = 0xffffff;
myArray[4] = 0x399FB6;
col = random(4);
myColor = new Color(purple);
purple._alpha=100;
myColor.setRGB(myArray[col]);


where purple is the next key frame instance of the dot with a tween between the two (ie purple and the one with the above script).

this script randomly changes both the size and colour in the desired way but for nothing can i get the dots to fade / change smoothly


help with this and i will be forever indebted..

here is the fla

Getting A Random Point On A Line
Is there a way to get a random point on a line. What I am trying to do is make a random spark that will travel between two paths. OS I want to be able to draw a random curved path on top and another random curved path on the bottom and have my electricity travel between the two paths. So I need to beable to get a random point on both lines.

Thanks in advance and if any one knows a good site that someone has dome this then please let me know. They have it on the Erain Web Site in the logo up top, but I want to beable to create this once and put it anywhere. Thanks again, Costa

Random Draw Line
Hi all,

I am a newbie in flash MX here and I really need help from everyone. I am currently creating a flash action script which require me to create a game which will randomly draw line when you click on the dot.

The game will be done this way.... There will be a dot in the middle of the scene and when the user click on the dot, 3 lines will spread out randomly from the dot of different length and at different directions. At the end of the line drawn, there will be a dot at the end of the line which the user can in turn click on it and 3 more lines will spread out... the rule is not to collide with any of the line and touch the border of the scene...

Can anyoune out there please help- me here with my problems as I really do not know how should I do... Thanks.

Warmest Regards
Fernado

Random Line And Anomilies
please check out my site - here

please skip the intro and tell me why there is a random line between the BOTM and MEDIA skulls. i need this finished for tomora so please help me.

Paul

Random Line Generation?
How can I randomly generate lines that look like scratches on an old movie reel? They aren't really lines I guess, more like free-form objects...i dnno. If anyone knows what Im looking for, please steer me in the right direction :-)

Random Line Draw
Okay, Hey Guys!
I am trying to get an effect like http://www.lindsaylohanmusic.com/news.asp at the header when her picture comes up, the lines draw all by themselves and then they reverse the same way.
Just so they randomly draw squiggly, loopy, big sqiggles all over the scene. I think its a cool effect.
Thanks

Random Line Animation
Hello, i'm trying to make a line randomly move to a different point. (curveTo).

Now the first time the line moves it goes smoothly, but after that it doesn't go like i want it.

This is the as i currently have, i hope somebody can help me out
Code:

var controlX:Number;
var controlY:Number;
var currentX:Number;
var currentY:Number;

var firstMove:Boolean = false;

var amount:Number = 10;

stage.addEventListener(Event.ENTER_FRAME, randomLine);

function randomLine(e:Event):void {
   if (firstMove == false) {
      controlX = Math.round(Math.random() * stage.stageWidth);
      controlY = Math.round(Math.random() * stage.stageHeight);

      currentX = Math.round(Math.random() * stage.stageWidth);
      currentY = Math.round(Math.random() * stage.stageHeight);
      firstMove = true;
   }
   
   if (currentX > controlX) {
      currentX -= amount;
      controlX = Math.random() * stage.stageWidth;
   } else if (currentX < controlX) {
      currentX += amount;
   }
   if (currentY > controlY) {
      currentY -= amount;
      controlY = Math.random() * stage.stageHeight;
   } else if (currentY < controlY) {
      currentY += amount;
   }
   
   graphics.clear();
   graphics.lineStyle(1);
   graphics.moveTo(0, stage.stageHeight / 2);
   graphics.curveTo(currentX, currentY, stage.stageWidth, stage.stageHeight / 2);
}

Random Mask Line Effect
Hi,

I have seen this effect a lot of times, but I haven't any idea how it works.

http://www.oscardelarenta.com/flash.html

Are the masked lines and boxes just prebuilded movie clips, or are the randomly targetted with actionscript?

Otherwise...does anyone knows a good tutorial on the web or in flashkit about this subject?

Tia

A.

Random Line From Text File?
Great help so far, hopefully someone here can help me with this as well!

Is it possible for actionscript 2 to choose a random line from a text file and then display it somehow? Dynamic Text for example?

Random Animated Bezier Line From One Mc To Another
Been working on trying to get this line wobble script to work in a different way, but no success thus far. I would like to keep the curves going all the way to the destination mc. your help is greatly appreciated. Thanks!!

Action Script:

var x = 300;
var y = 50;
var boo = this;
cliparray = [];
for (var i = 0; i < 10; i++) {
var clop = attachMovie("t", "t" + i, i + 100);
clop._x = 200 + x;
clop._y = i * clop._height + y;
clop.mytext.text = "target " + i;
cliparray.push(clop);
}
delete i;
function myfunction(a) {
for (var i = 0; i < a.length; i++) {
var clip = this.createEmptyMovieClip("paper" + i, i);
clip._x = x;
clip._y = y;
var clap = clip.createEmptyMovieClip("mc", 1);
clap.ivar = i;
clap.a = a;
clap.startx = 0;
clap.starty = 0;
clap.vely = Math.random() / 10;
clap.velx = Math.random() / 10;
clap.cc = 20 + random(30);
clap.anglex = 0;
clap.angley = 0;
clap.targetx = a[i]._x - x;
clap.targety = a[i]._y - y;
clap.count = random(20);
clap.onEnterFrame = move;
clip.onEnterFrame = draw;
}
}
myarray1 = [this["t" + 0], this["t" + 1], this["t" + 2]];
myarray2 = [this["t" + 7], this["t" + 8], this["t" + 9]];
myarray3 = [this["t" + 2], this["t" + 3], this["t" + 4], this["t" + 5], this["t" + 6], this["t" + 8], this["t" + 9]];
for (var i = 1; i < 4; i++) {
this["btn" + i].ivar = i;
this["btn" + i].onPress = mypress;
}
function mypress() {
for (var obj in cliparray) {
cliparray[obj].gotoAndStop(1);
}
myfunction(boo["myarray" + this.ivar]);
}
function move() {
this._x = Math.sin(this.angleX += this.velx) * this.cc + this.startx;
this._y = Math.sin(this.angleY += this.vely) * this.cc + this.starty;
this.count++;
if (this.count >= 80) {
this.onEnterFrame = gettarget;
}
}
function gettarget() {
//I believe this is where the lines stop curving and goes to straight or barely curved line to destination mc.
//would like to keep the random curve/ wave going to the destination mc
this._x += (this.targetx - this._x) / 20;
this._y += Math.sin(this.angle) * (this.targety - this._y) / 20;
this.angle += (360 - this.angle);
if (Math.abs(this.targetx - this._x) < 5) {
this._x = this.targetx;
this._y = this.targety;
delete this.onEnterFrame;
this.a[this.ivar].gotoAndStop(2);
this._parent.onEnterFrame = fade;
}
}
function fade() {
this._alpha -= 5;
if (this._alpha < 0) {
this.removeMovieclip();
}
}
function draw() {
//this.clear()
this.lineStyle(0, 0x97CEF7, 100);
this.lineTo(this.mc._x, this.mc._y);
}

Random Line From External Txt File?
Hi!

I have an external text file which has 1500 lines and I want to load randomly 100 lines into flash. Each line should be on its own text field. Any idea how to begin with this kind of a problem?

-sumo-

Flash Read Random Line From Txt File
I was thinking of making a flash file that read random lines from a text file. What I am trying to do is have each line have the information of a banner, a link and a banner image location, and I want flash to read a random line - then display it. I have tried to find PHP SSI scripts, either they cost a lot of money for the simple thing I want, or they are too complex or are too slow. I just want something that is fast and can simply rotate thru some banners, flash and gif/jpg....

Thank you for your help!

-TJ

Flash Read Random Line From Txt File
I was thinking of making a flash file that read random lines from a text file. What I am trying to do is have each line have the information of a banner, a link and a banner image location, and I want flash to read a random line - then display it. I have tried to find PHP SSI scripts, either they cost a lot of money for the simple thing I want, or they are too complex or are too slow. I just want something that is fast and can simply rotate thru some banners, flash and gif/jpg....

Thank you for your help!

-TJ

I Need To Create A Random Answer Generator With Multiple Line Answers? Any Ideas?
Can anyone help me??? I need to create a random answer generator that when a button is pressed will produce an answer!!! My only problem is the answers will be 5 lines long and I don't know how to do this!!! I can do it with one line but am not sure where to start with 5??? Here is the script that I am using at the mo...

on(release){
ran=math.round(math.random()*10+1);
myTextfield=eval("a"+ran);
}


Cheers!!!

<waving> Hi Everyone...
Just wanted to quickly introduce myself. Big time newbie - my most sincere apologies! lol Just got Studio MX and am loving Flash. Can't wait to learn how to really make it tick! later...

PS What's Swish???

Its Waving
Hello everyone

Does anybody know how to make an animated flag in flash like its blowing in the wind, i dont and would love to

thanks

Waving Flag
Hi all,

Using Swish 2. Trying to insert a gif of the US Flag and have it wave. So far the effects applied to the flag do not work, as it reacts as a "stiff board". Is there some way to convert this gif so it will react in a more pliable manner?

Thanks in advance,

Chris

Waving Flag
anyone know how to make a short little animation of a waving flag? just a second or two long if that.

Waving Banner
Can anyone show me how to create the illusion that something is waving in the wind. It could be like a flag, in my case I have an aircraft pulling a custom banner and I want the banner to have that type of effect. I know there is a way to do it in SWISH or using ANFY, but is there a way to do it just using flash? If there is a way could someone please direct me to a tutorial or step by step directions on how to proceed as right now I have no idea how to achieve this. Thanks in advance.

Waving Flag
I am looking for someone who can help me build a waving flag, something to the exted , of a banner being towed by a small airplane. Thanks ED

Help Waving String
Hi I've got the following actionscript which outputs my
string my_op one character at a time, but I want the string
to move across the screen in a sine wave motion?

any ideas?

my_op = "Hello there FLASH people";

// length of string my_op
my_length = my_op.length;

// Stage height
SH = (Stage.height)/2;
// movefrom
mover = 0;


// do loop
function WriteMe (x) {
i = 0;
space = x;
do {
createTextField("iName"+i,i,space,SH,200,100,20);
_root["iName" + i].text = my_op.charAt(i);
i++;
space = space + 20;
} while (i < my_length)
}


pls hlp

Waving Objects
Not sure if this is a physics question or actionscripting question.

Basically I have, for example, 5 boxes. These boxes are for design only and have no other function.

With these five boxes, I want to create a wave motion. Each lagging behind the next when the mouse rolls over. Further more, when the mouse rolls over the second box, I need the animation to start there and not from the first box. Same with 3 4 and 5.

Sounds simple eh? Welp, Im going to need 30 boxes fill my design and need an easier way to write the code, at the least.


Even moreso, I would like to have (but not necessary) the waves animation dependent of the speed of the mouse when it rolls over. Dependent on speed range from this to this gotoAndPlay this set of frames. This way depending on a slower speed of the rollover or faster speed, the wave waves less or more.

I'm not asking anyone to write the code for me, but if anyones seen some cool tutorials that I can check out that deals with this sort of thing, could you at least point me in the right direction?

THANK YOU VERY MUCH!!!!

Waving Grass
Hi - I'm trying to creat the effect of grass moving in the breeze - just a very subtle effect. I've tried importing the attached image, breaking it apart, and then using the envelope transformation tool, but I'm running into problems. It just doesn't tween right - it seems to keep the image from the last keyframe as well as show the transformed version on the next keyframe.

What is the best way to go about this? Any ideas would be greatly appreciated!

Waving Flag
Hi,

Sorry for the newby question, but how can I make a waving flag?

Thanks

Waving Tentacle?
I've searched and searched and can't find much at all. Any ideas on the following:

I'm wanting to animate a cartoonish squid. The only frame by frame and/or tweening animation I care to do is for the head, face and two tentacles (his gesturing "arms")... for the rest of the tentacles (8) I'd like to have them just waving as if he's treading water. Just a basic (but somewhat smooth) wave looped within each tentacle mc. I don't care if it's tweened, frame by frame or actionscript driven (it's not for video output)... Anyway, I'm having a heck of a time finding any decent examples of a good "waving tentacle" and all my attempts at making it myself have been crap (too stiff, outline getting broken, etc.) Any ideas or examples out there on how to best achieve this?

Thanks in advance!

Waving Flag
I want to wave a flag on the right corner of my flash banner. Can anyone help me by giving me any kind of good tutorials in this regard.
Thanks in advance.

Waving Flag
Anyone know how to make a waving flag using flash? I can't seem to find a tutorial anywhere.

Thanks



Waving Flag
Hello guys!

Do any of you know a link pointing to a tutorial of making a waving flag(animation)...in flash not animated gifs,etc, a vectorial one, so the drawing to be in flash also, photoshop, or any other program like these.


Regards,
Dragos.




Waving Flag
Does any one know of a good "Waving Flag" flash animation?

I've found a way to do it with the help of action script. The final solution is nice, but I'm looking for something more authentic!
The information can be found here:Waving Flag Thred

KD

How Can I Animate A Waving Flag?
Ok, folks I'm in a real hot stop here. The boss wants a waving flag that is modeled after an image file. Does anyone know of a way to get this to work in flash? Any help is appreciated. Thanks!

Waving Flag Effect
Hi there,

I have a logo for a client and I would love to somehow turn it into a flag flying effect.

Im quite new to flash, I understand the basics but not very good at the graphical side of things. Does anyone have any ideas that could help me?

Thanks

JAMES.

A friend is someone who knows the song in your heart, and will sing along when you forget the words.

A Waving Flag Effect?
I am trying to make a waving flag effect any Ideas, or tuts?

Checkered Flag Waving
Hello

Im working on a flash project and need to incorporate a checkered flag waving as when just crossing the finish line. I'm not the best at animating but this is killing me. Im trying to keep the effect of what a flag would look like as it was waved down and just cant seem to get it right. Any ideas out there.

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