Trying to get this code working
So, I'm trying to make some smoke and I really like the way one looks I found online; however, I guess it was made in a previous version and some of the code is no longer support with the version I'm using with is CS3.
Hopefully this is the right forum for this. If not, please redirect me. Any help getting this thing woring would be much appreciated. The code comes from this site:
http://www.pixelhivedesign.com/tutorials/Realistic+Flash+Smoke+Effect/
He creates a movieclip called aPuff and then gives the movieclip an identifier of aPuff as well. It seems identifiers are no longer used in CS3.
// ------------------------------------------------
// Realistic Smoke Effect - www.pixelhivedesign.com
// ------------------------------------------------
fadeSpeed = 1; // Smoke fade speed.
floatUpSpeed = 2; // Smoke float up speed.
// Every frame attach a puff of smoke.
this.onEnterFrame = function(){
// Get next available depth.
d = this.getNextHighestDepth();
// Attach a puff of smoke.
aPuff = attachMovie('aPuff','aPuff'+d,d);
// Set initial scale to 10%.
aPuff._xscale = aPuff._yscale = 10;
// Put puff where the mouse is. (add small random)
aPuff._x = Math.random() * 5;
// Randomizes the starting animation for realism.
aPuff.gotoAndPlay(Math.round(Math.random()*20));
// Smoke will animate each frame.
aPuff.onEnterFrame = function(){
// Scale smoke up.
this._xscale = this._yscale += fadeSpeed;
// Fade smoke.
this._alpha -= fadeSpeed;
// Smoke floating up.
this._y -= floatUpSpeed;
// When smoke is 100% scale, remove it.
if(this._xscale >= 100){
this.removeMovieClip();
}
}
}
When I run this in CS3 I get a whole list of errors. I’m super new to actionscript.
Thanks again.