Great Scottish Terriors! How do I draw an octagon in Flash?
Powerful thanks!
D
Great Scottish Terriors! How do I draw an octagon in Flash?
Powerful thanks!
D
What do you mean?
MovieClip.prototype.drawOctagon = function(r, x, y) {
this.lineStyle(1, 0, 100);
this.moveTo(x+r, y);
for (var a = 45; a<=360; a += 45) {
var toX = r*Math.cos(a*Math.PI/180);
var toY = r*Math.sin(a*Math.PI/180);
this.lineTo(toX+x, toY+y);
}
};
this.createEmptyMovieClip("octagon", 0).drawOctagon(80, 100, 100);
like that? =)
Wow, that AS looks smooth! But it’s going to produce a 3-dimensional, right??? I’m just looking to draw a simple “stop sign”.
Thanks for the script though. I’ll put it in my bag of good things.
nope… it will draw a simple 2d octagon.
MovieClip.prototype.stopSign = function(r, x, y) {
this.lineStyle(2, 0, 100);
this.beginFill(0xFFCC00, 100);
this.moveTo(r, 0);
for (this.a = 0; this.a<=360; this.a += 45) {
this.x = r*Math.cos(this.a*Math.PI/180);
this.y = r*Math.sin(this.a*Math.PI/180);
this.lineTo(this.x, this.y);
}
this.endFill();
this.createTextField("myStop", 0, 0, 0, 0, 0);
this.myFormat = new TextFormat("Verdana", 12, 0, 1, 0, 0, 0, 0, "left", 0, 0, 0, 0);
this.myStop.setNewTextFormat(this.myFormat);
this.myStop.text = "Stop";
this.myStop.autoSize = true;
this.myStop._x = -this.myStop._width/2;
this.myStop._y = -this.myStop._height/2;
this._x = x;
this._y = y;
};
this.createEmptyMovieClip("myStopSign", 0).stopSign(40, 100, 100);
i’m bored…
Sweet!
I’m no longer bored. :ub:
Cool, makes this look even better, cause this is what I was thinking:
Hmmm.
I’ll stick to Paint, sorry guys…
(-:
j/k
Thunder …
Hmm, that ain’t lookin’ like no stop sign, bro. :crazy: Nice swimmer suit though. :sure:
D
What are you talking about? I think it does! Sure, it’s not as fancy, or neat, or cool, or…crap. Well, this is what I ment. Trout slap me if you feel the need; I’m okay with that…
(-:
Wow! Nice work. That’s definitely a STOP SIGN.
Nice touch with the word STOP in the middle. (-: Most authentic.
Thanks!
D
Thank You!!! Thank You!!!
Allright, I’ll stop now.
:: Copyright KIRUPA 2024 //--