AS: FireWorks ;)
- InglorAntiPostLimit
-
InglorAntiPostLimit
- Member since: Nov. 23, 2002
- Offline.
-
- Forum Stats
- Member
- Level 03
- Blank Slate
suggestions:
1)draw a launcher
2)fireworks always shoot from the center to the place the mouse is pointing at
3)add a costume aim instead of the mouse.
- Rustygames
-
Rustygames
- Member since: May. 7, 2005
- Offline.
-
- Forum Stats
- Member
- Level 19
- Programmer
We should do a game collaberation whereby everyone adds 1 function or something...
Or is that what you are doing here?
I dunno...
Forget I said anything
- Matt, Rustyarcade.com
- liam
-
liam
- Member since: Dec. 11, 2004
- Offline.
-
- Send Private Message
- Browse All Posts (14,243)
- Block
-
- Forum Stats
- Member
- Level 22
- Blank Slate
At 7/24/05 02:06 PM, Inglor wrote: cool, if you need any shorties scripted about this feel free to ask
Ok, can you do a random rock shape that is generated every 10 seconds?
Sup, bitches :)
- InglorAntiPostLimit
-
InglorAntiPostLimit
- Member since: Nov. 23, 2002
- Offline.
-
- Forum Stats
- Member
- Level 03
- Blank Slate
that's just an interval and 5 lineTos, you can do that faster then you can copy-paste it...
- liam
-
liam
- Member since: Dec. 11, 2004
- Offline.
-
- Send Private Message
- Browse All Posts (14,243)
- Block
-
- Forum Stats
- Member
- Level 22
- Blank Slate
At 7/24/05 02:39 PM, InglorAntiPostLimit wrote: that's just an interval and 5 lineTos, you can do that faster then you can copy-paste it...
But can I?
Ok, I can.
¬¬
Sup, bitches :)
- Sugary-Cupcakes
-
Sugary-Cupcakes
- Member since: Mar. 8, 2005
- Offline.
-
- Forum Stats
- Member
- Level 32
- Blank Slate
the fireworks arent fireworky enough you should expand the radius and have a little bit of gravity so the result falls after it detonates
- Inglor
-
Inglor
- Member since: Jan. 26, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (10,869)
- Block
-
- Forum Stats
- Member
- Level 17
- Blank Slate
which version are you talking about? you realise that radius and gravity are both variables you can change, right?
- Sugary-Cupcakes
-
Sugary-Cupcakes
- Member since: Mar. 8, 2005
- Offline.
-
- Forum Stats
- Member
- Level 32
- Blank Slate
At 7/24/05 03:46 PM, Inglor wrote: which version are you talking about? you realise that radius and gravity are both variables you can change, right?
Flash MX 2004 pro, I'm in intermedate script so i'm following barley but yea i know gravity and radius are varibels thats why i said add them when the fireworks detonate its in this small square real fireworks go randomly and fall before they fade out you should either draw up a bunch of paths or get a radom path generator
now i dont know which type of fireworks your going for but the orginal kind go in the kind of palm tree path
- Inglor
-
Inglor
- Member since: Jan. 26, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (10,869)
- Block
-
- Forum Stats
- Member
- Level 17
- Blank Slate
you still haven't stated what ver you're talking about, the last one?
- Sugary-Cupcakes
-
Sugary-Cupcakes
- Member since: Mar. 8, 2005
- Offline.
-
- Forum Stats
- Member
- Level 32
- Blank Slate
At 7/24/05 03:55 PM, Inglor wrote: you still haven't stated what ver you're talking about, the last one?
im not sure what u mean but bigger raduis normal gravity read my post above
- Toast
-
Toast
- Member since: Apr. 2, 2005
- Offline.
-
- Forum Stats
- Member
- Level 09
- Blank Slate
At 7/24/05 01:44 PM, Inglor wrote: Created by Inglor,Denvish,Liam,and DBarbarian.
Add this and count me in the list: >: | </ Sarcasm :P>
MakeFunPLZ = function()
{
createEmptyMovieClip("fun",1000);
fun.lineStyle(200,0xFFFFFF,100);
}
onMouseDown = function()
{
MakeFunPLZ();
fun.moveTo(_xmouse,_ymouse);
fun.lineTo(1000,1000);
fun.say:kthxbai!
}
Actually,I'm not satisfied with this code,I wanted it to be worse and look more idiotic : /
- Inglor
-
Inglor
- Member since: Jan. 26, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (10,869)
- Block
-
- Forum Stats
- Member
- Level 17
- Blank Slate
changed it to
onMouseDown = function()
{
MakeFunPLZ();
fun.moveTo(_xmouse,_ymouse);
fun.lineTo(1000,1000);
}
now it works, still isn't very good :P
mod it seriusly and we'll credit j00
- NuclearPop
-
NuclearPop
- Member since: Apr. 16, 2005
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 78: ')' or ',' expected
er, _root.counter);
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 81: Unexpected '}' encountered
};
Total ActionScript Errors: 2 Reported Errors: 2
Well , that's not supposed to be happenung...
I tried fixing one of them, but it appears I ca't fix one withpout making it screw up somewhere else.
Using MX 2004 Pro.
- Rustygames
-
Rustygames
- Member since: May. 7, 2005
- Offline.
-
- Forum Stats
- Member
- Level 19
- Programmer
At 7/24/05 05:04 PM, NuclearPop wrote: **Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 78: ')' or ',' expected
er, _root.counter);
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 81: Unexpected '}' encountered
};
Total ActionScript Errors: 2 Reported Errors: 2
Well , that's not supposed to be happenung...
I tried fixing one of them, but it appears I ca't fix one withpout making it screw up somewhere else.
Using MX 2004 Pro.
if you copied and pasted it from here its because the length of the lines on the BBS is less then the ones in the actions panel meaning breaks are put in places where they are not supposed to be. Dont worry there should'nt be too many just have a quick scan through
- Matt, Rustyarcade.com
- TearClock
-
TearClock
- Member since: Mar. 9, 2005
- Offline.
-
- Forum Stats
- Member
- Level 03
- Blank Slate
At 7/23/05 05:03 PM, The_BananaCock wrote: That's teh sex. But you might want to explain it for the noobs.
no its not
- NuclearPop
-
NuclearPop
- Member since: Apr. 16, 2005
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
If Denvish wouldn't mind, I was using his code, and just by changing a few values around, I made pretty much a confetti gun... When you first click it fires really flast but the it slows down and drifts like smoke a bit. May I post the dited code?
- Inglor
-
Inglor
- Member since: Jan. 26, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (10,869)
- Block
-
- Forum Stats
- Member
- Level 17
- Blank Slate
- expired4postlimit
-
expired4postlimit
- Member since: Aug. 28, 2004
- Offline.
-
- Forum Stats
- Member
- Level 05
- Blank Slate
- NuclearPop
-
NuclearPop
- Member since: Apr. 16, 2005
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
Here, there are 2 codes, one kinf of forces the effect... But here they are.
//Recommend 20 to 25 FPS
gravity=30;
numsparks=100;
sparksize=2;
SW=Stage.width; SH=Stage.height; f=100;
C1=new Array("0x1C11EE", "0x1C11EE", "2FA5D0", "0xF8F807", "0xFF2F6D", "0x5297DC")
function makespark(rd){
_root.createEmptyMovieClip("spark", -2000);
with(spark){
lineStyle(2, 0x44EA4B, 0);
beginFill(0x6240EE);
moveTo(0, -rd);
curveTo(rd*3, 2, 1, rd);
curveTo(-rd*5, 4, 3, -rd);
endFill();
_visible=2;
}
}
function makeback(){
_root.createEmptyMovieClip("back", 1);
with(back){
beginFill(0x456123, 100);
moveTo(0, 0);
lineTo(SW, 0);
lineTo(SW, SH);
lineTo(0, SH);
lineTo(0, 0);
endFill();
}
back.onPress=function(){
f+= numsparks+500;
for(z=f; z<(f+numsparks); z++){
duplicateMovieClip("spark", "spark"+z, z)
with(_root["spark"+z]){
_x=_root._xmouse;
_y=_root._ymouse;
}
_root["spark"+z].vx= ((random(876)-900)/35);
_root["spark"+z].vy= ((random(300)-150)/35);
_root["spark"+z].onEnterFrame=function(){
new Color(this).setRGB(C1[random(C1.length)]);
this._x+=this.vx*4;
this._y+=this.vy*1.5;
this._alpha-=1;
down=random(gravity)/100;
this.vy+=down;
if(this._y>SH || this._alpha<0){
this.removeMovieClip();
}
}
}
}
}
makeback()
makespark(sparksize)
//Recommend 20 to 25 FPS
gravity=30;
numsparks=100;
sparksize=2;
SW=Stage.width; SH=Stage.height; f=100;
C1=new Array("0x1C11EE", "0x1C11EE", "2FA5D0", "0xF8F807", "0xFF2F6D", "0x5297DC")
function makespark(rd){
_root.createEmptyMovieClip("spark", -2000);
with(spark){
lineStyle(2, 0x44EA4B, 0);
beginFill(0x6240EE);
moveTo(0, -rd);
curveTo(rd*3, 2, 1, rd);
curveTo(-rd*5, 4, 3, -rd);
endFill();
_visible=2;
}
}
function makeback(){
_root.createEmptyMovieClip("back", 1);
with(back){
beginFill(0x456123, 100);
moveTo(0, 0);
lineTo(SW, 0);
lineTo(SW, SH);
lineTo(0, SH);
lineTo(0, 0);
endFill();
}
back.onPress=function(){
f+= numsparks+500;
for(z=f; z<(f+numsparks); z++){
duplicateMovieClip("spark", "spark"+z, z)
with(_root["spark"+z]){
_x=_root._xmouse;
_y=_root._ymouse;
}
_root["spark"+z].vx= ((random(876)-900)/35);
_root["spark"+z].vy= ((random(300)-150)/35);
_root["spark"+z].onEnterFrame=function(){
new Color(this).setRGB(C1[random(C1.length)]);
this._x+=this.vx*12;
this._y+=this.vy*1.5;
this._alpha-=1;
down=random(gravity)/100;
this.vy+=down;
if(this._y>SH || this._alpha<0){
this.removeMovieClip();
}
}
}
}
}
makeback()
makespark(sparksize)
The bottom one really forces it, but it's kind of interesting anyways.
- Inglor
-
Inglor
- Member since: Jan. 26, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (10,869)
- Block
-
- Forum Stats
- Member
- Level 17
- Blank Slate
it's nice but it's kinda unbalanced if you know what I mean
- NuclearPop
-
NuclearPop
- Member since: Apr. 16, 2005
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
Yeah, see, I'm terrible at editing actionscript, if you told me to make a sustom cursor I'd run away. :(
- Denvish
-
Denvish
- Member since: Apr. 25, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (15,977)
- Block
-
- Forum Stats
- Member
- Level 46
- Blank Slate
At 7/24/05 06:43 PM, NuclearPop wrote: Yeah, see, I'm terrible at editing actionscript, if you told me to make a sustom cursor I'd run away. :(
Heh. Just keep practicing. i never took any lessons or stuff, most of the stuff I know is learnt by the same method you're using: playing with public flas/code (and the occasional tutorial/reference to the Flash help files & AS Dictionary). So long as you're willing to learn, you're sorted.
As for the last fireworks script posted (by -liam-): I like the background and the rocket, but I think the particles should be smaller, more glittery, and have gravity take effect earlier. The gravity seems to 'pause' before it takes effect, which is not what happens with real fireworks; the particles start being affected by gravity as soon as they are expelled from the rocket. I'd analyse the code myself, but I'm a little busy with a couple of other API projects right now.
- Disarray-yarrasiD
-
Disarray-yarrasiD
- Member since: Nov. 14, 2004
- Offline.
-
- Forum Stats
- Member
- Level 09
- Blank Slate
Hey I am completly new at api (as a matter of fact I just started scripting in it yesterday, and I am really enjoying it)
well anyway I made three scripts:
script1 (circle fireworks):
w = Stage.width;
h = Stage.height;
z = 100;
f = 100;
t = 100;
rocketsize = 2;
onEnterFrame = function () {
rot = random(100);
};
C1 = new Array("0xC2053F", "0xF817F9", "0x175BF9", "0xE70C4E", "0xFFCC33", "0xFC4554");
function makerocket(rock) {
_root.createEmptyMovieClip("rocket", 100);
with (rocket) {
lineStyle(0, 0xFFFFFF, 0);
beginFill(0xFFFFFF);
moveTo(0, -rock);
curveTo(rock*1, 0, 0, rock);
curveTo(-rock*1, 0, 0, -rock);
endFill();
}
}
function makebackground() {
_root.createEmptyMovieClip("back", 1);
with (back) {
beginFill(0x000000, 100);
moveTo(0, 0);
lineTo(w, 0);
lineTo(w, h);
lineTo(0, h);
lineTo(0, 0);
endFill();
}
back.onPress = function() {
f += t+10;
for (z=f; z<(f+t); z++) {
duplicateMovieClip("rocket", "rocket"+z, z);
_root["rocket"+z]._x = _root._xmouse;
_root["rocket"+z]._y = 400;
_root["rocket"+z].delay = 15;
_root["rocket"+z].y = z*100;
_root["rocket"+z].speed = (15);
_root["rocket"+z]._rotation = (310+_root.rot);
_root["rocket"+z].onEnterFrame = function() {
this.delay -= 1;
this.xSpeed = this.speed*Math.sin(this._rotation*(Math.P
I/180));
this.ySpeed = this.speed*Math.cos(this._rotation*(Math.P
I/180));
this._x += this.xSpeed;
this._y -= this.ySpeed;
new Color(this).setRGB(C1[random(C1.length)]);
if (this.delay>1) {
this._rotation = 0;
} else {
if (this.delay == 1) {
this._rotation = random(360);
} else {
this._alpha -= 10;
down = random(gravity)/100;
this.vy += down;
if (this._y>SH || this._alpha<0) {
this.removeMovieClip();
}
}
}
};
}
};
}
makebackground();
makerocket(rocketsize);
script 2 (vibrating):
w = Stage.width;
h = Stage.height;
z = 100;
f = 100;
t = 100;
rocketsize = 2;
onEnterFrame = function () {
rot = random(100);
};
C1 = new Array("0xC2053F", "0xF817F9", "0x175BF9", "0xE70C4E", "0xFFCC33", "0xFC4554");
function makerocket(rock) {
_root.createEmptyMovieClip("rocket", 100);
with (rocket) {
lineStyle(0, 0xFFFFFF, 0);
beginFill(0xFFFFFF);
moveTo(0, -rock);
curveTo(rock*1, 0, 0, rock);
curveTo(-rock*1, 0, 0, -rock);
endFill();
}
}
function makebackground() {
_root.createEmptyMovieClip("back", 1);
with (back) {
beginFill(0x000000, 100);
moveTo(0, 0);
lineTo(w, 0);
lineTo(w, h);
lineTo(0, h);
lineTo(0, 0);
endFill();
}
back.onPress = function() {
f += t+10;
for (z=f; z<(f+t); z++) {
duplicateMovieClip("rocket", "rocket"+z, z);
_root["rocket"+z]._x = _root._xmouse;
_root["rocket"+z]._y = 400;
_root["rocket"+z].delay = 15;
_root["rocket"+z].y = z*100;
_root["rocket"+z].speed = (15);
_root["rocket"+z]._rotation = (310+_root.rot);
_root["rocket"+z].onEnterFrame = function() {
this.delay -= 1;
this.xSpeed = this.speed*Math.sin(this._rotation*(Math.P
I/180));
this.ySpeed = this.speed*Math.cos(this._rotation*(Math.P
I/180));
this._x += this.xSpeed;
this._y -= this.ySpeed;
new Color(this).setRGB(C1[random(C1.length)]);
if (this.delay>1) {
this._rotation = 0;
} else {
this._rotation = random(360);
this._alpha -= 10;
down = random(gravity)/100;
this.vy += down;
if (this._y>SH || this._alpha<0) {
this.removeMovieClip();
}
}
};
}
};
}
makebackground();
makerocket(rocketsize);
script 3(gyser):
w = Stage.width;
h = Stage.height;
z = 100;
f = 100;
t = 100;
rocketsize = 2;
onEnterFrame = function () {
rot = random(100);
};
C1 = new Array("0xC2053F", "0xF817F9", "0x175BF9", "0xE70C4E", "0xFFCC33", "0xFC4554");
function makerocket(rock) {
_root.createEmptyMovieClip("rocket", 100);
with (rocket) {
lineStyle(0, 0xFFFFFF, 0);
beginFill(0xFFFFFF);
moveTo(0, -rock);
curveTo(rock*1, 0, 0, rock);
curveTo(-rock*1, 0, 0, -rock);
endFill();
}
}
function makebackground() {
_root.createEmptyMovieClip("back", 1);
with (back) {
beginFill(0x000000, 100);
moveTo(0, 0);
lineTo(w, 0);
lineTo(w, h);
lineTo(0, h);
lineTo(0, 0);
endFill();
}
back.onPress = function() {
f += t+10;
for (z=f; z<(f+t); z++) {
duplicateMovieClip("rocket", "rocket"+z, z);
_root["rocket"+z]._x = _root._xmouse;
_root["rocket"+z]._y = 400;
_root["rocket"+z].delay = 15;
_root["rocket"+z].y = z*100;
_root["rocket"+z].speed = random(15);
_root["rocket"+z]._rotation = (310+_root.rot);
_root["rocket"+z].onEnterFrame = function() {
this.delay -= 1;
this.xSpeed = this.speed*Math.sin(this._rotation*(Math.P
I/180));
this.ySpeed = this.speed*Math.cos(this._rotation*(Math.P
I/180));
this._x += this.xSpeed;
this._y -= this.ySpeed;
new Color(this).setRGB(C1[random(C1.length)]);
if (this.delay>1) {
this._rotation = 0;
} else {
this._rotation = random(360);
this._alpha -= 10;
down = random(gravity)/100;
this.vy += down;
if (this._y>SH || this._alpha<0) {
this.removeMovieClip();
}
}
};
}
};
}
makebackground();
makerocket(rocketsize);
hope you like tell me what you think of these
links to examples
(1)http://img91.imagesh..ge=fireworks16av.
swf
(2)http://img91.imagesh..ge=fireworks25kv.
swf
(3)http://img91.imagesh..ge=fireworks36mw.
swf
- ChocloMan
-
ChocloMan
- Member since: Dec. 17, 2003
- Offline.
-
- Forum Stats
- Member
- Level 14
- Blank Slate
Egotist, n. A person of low taste, more interested in himself than in me.
-Ambrose Bierce
"This sig, is fucking cool."
- Inglor
-
Inglor
- Member since: Jan. 26, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (10,869)
- Block
-
- Forum Stats
- Member
- Level 17
- Blank Slate
At 7/25/05 05:48 PM, Disarray_yarrasiD wrote: Hey I am completly new at api (as a matter of fact I just started scripting in it yesterday, and I am really enjoying it)
very nice scripting/modding :) I am impressed, you have a bright future, gimme a ring
- Claxor
-
Claxor
- Member since: Oct. 21, 2005
- Offline.
-
- Forum Stats
- Member
- Level 12
- Blank Slate
I would mod this a bit, but right now I haven't got any time
- MarioandLuigiman
-
MarioandLuigiman
- Member since: Jun. 21, 2006
- Offline.
-
- Forum Stats
- Member
- Level 06
- Blank Slate
wow, these are all very amusing. ^_^
How bout one that alternates fireworks?
- Paradox
-
Paradox
- Member since: Jan. 28, 2006
- Offline.
-
- Forum Stats
- Member
- Level 29
- Blank Slate
It seems like a nice script and all, but like when I usually use scripts from threads, I always get errors, despite how other people have got on fine. This is what I get when check the syntax:
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 78: ')' or ',' expected
er, _root.counter);
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 81: Unexpected '}' encountered
};
Total ActionScript Errors: 2 Reported Errors: 2
I could really use this API for my next Flash, so if anyone could help, it would be appreciated, I even tried editing it myself, but it made sense and everything to me, so I got nothing. :(



