swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swftools-common] 100% CPU load with slides with synced sound


From: Chris
Subject: Re: [Swftools-common] 100% CPU load with slides with synced sound
Date: Thu, 10 Feb 2011 22:59:06 +0100

On Thu, 10 Feb 2011 21:14:36 +0100
Pablo Rodríguez <address@hidden> wrote:

> On 02/08/2011 11:33 PM, Ricardo Pedroso wrote:
> > 2011/2/8 Pablo Rodríguez<address@hidden>:
> And pressing RIGHT (and holding the key) advances the slides fine, but 
> pressing LEFT (and holding it for 3 secs) seems to leak the CPU, since 
> it takes much longer, it become unresponsive when it doesn't freeze
> display.
> Why going backwards is way slower and requires more CPU than going >forward?

Too many key checks, both UP and DOWN, maybe??

Thought one:
===========

Rather than this way..

        key_listen.onKeyDown = function() {
            switch (Key.getCode()) {
                case Key.SPACE:
                break;
                case Key.LEFT:
                break;

you could try this,

        keyListener = new Object();
        Key.addListener(keyListener);
        
        keyListener.onKeyDown = function() {
        var kc = Key.getCode();
        switch (kc) {
           case {your keycode as integer}:
           break;
           // some code
           case {your keycode as integer}:
           // some code
           break;
           //  etc, etc.
                                        };      
That was the way I did it for the pdf viewer part of that scrappy media
player. It also allowed me to use 'toggle' keys as well, which, amongst
other things might solve your going to full screen issue.

Thought two:
===========

Had you considered embedding your sound file as an swf rather than an
mp3?


Regards,


Chris.
-- 
Chris <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]