00:00
00:00
Newgrounds Background Image Theme

slugjuicedotcom just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

As: Api

21,395 Views | 162 Replies
New Topic Respond to this Topic

Response to As: Api 2005-10-18 16:29:17


At 10/18/05 03:36 PM, Begoner wrote: Here's a quick decimal to hex function I made. It may not be efficient, but it works:

Thanks Begoner (and -liam-, for the info). I'm pretty sure I'll be using that at some point in the future.


- - Flash - Music - Images - -

BBS Signature

Response to As: Api 2005-10-19 14:12:41


if anyone could reply to this post, I'd appreciate it. A lot. Well, I am just testing my AS skills (which are really bad) doing an API game, but, for some reason my character wont move whenever I press the keys. Not even gravity will work. This is my code:

_root.createEmptyMovieClip("Base3", 15);
with (Base3) {
lineStyle(2, 0x07C73C, 100);
beginFill(0x07C73C, 100);
moveTo(300, 250);
lineTo(300, 400);
lineTo(400, 400);
lineTo(400, 250);
lineTo(300, 250);
endFill();
}

Response to As: Api 2005-10-19 14:13:53


sorry for the double post, but for some reason the whole cody wasnt copied.

_root.createEmptyMovieClip("hero", 200);
with ("hero") {
lineStyle(2, 0x000000, 100);
beginFill(0xDC341D, 50);
moveTo(0, 0);
lineTo(20, 0);
curveTo(11, -27, 0, 0);
lineTo(0, 0);
endFill();
}
_root.createEmptyMovieClip("floor1", 10);
with ("floor1") {
lineStyle(2, 0xFFFFFF, 100);
beginFill(0xDC341D, 50);
moveTo(250, 250);
lineTo(0, 250);
moveTo(400, 250);
lineTo(300, 250);
moveTo(450, 250);
lineTo(600, 250);
moveTo(300, 300);
lineTo(250, 300);
endFill();
}
_root.createEmptyMovieClip("floor2", 11);
with ("floor2") {
lineStyle(2, 0xFFFFFF, 100);
beginFill(0xDc641D, 50);
moveTo(300, 300);
lineTo(300, 250);
moveTo(450, 250);
lineTo(450, 400);
endFill();
}
_root.createEmptyMovieClip("floor3", 12);
with ("floor3") {
lineStyle(2, 0xFFFFFF, 100);
beginFill(0xDc641D, 50);
moveTo(250, 300);
lineTo(250, 250);
moveTo(400, 400);
lineTo(400, 250);
endFill();
}
_root.createEmptyMovieClip("Base", 13);
with (Base) {
lineStyle(2, 0x07C73C, 100);
beginFill(0x07C73C, 100);
moveTo(0, 250);
lineTo(250, 250);
lineTo(250, 400);
lineTo(250, 400);
lineTo(0, 400);
endFill();
}
_root.createEmptyMovieClip("Base2", 14);
with (Base2) {
lineStyle(2, 0x07C73C, 100);
beginFill(0x07C73C, 100);
moveTo(300, 300);
lineTo(250, 300);
lineTo(250, 400);
lineTo(300, 400);
lineTo(300, 300);
endFill();
}
_root.createEmptyMovieClip("Base3", 15);
with (Base3) {
lineStyle(2, 0x07C73C, 100);
beginFill(0x07C73C, 100);
moveTo(300, 250);
lineTo(300, 400);
lineTo(400, 400);
lineTo(400, 250);
lineTo(300, 250);
endFill();
}
_root.createEmptyMovieClip("Base4", 16);
with (Base4) {
lineStyle(2, 0x07C73C, 100);
beginFill(0x07C73C, 100);
moveTo(600, 250);
lineTo(600, 400);
lineTo(450, 400);
lineTo(450, 250);
lineTo(600, 250);
endFill();
}
if (hero.hitTest("floor1")) {
} else {
hero._y += 3;
}
//adding gravity
if (Key.isDown(Key.LEFT)) {
if (hero.hitTest("floor2")) {
} else {
hero._x -= 5;
}
}
if (Key.isDown(Key.RIGHT)) {
if (hero.hitTest("floor3")) {
} else {
hero._x += 5;
}
}
if (Key.isDown(Key.UP)) {
char1._y -= 5;
}

Response to As: Api 2005-10-19 14:17:04


function moveChar(){
Key.isDown(Key.RIGHT)?_x+=5:0;
Key.isDown(Key.LEFT)?_x-=5:0;
Key.isDown(Key.UP)?_y-=5:0;
Key.isDown(Key.DOWN)?_y+=5:0;
}
Base3.onEnterFrame = moveChar;

Should work, and I know this isn't API but there isn't a BitmapData thread yet.. so, BitmapData API code:

import flash.display.BitmapData;
var bmp:BitmapData = new BitmapData(550, 400);
_root.attachBitmap(bmp, 1);
curX=_xmouse, curY=_ymouse;
pos = 0;
onMouseDown = function () {
if (pos == 0) {
curX=_xmouse, curY=_ymouse;
pos = 1;
} else if (pos == 1) {
myX = Array();
myY = Array();
x1 = (_xmouse-curX)/1000;
y1 = (_ymouse-curY)/1000;
x2 = curX;
y2 = curY;
for (a=1; a<1001; a++) {
x2 += (x1);
y2 += (y1);
myX.push(x2);
myY.push(y2);
}
for (a=1; a<1001; a++) {
bmp.setPixel(myX[a-1], myY[a-1], 0);
}
pos = 0;
}
};

Click twice, first to set the start point and second for the end point.


Sup, bitches :)

BBS Signature

Response to As: Api 2005-10-19 14:21:45


hmm. Thanks liam, what is it that i should change in the code? the "moveChar" thing or something else?

Response to As: Api 2005-10-19 14:23:27


At 10/19/05 02:21 PM, Darkfire_Blaze wrote: hmm. Thanks liam, what is it that i should change in the code? the "moveChar" thing or something else?

The Base3 thing, change it to the instance of your character.


Sup, bitches :)

BBS Signature

Response to As: Api 2005-10-19 14:27:55


the instance name of my character is "hero" so the code should be this:

function moveChar(){
Key.isDown(Key.RIGHT)?_x+=5:0;
Key.isDown(Key.LEFT)?_x-=5:0;
Key.isDown(Key.UP)?_y-=5:0;
Key.isDown(Key.DOWN)?_y+=5:0;
}
hero.onEnterFrame = moveChar;

shouldnt it? tell me if i did something wrong. But if it is that way, What it moves is the main stage... not the character. It moves the whole thing i have on stage. But the character.

Response to As: Api 2005-10-19 14:29:30


function moveChar(){
Key.isDown(Key.RIGHT)?hero._x+=5:0;
Key.isDown(Key.LEFT)?hero._x-=5:0;
Key.isDown(Key.UP)?hero._y-=5:0;
Key.isDown(Key.DOWN)?hero._y+=5:0;
}
hero.onEnterFrame = moveChar;

Bleh, that should work.


Sup, bitches :)

BBS Signature

Response to As: Api 2005-10-19 14:42:46


thanks liam. That code works great.

Response to As: Api 2005-10-20 03:58:49


At 10/18/05 11:30 AM, -liam- wrote: Considering we have Denvishes API generator/tracer, it's really shit. I was just clicking

press enter after you have finished drawing and it gives you the api code for the picture
you just drew

Response to As: Api 2005-10-20 10:46:58


At 10/20/05 03:58 AM, shazwoogle wrote: press enter after you have finished drawing and it gives you the api code for the picture
you just drew

I know, it's still shit compared to Denvishes API generator.


Sup, bitches :)

BBS Signature

Response to As: Api 2005-10-22 00:52:33


At 10/20/05 10:46 AM, -liam- wrote: I know, it's still shit compared to Denvishes API generator.

has denvish made a similar program to mine??
or rather i have made a similar program to denvish?

Response to As: Api 2005-10-29 10:09:40


Ok, ive made a line called 'line', obviously;

So how do I remove it?

on (rollOver) {
_root.removeMovieClip("line", 10);
swapDepths(999);
}

ive added that to a button.

onMouseDown=function(){
_root.createEmptyMovieClip("line", 10);
with(line){
/// bla bla/
}
}
And thats my code. Anything wrong with the button code? Why isnt it being deleted?


"Actually, the server timed out trying to remove all your posts..."

-TomFulp

Response to As: Api 2005-10-29 10:12:10


At 10/29/05 10:09 AM, IWantSomeCookies wrote: Ok, ive made a line called 'line', obviously;

So how do I remove it?

_root.line.removeMovieClip();

or

_root.removeMovieClip("line");


- - Flash - Music - Images - -

BBS Signature

Response to As: Api 2005-10-29 10:13:32


Try either:

on (rollOver) {
swapDepths(999);
_root.removeMovieClip("line", 10);
}

or:

on (rollOver) {
swapDepths(999);
_root.removeMovieClip(line, 10);
}

or:

on (rollOver) {
swapDepths(999);
_root.removeMovieClip("line");
}

or:

on (rollOver) {
swapDepths(999);
_root.removeMovieClip(line);
}

or:

on (rollOver) {
swapDepths(999);
_root.removeMovieClip(_root.line);
}

or:

on (rollOver) {
swapDepths(999);
removeMovieClip("line", 10);
}

or:

on (rollOver) {
swapDepths(999);
removeMovieClip("line");
}

or:

on (rollOver) {
swapDepths(999);
removeMovieClip(_root.lineline);
}

or:

on (rollOver) {
swapDepths(999);
_root.lineremoveMovieClip();
}


BBS Signature

Response to As: Api 2005-10-29 10:53:01


Denvish = winner.

Toast = thanks, but Denvish's (_root.line.removeMovieClip();) worked. Thankyou!

Lol ive made a little API 3D maker thing. I think it rocks. :)


"Actually, the server timed out trying to remove all your posts..."

-TomFulp

Response to As: Api 2005-10-29 10:59:11


At 10/29/05 10:53 AM, IWantSomeCookies wrote: Lol ive made a little API 3D maker thing. I think it rocks. :)

Can I see? XD


Sup, bitches :)

BBS Signature

Response to As: Api 2005-10-29 11:01:25


At 10/29/05 10:53 AM, IWantSomeCookies wrote: Denvish = winner.

Toast = thanks, but Denvish's (_root.line.removeMovieClip();) worked. Thankyou!

Meh, some of mine worked aswell, maybe one :P But yeah, I guess typing _root.line.removeMovieClip() is way easier than trying all the options I gave you :D

Lol ive made a little API 3D maker thing. I think it rocks. :)

Can I see?


BBS Signature

Response to As: Api 2005-10-29 11:05:40


by the by whilst this is still relevant:

I keep getting silly people thinking API i just the dynamic drawing part of flash. It isnt. API stands for Application Program Interface. The best definition google came up with is:
-- A set of routines provided in libraries that extends a language's functionality.

Which means its not just drawing.

Thought I'd clear that up. This thread should be called AS:Drawing API


- Matt, Rustyarcade.com

Response to As: Api 2005-10-29 11:10:00


At 10/29/05 11:05 AM, Ninja-Chicken wrote: This thread should be called AS:Drawing API

I know, but I didn't when I started this thread.

Also we need a Bitmap API thread.. I'd do it but I'm not sure if I can be arsed :) If I do then I'm not going to explain all the Rectangle and Point and Transformation stuff.


Sup, bitches :)

BBS Signature

Response to As: Api 2005-10-29 11:11:31


I havnt learnt any of the new flash 8 gizmos so I hope someone makes a thread soon about them. And be very extensive

First person to make a decent thread about all that bitMap crap gets a cookie


- Matt, Rustyarcade.com

Response to As: Api 2005-10-29 11:17:37


At 10/29/05 10:59 AM, -liam- wrote:
At 10/29/05 10:53 AM, IWantSomeCookies wrote: Lol ive made a little API 3D maker thing. I think it rocks. :)
Can I see? XD

Yeah, but its only like a triangle maker, im just working out how to move it around. :) Lol.

Im trying to assign the space bar to remove it (if (Key.isDown(Key.SPACE)){_root.line.removeM
ovieClip(); }
) but it doesnt seem to be working.

When thats fixed, ill show you the un-completed. Its NOTHING special, just my first ever API thing. :)


"Actually, the server timed out trying to remove all your posts..."

-TomFulp

Response to As: Api 2005-10-29 12:12:59


WHEEEEEEEEEE

Simple API % preloader with PLAY button. Gonna do one with graphics at some point, when I get round to it.

Bung this on first frame, WHAT HO!!!

stop();
SW = Stage.width;
SH = Stage.height;
cTF = new TextFormat();
with (cTF) {
color = 0xFFCC00;
font = "Tahoma";
size = 20;
bold = 1;
align = "center";
}
createEmptyMovieClip("it", 1);
with (it) {
createTextField("pl", 1, 0, SH/2, SW, SH/2);
pl.selectable = 0;
beginFill(0, 0);
lineTo(SW, 0);
lineTo(SW, SH);
lineTo(0, SH);
endFill();
}
_root.onEnterFrame = function() {
if (_currentframe == 1) {
var bytes = _root.getBytesTotal();
var bytes_loaded = _root.getBytesLoaded();
percent = int((bytes_loaded/bytes)*100);
it.pl.text = percent+"%";
it.pl.setTextFormat(cTF);
if (bytes_loaded == bytes) {
it.pl.text = "PLAY";
it.pl.setTextFormat(cTF);
it.onPress = function() {
_root.play();
this.removeMovieClip();
};
}
}
};


- - Flash - Music - Images - -

BBS Signature

Response to As: Api 2005-10-29 12:49:41


At 10/29/05 12:12 PM, Denvish wrote: WHEEEEEEEEEE

Nice, useful.. have you added it to your preloaders page? Or are you waiting until you add graphics? An API NG tank.. haha :)


Sup, bitches :)

BBS Signature

Response to As: Api 2005-10-29 13:01:37


At 10/29/05 12:49 PM, -liam- wrote:
At 10/29/05 12:12 PM, Denvish wrote: WHEEEEEEEEEE
Nice, useful.. have you added it to your preloaders page? Or are you waiting until you add graphics? An API NG tank.. haha :)

Already done it, a while ago. Had to convert it to arrays to fit the post char limit, though

Stage.scaleMode = "showAll";
SW = Stage.width;
SH = Stage.height;
Arr1 = new Array(0, 0x00FF00, 0, 0xFFF07D, 100, -190, 158, 0, -190, -190, 0, 190, -190, 0, 190, 173, 0, -190, 158);
Arr2 = new Array(0, 0x00FF00, 0, 0xFFB30F, 100, -190, 148, 0, -190, -6, 0, -115, 119, 0, -87, 119, 0, -190, -143, 0, -190, -190, 0, -122, -190, 0, -39, 122, 0, -19, 122, 0, -50, -190, 0, 49, -190, 0, 10, 120, 0, 35, 122, 0, 125, -190, 0, 190, -190, 0, 190, -143, 0, 75, 122, 0, 110, 124, 0, 190, -14, 0, 190, 146, 0, -190, 148);
Arr3 = new Array(2, 0, 100, 0, 100, -190, 190, 0, -190, 81, 0, -174, 70, 0, -173, 90, 0, -166, 87, 1, -169, 72, -161, 67, 0, -164, 57, 0, -106, 0, 1, -115, -55, -108, -52, 0, -80, -66, 1, -91, -76, -72, -100, 1, -59, -103, -72, -114, 1, -57, -151, -36, -120, 1, -28, -113, -39, -107, 1, -48, -101, -34, -99, 1, -31, -100, -21, -81, 1, 43, -90, 50, -72, 0, 108, -102, 1, 105, -111, 121, -116, 0, 148, -131, 1, 171, -124, 167, -99, 0, 129, -79, 1, 121, -81, 112, -76, 0, 64, -48, 1, 70, -47, 71, -30, 1, 76, -36, 79, -17, 1, 136, -35, 148, 19, 0, 137, 28, 1, 139, 42, 132, 65, 0, 152, 60, 1, 150, 72, 163, 77, 0, 163, 91, 1, 170, 98, 173, 76, 0, 190, 83, 0, 190, 190, 0, -190, 190);
Arr4 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, -136, 102, 1, -164, 87, -150, 63, 0, -76, -3, 1, -57, -9, -40, 11, 0, -60, 16, 1, -68, -7, -132, 54, 1, -108, 61, -119, 87, 1, -125, 46, -145, 64, 1, -154, 90, -132, 100, 0, -136, 102);
Arr5 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, -114, 52, 0, -85, 30, 0, -85, 40, 0, -108, 59, 0, -114, 52);
Arr6 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, -97, 61, 0, -92, 56, 0, -86, 61, 0, -95, 66, 0, -97, 61);
Arr7 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, -113, 108, 1, -115, 87, -98, 102, 1, -99, 74, -81, 94, 1, -84, 64, -64, 79, 1, -85, 115, -113, 108);
Arr8 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, -59, 73, 1, -87, 50, -70, 19, 0, -62, 20, 1, -79, 50, -55, 67, 0, -59, 73);
Arr9 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, -29, 15, 1, -24, 64, -75, 106, 1, -50, 108, -32, 106, 1, 13, 61, 9, 12, 0, -29, 15);
Arr10 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, -19, 6, 1, -24, -20, -42, -25, 1, 2, -38, 11, 3, 0, -19, 6);
Arr11 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, 70, -8, 1, 86, 1, 86, 24, 0, 14, 28, 0, 14, 10, 1, 23, 10, 18, -1, 0, 14, -8, 0, 70, -8);
Arr12 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, 99, -15, 1, 116, -3, 116, 20, 0, 137, 15, 1, 135, -13, 99, -15);
Arr13 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, 60, 110, 1, 107, 85, 104, 29, 0, 127, 26, 1, 129, 82, 95, 109, 0, 60, 110);
Arr14 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, 7, -23, 0, 10, -16, 0, 69, -16, 0, 68, -24, 0, 7, -23);
Arr15 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, -101, -34, 1, -50, -67, -57, -37, 1, -53, -21, -48, -39, 1, -46, -77, -79, -56, 0, -102, -42, 1, -112, -36, -101, -34);
Arr16 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, -42, -33, 1, -40, -61, -53, -70, 1, 44, -85, 45, -67, 0, 35, -63, 0, 29, -69, 0, -24, -65, 1, -13, -51, -17, -33, 0, -42, -33);
Arr17 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, -12, -58, 0, 31, -62, 1, 3, -45, 21, -31, 0, 2, -30, 0, -8, -33, 0, -12, -58);
Arr18 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, 21, -47, 0, 109, -97, 0, 112, -89, 0, 23, -40, 1, 16, -42, 21, -47);
Arr19 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, 118, -106, 0, 148, -122, 1, 158, -122, 159, -102, 0, 127, -86, 1, 112, -91, 118, -106);
Arr20 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, -58, -74, 1, -71, -84, -61, -96, 0, -55, -95, 1, -61, -87, -58, -74);
Arr21 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, -62, -119, 1, -52, -126, -42, -120, 1, -39, -110, -52, -115, 1, -64, -108, -62, -119);
Arr22 = new Array(1, 0xFFFFFF, 100, 0xFFFFFF, 100, -57, -105, 1, -52, -112, -44, -107, 1, -51, -97, -57, -105);
Arr23 = new Array(1, 0, 100, 0, 100, 125, -105, 0, 146, -116, 1, 156, -112, 152, -102, 0, 149, -103, 1, 146, -113, 135, -103, 1, 127, -101, 131, -95, 1, 121, -101, 125, -105);
Arr24 = new Array(5, 0, 100, 0, 100, -4, 30, 0, 9, 29, 0, -4, 30);
Arr25 = new Array(5, 0, 100, 0, 100, -5, 46, 0, 5, 46, 0, -5, 46);
Arr26 = new Array(5, 0, 100, 0, 100, -14, 66, 0, -2, 66, 0, -14, 66);
Arr27 = new Array(5, 0, 100, 0, 100, -21, 83, 0, -10, 83, 0, -21, 83);
Arr28 = new Array(5, 0, 100, 0, 100, 133, 38, 0, 122, 39, 0, 133, 38);
Arr29 = new Array(5, 0, 100, 0, 100, 119, 57, 0, 130, 57, 0, 119, 57);
Arr30 = new Array(5, 0, 100, 0, 100, 112, 75, 0, 124, 74, 0, 112, 75);
Arr31 = new Array(5, 0, 100, 0, 100, 103, 91, 0, 114, 91, 0, 103, 91);
Arr32 = new Array(5, 0, 100, 0, 100, 22, 19, 0, 22, 18);
Arr33 = new Array(5, 0, 100, 0, 100, 38, 17, 0, 39, 17, 0, 38, 17);
Arr34 = new Array(5, 0, 100, 0, 100, 56, 17, 0, 56, 16, 0, 56, 17);
Arr35 = new Array(5, 0, 100, 0, 100, 72, 16, 0, 73, 16, 0, 72, 16);
Arr36 = new Array(5, 0, 100, 0, 100, -34, -38, 0, -32, -38, 0, -34, -38);
Arr37 = new Array(5, 0, 100, 0, 100, -36.25, -52.65, 0, -34.25, -52.65, 0, -36.25, -52.65);
Arr38 = new Array(5, 0, 100, 0, 100, -39.2, -65.3, 0, -38.2, -64.3, 0, -39.2, -65.3);

_root.createEmptyMovieClip ("tank", 7000);
for (i=1; i<39; i++) {
drw(_root["Arr"+i], _root.tank);
}

_root.tank._x = SW/2;
_root.tank._y = SH/2;
_root.tank._width = _root.tank._height=200;
function drw(a, mc) {
with (mc) {
lineStyle(a[0], a[1], a[2]);
beginFill(a[3], a[4]);
moveTo(a[5], a[6]);
m = 7;
while (m<a.length) {
if (a[m] == 0) {
lineTo(a[m+1], a[m+2]);
m += 3;
} else {
curveTo(a[m+1], a[m+2], a[m+3], a[m+4]);
m += 5;
}
}
endFill();
}
}


- - Flash - Music - Images - -

BBS Signature

Response to As: Api 2005-10-29 13:03:22


Wow, i never thought of using arrays like that.


I'm back! on a temporary basis. No-one can remember who I am! but I don't really mind.

Response to As: Api 2005-10-29 13:22:06


At 10/29/05 01:01 PM, Denvish wrote: Already done it, a while ago. Had to convert it to arrays to fit the post char limit, though

Nice, it looks exactly like the NG tank but converted to vectors and optimized =P


Sup, bitches :)

BBS Signature

Response to As: Api 2005-11-13 07:25:42


Is it anyway to make the api box a button.
For example:
I got this simple API code:
_root.createEmptyMovieClip("b",1);
with(b){
lineStyle(1,0x000000,100);
moveTo(10,10);
lineTo(100,10);
lineTo(100,30);
lineTo(10,30);
lineTo(10,10);
}

Can I make this a button instead of a MC?


BBS Signature

Response to As: Api 2005-11-13 07:34:42


At 11/13/05 07:25 AM, guywithhiscomp wrote: Is it anyway to make the api box a button.
For example:
I got this simple API code:
_root.createEmptyMovieClip("b",1);
with(b){
lineStyle(1,0x000000,100);
moveTo(10,10);
lineTo(100,10);
lineTo(100,30);
lineTo(10,30);
lineTo(10,10);
}
Can I make this a button instead of a MC?

You can have like
b.onPress = function(){
//do stuff
}


BBS Signature

Response to As: Api 2006-01-10 22:06:25


Sorry, if I was bumping the thread, but there's a way to do it in gradients too. The power of API is incredible as Denvish has shown with the NG tank and such. Here's a little gradient code for you.. API is kind of simple once you get the basic idea and a graphics designer edu cannot harm anyone, because a knowledge of colormaps and rgb's is a good value on this.

basic gradient code:

//The colors of the mc. I decided to use three shapes of green for this.
var aColors:Array = [0x669900, 0x66FF00, 0x669900];

// the Alphas as the value of visuality on the screen 0-100.
var aAlphas:Array = [50, 70, 50];

// Each three ratios for the colors 0-255.
var aRatios:Array = [40, 127.5, 255];

// basic matrix:box, x and y scale of position the gradient relative to the center of the clip
weight, height, radian level of the rotation.
var oMatrix:Object = {matrixType:"box", x: 10, y: 400, w: 100, h: 100, r:0};

// create the empty "virtual" movie clip.
this.createEmptyMovieClip("mcShape", this.getNextHighestDepth());

// Create the style for the outer line( thickness, color, alpha)
// There are plenty of other options for lineStyle including:pixelhinting, noscale,capsstyle etc..
mcShape.lineStyle(0, 0xFF0000, 100);

// Build a linear shape and then fetch the three wanted colors, Alphas for 'em and ratios and // the basic box matrix.
// It can be linear or radial
mcShape.beginGradientFill("linear", aColors, aAlphas, aRatios, oMatrix);

// a big box shape with three shades of green.
mcShape.lineTo(300, 0);
mcShape.lineTo(300, 300);
mcShape.lineTo(0, 300);
mcShape.lineTo(0, 0);

// end the fill
mcShape.endFill();

The code without explanation:
--------------------
var aColors:Array = [0x669900, 0x66FF00, 0x669900];
//var aAlphas:Array = [50, 70, 50];
var aRatios:Array = [40, 127.5, 255];
var oMatrix:Object = {matrixType:"box", x: 10, y: 400, w: 100, h: 100, r:0};
this.createEmptyMovieClip("mcShape", this.getNextHighestDepth());
mcShape.lineStyle(0, 0xFF0000, 100);
mcShape.beginGradientFill("linear", aColors, aAlphas, aRatios, oMatrix);
mcShape.lineTo(300, 0);
mcShape.lineTo(300, 300);
mcShape.lineTo(0, 300);
mcShape.lineTo(0, 0);
mcShape.endFill();
----------------------------

Here's an another shape and this time it has a radial fill on it.
---------------------------
var aColors:Array = [0x999999, 0xCCCCCC, 0x999999];
var aAlphas:Array = [70, 100, 70];
var aRatios:Array = [60, 101.5, 255];
var oMatrix:Object = {matrixType:"box", x: 100, y: 100, w: 400, h: 200, r:0};
this.createEmptyMovieClip("mcShape", this.getNextHighestDepth());
mcShape.lineStyle(0, 0xAAAAAA, 100);
mcShape.beginGradientFill("radial", aColors, aAlphas, aRatios, oMatrix);
mcShape.lineTo(100,200);
mcShape.lineTo(400, 200);
mcShape.lineTo(100, 400);
mcShape.lineTo(0, 400);
mcShape.endFill();


Internet is in danger |[]| Proof of the plans to destroy the internet.

BBS Signature