Flash Help
- Started
- Last post
- 4 Responses
- PonyBoy
the 'unsteady flash light' effect I'm using here is really ineffecient - it's killing my processor...
The 'mask' is actually just a huge square w/a radial gradient of 100% black to 0%black (alpha channels)... maybe that's bad? Is there a better way to create this effect?
... I'm just trying to create a simple little random function that moves the lighting effect effeciently...
here's what I'm using as far as code goes - anyone else have any other random code snippets that would create this effect more effeciently?
animateVar = setInterval(animate,100);
function animate() {
ranx = _root._xmouse+(Math.random()*20...
rany = _root._ymouse+(Math.random()*10...
spotlight_mc._x += (ranx-spotlight_mc._x)/accelerat...
spotlight_mc._y += (rany-spotlight_mc._y)/accelerat...
};I thought by using that old standard easing equation - but placing it in a function called by setInterval would make it run more effeciently - apparently not.
I'm not the best w/math related effects and keeping them effecient (as you can tell)...
.. any help would rock.. .thanks!
- rson0
Seems to be running fine on my machine
- davi-t0
Runs fine here but it prolly does run slow on older cpu's.
- Use a PNG instead of a vector gradient.
- If you're using Flash 8, use the Bitmap Caching feature since, you're only moving the X and Y and not scaling it or transforming it in any way.
- Personnaly I can't tell there's easing on that grad really..I'd get rid of it.
- Def get rid of the interval, use an event handler instead ie. onMouseMove(). If you want to keep the easing, just call that function without the interval on mousemove.That should do the trick.
Davi-t
- CyBrainX0
Very nice work so far. It played fine on my G5 though.
Nice choice of music too.
- lvl_130
runs fine here. osx 10.3 g5