I was wondering if there was a way to make movements confined to a certain order. I saw a DNA effect, and it was quite awesome. If anyone can post the code I’d be more than appreciative.
I would like to see the example…can you post a link??
No, I forgot where I saw it.
Let me find it really quick.
This guy copied his code directly from a DNA tutorial, unfortunately, I can no longer find it.
Its at the top buttons, you’ll see it.
Are you talking about denacioust’s footer ?
[swf=“http://denacioust.sphosting.com/Dnamaker.swf height=60 width=300”][/swf]
Here’s some code Master64 posted in this thread that recreates it:
MovieClip.prototype.drawCircle = function(x, y) {
this.moveTo(Math.cos(0)*5+x, Math.sin(0)*5+y);
this.lineStyle(0, 0x000000, 0);
this.beginFill(0x000000, 100);
for (var radians = 0; radians<Math.PI*2; radians += Math.PI/180) {
this.lineTo(Math.cos(radians)*5+x, Math.sin(radians)*5+y);
}
this.endFill();
};
MovieClip.prototype.makeThing = function(num) {
this.drawCircle(-25, 0);
this.lineStyle(3, 0x000000, 100);
this.moveTo(-25, 0);
this.lineTo(25, 0);
this.drawCircle(25, 0);
this._x = 10*num;
this._y = 100;
this._rotation = 20*num;
this._xscale = this._yscale=10*num;
this._alpha = 10+(90/_root.count)*num;
this.num = num;
this.onEnterFrame = function() {
this._rotation += (_root._xmouse-300)/50;
var red = 127*(1+Math.sin(this.num/10+(this.red += incr_red)));
var green = 127*(1+Math.sin(this.num/10+(this.green += incr_green)));
var blue = 127*(1+Math.sin(this.num/10+(this.blue += incr_blue)));
var colRand = red << 16 | green << 8 | blue;
var c = new Color(this);
c.setRGB(colRand);
};
};
incr_red = Math.random()/10;
incr_green = Math.random()/10;
incr_blue = Math.random()/10;
_root.createTextField("input_txt", 0, 290, 80, 20, 20);
input_txt.type = "input";
input_txt.border = true;
input_txt.maxChars = 2;
input_txt.restrict = "0-9";
_root.createEmptyMovieClip("button_mc", 1);
button_mc._x = 290;
button_mc._y = 100;
button_mc.createTextField("text_txt", 0, -45, 0, 100, 20);
button_mc.text_txt.text = "Go: A numder 5-50";
button_mc.text_txt.selectable = false;
button_mc.onPress = function() {
if (Number(input_txt.text)>=5 && Number(input_txt.text)<=50) {
_root.count = Number(input_txt.text);
for (var j = 1; j<_root.count+1; j++) {
_root.createEmptyMovieClip("thing"+j, j);
_root["thing"+j].makeThing(j);
}
_root.createEmptyMovieClip("background_mc", 0);
var red = Math.round(Math.random()*255);
var green = Math.round(Math.random()*255);
var blue = Math.round(Math.random()*255);
var colRand = red << 16 | green << 8 | blue;
background_mc.beginFill(colRand, 100);
background_mc.lineTo(Stage.width, 0);
background_mc.lineTo(Stage.width, Stage.height);
background_mc.lineTo(0, Stage.height);
background_mc.endFill();
}
};