I am relatively inexperienced with Flash. I know just enough to get myself into trouble as you will see here…
I am creating a website with the bulk of the material in flash. All was going well until the client asked for a twinkling effect on the static textured background (created in PS). I was able to find a file on the web and apply that code to a flash file to create this effect. I layered this in Dreamweaver in div layer 1, the main web content (combo of html & flash) on div layer 2.
The problem is that it slows down all my animation in the main content. Plus I previewed it on a MAC and the quick flash intro I created crawls at agonizingly slow speed!!!
Does anyone know a better, “lighter” way to do what I need to do? here is the link to my site , in progress…
http://bokx109.com/working/intro.htm
This is the AS2 code in frame 1 on “blink1000.swf” (in div layer1):
var numStars:Number = 250;
for (i=1; i<=numStars; i++) {
_root.attachMovie(“star”, “star”+i, i, {_x:Math.random()*Stage.width, _y:Math.random()*Stage.height, _alpha:Math.random()*100});
_root[“star”+i].rotSpeed = Math.round(Math.random()*8+2);
_root[“star”+i].tranSpeed = Math.round(Math.random()*10+5);
_root[“star”+i].tranDir = Math.floor(Math.random()*2);
trace(_root[“star”+i].rotSpeed);
_root[“star”+i].onEnterFrame = function() {
if (this.tranDir == 0) {
this._alpha += this.tranSpeed;
if (this._alpha>100) {
this.tranDir = 1;
}
} else {
this._alpha -= this.tranSpeed;
if (this._alpha<40) {
this.tranDir = 0;
}
}
this._rotation += this.rotSpeed;
};
}
I know I’m missing something. Any guidance from you more learned folks would be very much appreciated!