On Thu, 10 Feb 2011 21:14:36 +0100
Pablo Rodríguez <[email protected]> wrote:

> On 02/08/2011 11:33 PM, Ricardo Pedroso wrote:
> > 2011/2/8 Pablo Rodríguez<[email protected]>:
> 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 <[email protected]>

Reply via email to