Flash stuff

Flash stuff

Re: Flash stuff Posted by matt on Fri Nov 21st 2003 at 5:01pm
matt
1100 posts
Posted 2003-11-21 5:01pm
matt
member
1100 posts 246 snarkmarks Registered: Jun 26th 2002 Occupation: Student! Location: Edinburgh
Hi everyone. First thing, you'll only be able to reply to this topic if you have a good understanding of Actionscript for flash. Its sort of a question. What I'm trying to do is creating "the perfect sine wave" using an algorirthm to recaclulate position for the points on a sine wave. The thing I've got set up at the moment is a couple of dots, one i can move with the right cursor key, which then gives vlaues of y for a duplictaed movie clip. Like this.

onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_x += 10;
x = x + 1
_root.dot.duplicateMovieClip("dot"+x, x);
_root["dot"+x]._x = this._x;
_root["dot"+x]._y = Math.sin(45^x)*50+(200-this._height);
}
}

At the moment all it does it create this sort of being weird set of dots, which is getting quite frustating. Any help anyone can other would be appreachiated. :biggrin:
Re: Flash stuff Posted by Leperous on Fri Nov 21st 2003 at 6:48pm
Leperous
3382 posts
Posted 2003-11-21 6:48pm
Leperous
Creator of SnarkPit!
member
3382 posts 1635 snarkmarks Registered: Aug 21st 2001 Occupation: Lazy student Location: UK
I know nothing about flash coding, but that sin(45^x) term looks really dodgy if x is larger than order 1 or so..! Do you mean sin(45*x) ?