# Eating CPU cycles

**URL:** <https://forum.kirupa.com/t/eating-cpu-cycles/21954>\
**Category:** Uncategorized\
**Created:** [May 28, 2003, 12:33pm UTC](https://forum.kirupa.com/t/eating-cpu-cycles/21954 "2003-05-28T12:33:10Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![meisje](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@meisje](https://forum.kirupa.com/u/meisje)\
**Post date:** [May 28, 2003, 12:33pm UTC](https://forum.kirupa.com/t/eating-cpu-cycles/21954/1 "2003-05-28T12:33:10Z")

</div>

fspaiva just posted a thread with a scale script

[http://www.kirupaforum.com/forums/showthread.php?threadid=24435](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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 28, 2003, 3:23pm UTC](https://forum.kirupa.com/t/eating-cpu-cycles/21954/2 "2003-05-28T15:23:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 28, 2003, 5:12pm UTC](https://forum.kirupa.com/t/eating-cpu-cycles/21954/3 "2003-05-28T17:12:06Z")

</div>

hello thor,

i’m afraid i don’t know where to look, i searched the forums but nopes…

meisje

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 28, 2003, 6:09pm UTC](https://forum.kirupa.com/t/eating-cpu-cycles/21954/4 "2003-05-28T18:09:17Z")

</div>

here’s the link:[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=24364&highlight=scale+with+easing](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=24364&highlight=scale+with+easing)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 29, 2003, 12:48pm UTC](https://forum.kirupa.com/t/eating-cpu-cycles/21954/5 "2003-05-29T12:48:04Z")

</div>

hi thor, took me a while before i got it but it works as advertised, no more CPU peaks.

thanks again 🙂 meisje

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 14, 2003, 6:08pm UTC](https://forum.kirupa.com/t/eating-cpu-cycles/21954/6 "2003-06-14T18:08:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 14, 2003, 7:00pm UTC](https://forum.kirupa.com/t/eating-cpu-cycles/21954/7 "2003-06-14T19:00:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 14, 2003, 7:24pm UTC](https://forum.kirupa.com/t/eating-cpu-cycles/21954/8 "2003-06-14T19:24:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 14, 2003, 7:26pm UTC](https://forum.kirupa.com/t/eating-cpu-cycles/21954/9 "2003-06-14T19:26:52Z")

</div>

ok 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 14, 2003, 7:27pm UTC](https://forum.kirupa.com/t/eating-cpu-cycles/21954/10 "2003-06-14T19:27:48Z")

</div>

Anyone got any pointers on making the drag function not cause so much cpu usage?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 14, 2003, 7:36pm UTC](https://forum.kirupa.com/t/eating-cpu-cycles/21954/11 "2003-06-14T19:36:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 14, 2003, 7:50pm UTC](https://forum.kirupa.com/t/eating-cpu-cycles/21954/12 "2003-06-14T19:50:04Z")

</div>

No it’s only during the actual drag.

Would setting the alpha = 50 intesify that too?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 14, 2003, 7:58pm UTC](https://forum.kirupa.com/t/eating-cpu-cycles/21954/13 "2003-06-14T19:58:33Z")

</div>

yes, setting an alpha will intensify usage, prettiness comes with a cpu-pricetag 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 14, 2003, 8:04pm UTC](https://forum.kirupa.com/t/eating-cpu-cycles/21954/14 "2003-06-14T20:04:57Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 14, 2003, 8:11pm UTC](https://forum.kirupa.com/t/eating-cpu-cycles/21954/15 "2003-06-14T20:11:46Z")

</div>

same here 🙂

later meridian, meisje
