# Would anyone know how to make a fire effect?

**URL:** https://forum.kirupa.com/t/would-anyone-know-how-to-make-a-fire-effect/7599
**Category:** Uncategorized
**Created:** [November 4, 2002, 5:37am UTC](https://forum.kirupa.com/t/would-anyone-know-how-to-make-a-fire-effect/7599 "2002-11-04T05:37:10Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![slayerment](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@slayerment](https://forum.kirupa.com/u/slayerment)
#### Post date: [November 4, 2002, 5:37am UTC](https://forum.kirupa.com/t/would-anyone-know-how-to-make-a-fire-effect/7599/1 "2002-11-04T05:37:10Z")

</div>

I was trying to make a sun with flames but am not sure how to approach this. thanks

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 4, 2002, 6:46am UTC](https://forum.kirupa.com/t/would-anyone-know-how-to-make-a-fire-effect/7599/2 "2002-11-04T06:46:12Z")

</div>

Well, here is something I did for a contest but never submitted it :-\ I’ve messed up a bit too much with the code, so it doesn’t look like fire anymore, but maybe it can help you… Just put that in the first frame of your movie:

```auto
/ ************************
Function declarations
************************ /
function oscillate(){
	this.posx=100*this.i+this.radius*Math.sin(puls*dtr*(this.a+=.8)+this.z*dtr*80*Math.sin(this.rand+=this.z/10));
	this.posz=50*this.z+this.flames*Math.sin(puls*dtr*(this.b+=.06)+this.z*dtr*20)*Math.random();
	this.setPerspective();
}

MovieClip.prototype.setPerspective=function(){
	this.scale=200/(this.posz+200);
	this._x=(center.x-origin.x+this.posx)*this.scale+origin.x;
	this._y=(center.y-origin.y+this.posy)*this.scale+origin.y;
}
/ ************************
Variables and elements
************************ /
origin={x:250,y:400};
center={x:250,y:50};
cols=5;
rows=3;
prof=5;
puls=15;
dtr=Math.PI/180;
mc=_root.createEmptyMovieClip("rond",-1);

k=0;
for (var j=0; j < cols;j++){
	for(var i=0;i < rows;i++){
		for (var z=0;z < prof;z++){
			myMc=rond.duplicateMovieClip("rond"+k,k++);
			myMc.i=i;
			myMc.j=j;
			myMc.z=z;
			myMc.radius=(5-z)*10;
			myMc.flames=(5-z)*5;
			myMc.posy=50*this.j;
			myMc.onEnterFrame=oscillate;
		}
	}
}

this.onEnterFrame=function(){
	index=1;
	this.clear();
	this.lineStyle(2,0xFF0000,100);
	this.moveTo(this["rond"+index]._x,this["rond"+index]._y);
	for (var n=0;n < k-1;n++){
		if (!(index%5)||index==1){
			this.moveTo(this["rond"+index]._x,this["rond"+index]._y);
			this.beginFill(0xFF6600,100);
		}
		index++;
		this.lineTo(this["rond"+index]._x,this["rond"+index]._y);
	}
	this.endFill();
}

```

pom :cowboy:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 4, 2002, 7:12am UTC](https://forum.kirupa.com/t/would-anyone-know-how-to-make-a-fire-effect/7599/3 "2002-11-04T07:12:37Z")

</div>

And there’s also that one: [http://www.station4net.com/flashfx/047-25-lines.html](http://www.station4net.com/flashfx/047-25-lines.html)

```auto
// Dmitry Yamaykin aka DeliMIter 
// for 25-lines Contest brings this thing. 
// "Locked Space" 
// 14 lines total 

Mouse.hide(); 

createEmptyMovieClip("BG", -17000).beginFill(0x00, 100); 
for (var i=0; i<4; i++) BG.lineTo(i < 2? Stage.width: 0, (i == 0)or(i == 3)? 0: Stage.height); 

onEnterFrame = onMouseMove = function() { 
(Clip = createEmptyMovieClip("C" + (++_depth < 1000? _depth: _depth = 0), _depth))._x = _xmouse + random(10) - 12; 
Clip._y = _ymouse + random(10) - 2; 
Clip.beginFill(random(0x100) << 8 | 0xFF0000, 100); 
for (var i=0; i<4; i++) Clip.curveTo((i == 0)or(i == 3)? 0: 10, (i < 2)? 5: -5, (i == 3)? 0: (i == 1)? 10: 5, (i == 0)? 5: (i == 2)? -5: 0); 
Clip._dir = random(30) - 15 - 90; 
Clip._xscale = Clip._yscale = 150 + random(50); 
Clip.onEnterFrame = function() { 
  this._x += 3 * Math.cos(this._angle = (this._dir += random(7) - 3) * Math.PI/180); 
  this._y += 3 * Math.sin(this._angle); 
  if ((this._alpha = (this._xscale = this._yscale *= 0.95) / 4) < 10) this.removeMovieClip(); 
} 
} 

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 4, 2002, 7:16am UTC](https://forum.kirupa.com/t/would-anyone-know-how-to-make-a-fire-effect/7599/4 "2002-11-04T07:16:40Z")

</div>

HEY, NO OBFUSCATED CODE HERE MAN!!!

LOL, Delimiter is one excellent coder though. I checked out his stuff at the bit forums… jaw dropping :o

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 4, 2002, 7:19am UTC](https://forum.kirupa.com/t/would-anyone-know-how-to-make-a-fire-effect/7599/5 "2002-11-04T07:19:56Z")

</div>

Well, this one is pretty easy on the obfuscation… 😛

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 4, 2002, 7:20am UTC](https://forum.kirupa.com/t/would-anyone-know-how-to-make-a-fire-effect/7599/6 "2002-11-04T07:20:46Z")

</div>

Yeah, with the exception of the lineTo and curveTo, but that isn’t too hard to understand.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 4, 2002, 3:09pm UTC](https://forum.kirupa.com/t/would-anyone-know-how-to-make-a-fire-effect/7599/7 "2002-11-04T15:09:02Z")

</div>

Hey thanks alot. i think i can make something with this 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 4, 2002, 3:19pm UTC](https://forum.kirupa.com/t/would-anyone-know-how-to-make-a-fire-effect/7599/8 "2002-11-04T15:19:13Z")

</div>

Please show us when you’re done 😏

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 4, 2002, 9:21pm UTC](https://forum.kirupa.com/t/would-anyone-know-how-to-make-a-fire-effect/7599/9 "2002-11-04T21:21:07Z")

</div>

bit forum…?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 4, 2002, 9:35pm UTC](https://forum.kirupa.com/t/would-anyone-know-how-to-make-a-fire-effect/7599/10 "2002-11-04T21:35:45Z")

</div>

The forum at [www.bit-101.com](http://www.bit-101.com)
