PDA

View Full Version : eating CPU cycles



meisje
May 28th, 2003, 08:33 AM
fspaiva just posted a thread with a scale script

http://www.kirupaforum.com/forums/showthread.php?threadid=24435

attached to a movie is attached this script :

onClipEvent (load) {
easeScale = function (xscale, yscale) {
_xscale += (xscale-_xscale)/7;
_yscale += (yscale-_yscale)/7;
};
}

when i try this script and watch the CPU monitor of the computer, after hitting one button this movie keeps eating cycles and a lot of it, meaning after the movie has adapted to it's new set scale, so tried if adding an "if" in the script could stop that :

onClipEvent (load) {
easeScale = function (xscale, yscale) {
if (_xscale != xscale) {
_xscale += (xscale-_xscale)/7;
_yscale += (yscale-_yscale)/7;
}
}
}

but that doesn't work, the CPU keeps peaking, so my question is, should i worry about these things? if so what to edit to make that more efficient?

meisje

thoriphes
May 28th, 2003, 11:23 AM
i made that script. i think somewhere along the way i put in a line of code that made it more efficient...download the source i put up, it's in there somewhere. if not, let me know and i'll re-upload it.

meisje
May 28th, 2003, 01:12 PM
hello thor,

i'm afraid i don't know where to look, i searched the forums but nopes..

meisje

thoriphes
May 28th, 2003, 02:09 PM
here's the link:http://www.kirupaforum.com/forums/showthread.php?s=&threadid=24364&highlight=scale+with+easing

meisje
May 29th, 2003, 08:48 AM
hi thor, took me a while before i got it but it works as advertised, no more CPU peaks.

thanks again :) meisje

Meridian
June 14th, 2003, 02:08 PM
thor/meisje

would be so kind as to clue me in on what you did because to me the code looks pretty standard???

I'm sure I'm missing something

I was going to try a countdown to delete the movie myself but if there's something easier or better then I'd like to learn

meisje
June 14th, 2003, 03:00 PM
hi meridian

"I was going to try a countdown to delete the movie myself but if there's something easier or better then I'd like to learn"

i am not sure what you are asking.. deleting a movie? countdown? this doesn't seem to have any realtion to the discussed topic

could you re-phrase please? :) meisje

Meridian
June 14th, 2003, 03:24 PM
Sorry about that :)


I was refering to what I thought was the onEnterframe continuously looping causing the cpu usage running, but on futher investigation it is the drag function for the hover captions and the actual drag of the mc that's causing the high cpu usage.

meisje
June 14th, 2003, 03:26 PM
ok :)

Meridian
June 14th, 2003, 03:27 PM
Anyone got any pointers on making the drag function not cause so much cpu usage?

meisje
June 14th, 2003, 03:36 PM
i haven't seen your code but unless your CPU keeps peaking after the drag action you can't help the CPU from peaking, it's a videocard issue too, draging normal operating systemwindows (meaning outside of flash) is a rather intensive task, so unless the CPU keeps peaking i wouldn't worry about it

Meridian
June 14th, 2003, 03:50 PM
No it's only during the actual drag.

Would setting the alpha = 50 intesify that too?

meisje
June 14th, 2003, 03:58 PM
yes, setting an alpha will intensify usage, prettiness comes with a cpu-pricetag :)

Meridian
June 14th, 2003, 04:04 PM
Heh, ok :) thanks for the input I've been having such a good time learning all this action script stuff from the tutorials and all the great input you guys have been giving me :)

meisje
June 14th, 2003, 04:11 PM
same here :)

later meridian, meisje