PDA

View Full Version : [Flash 8] New Filters hammer my CPU!


Flash Gordon
08-01-2006, 09:41 PM
This is just too weird. The following code makes my P4 2.66 Ghz processor go to 100% when I roll over the "orb". Now I understand that i don't delete the onEnterFrame while onRollOver. However, leaving 1 onEnterFrame running should not be so devistating as it is.

Are the new filters really so demanding on CPU?


import flash.filters.*;

var gf:GlowFilter = new GlowFilter(0x002BD7, 25, 20, 20, 3, 3, true, false);
var ds:DropShadowFilter = new DropShadowFilter(2, 35, 0x000000, 25, 20, 20, 1, 3, false, false, false);

orb_mc.filters = [gf, ds];

orb_mc.onRollOver = function() {
this.onEnterFrame = function() {
gf.blurX += (100 - gf.blurX)/5;
gf.blurY = gf.blurX;

ds.distance += (5 - ds.distance)/5;

orb_mc.filters = [gf, ds];
}
}

orb_mc.onRollOut = function() {
this.onEnterFrame = function() {
gf.blurX += (20 - gf.blurX)/5;
gf.blurY = gf.blurX;

ds.distance += (2 - ds.distance)/5;

orb_mc.filters = [gf, ds];
if (gf.blurX < 21) delete this.onEnterFrame;

}
}

Frosty_spl
08-01-2006, 09:53 PM
The HD on my powerbook makes a funny noise when my filter is doing its thing.:eek:

Flash Gordon
08-01-2006, 09:59 PM
WOW! Thanks for sharing.

So there is something majorly wrong here. I can't be the first person to experience this.....hmm....

EDIT: I can't find another similar to this. Eirgo, I must be doing something "wrong".

Flash Gordon
08-02-2006, 05:55 PM
Ok....I download the author's sources (lee brimelow (http://www.gotoAndLearn.com)) and even his version make my CPU run rather hot: 97% (because his code is a little different).

Is Lee totally off the mark here or do the Flash 8 filter suck doney pa-dong-e-dong?

goliatone
08-02-2006, 09:07 PM
Is Lee totally off the mark here or do the Flash 8 filter suck doney pa-dong-e-dong?
hehehehe...

dont know mate, the stuff ive done with filters havent give me any trouble... try with a different filter script and see if your pc goes nuts as well.

i will check it out on my pc as well, and see if it burns out or not [hope not]

;)

Flash Gordon
08-03-2006, 06:37 AM
The same result happens on 3 computers with a good bit of resources.

So which is it: Do the Flash 8 filters suck or is the code bad?

Xeef
08-03-2006, 07:35 AM
Hmmmm

on my PC i have 5-18% (absolute Max 22)
whit this code

so you computerS seams to suck :p

haha !
and this is in the IDE as an SWF (started outside)
5-11%

;)

Flash Gordon
08-03-2006, 08:03 AM
That is crazy, Xeef, that you'd get such low numbers. Frosty_spl 'puter maxed out, mine does, and so does Cota's (hopefully he doesn't mind me saying that).

I don't know what the hell is different but with this file, but the max CPU usage I get is 15% and it is even a more intensive script.

URGH.....

import flash.filters.*;

var gf:GlowFilter = new GlowFilter(0x24D2FD, 30, 3, 3, 3, 3, true, false);
var ds:DropShadowFilter = new DropShadowFilter(3, 15, 0x000000, 30, 5, 5, 3, 3, false, false, false);

kText.filters = [gf, ds];

kText.onRollOver = function() {
this.onEnterFrame = function() {
ds.angle += (125 - ds.angle)/5;
gf.blurY = gf.blurX += (6- gf.blurX)/5;

kText.filters = [gf, ds];
};
};
kText.onRollOut = function() {
this.onEnterFrame = function() {
ds.angle += (35 - ds.angle)/5;
gf.blurY = gf.blurX += (5- gf.blurX)/5;
kText.filters = [gf, ds];

};
};

Flash Gordon
08-03-2006, 08:11 AM
It has to do with the size of the object getting the filters....
This is the exact same file, I just increased the "logo" to a wide of 650. Now my 'puter maxes out.

I guess I need to watch the size of the filters....that really sucks.

Xeef
08-03-2006, 08:48 AM
yep you are right

depends on size

Flash Gordon
08-03-2006, 05:06 PM
I just got to bitch here about the filters......

Why do I have to reapply ALL properties to ALL filters if I just want to change 1 value? This seems like a total waste of resources! I just want to change 2 values, but instead I have to reapply all 17.

Urgh.....

Thanks for your help with this everyone.
:)

Xeef
08-03-2006, 05:41 PM
as there are 2 ways to suply parameters :
someConstructor(1,2,3,4,5,6)
or
someConstructor({Param1:1, Param2:2, Param3:3, Param4:4, Param5:5, Param6:6});
basicly you coud set it up for both ways
but this still woud not save any typeing
if you for example not wana change/suply param5
it woud need to by called like :
someConstructor({Param1:1, Param2:2, Param3:3, Param4:4, Param6:6});
someConstructor(1,2,3,4,6) woud not work unless all parameters are of diferent type
and then you woud need a fancy logic to know wich is wich
//
and there is no waste it may by you only wana set one param but the others are also set
they are simply set to a default