swftools-common
[Top][All Lists]
Advanced

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

Re: [Swftools-common] OnKeyPress


From: Matthias Kramm
Subject: Re: [Swftools-common] OnKeyPress
Date: Sun, 22 Jan 2006 09:11:50 +0100
User-agent: Mutt/1.5.6i

Hi michelts

On Thu, Jan 12, 2006 at 10:13:25AM -0200, michelts wrote:
> Hi guys,
> 
> I want to catch a key press event inside an action. I try this way:
> 
>     .action:
>         Stop();
>         onKeyDown = function() {
>             PreviousFrame();
>         };
>         onMouseUp = function() {
>             NextFrame();
>         };
>     .end
> 
> I expected any key press will call PreviousFrame() as I'm not testing
> what key was pressed,  but it doesn't work, the onMouseUp works ok...
> How can I catch a key press? 

IIRC, you have to set assign the onKeyDown function of a movie clip,
not just some (global) variable.
E.g.

    .sprite dummyclip
    .end

    .action:
        dummyclip.onKeyDown = function() {
            q = Key.getCode();
            PreviousFrame();
        };
        Key.addListener(dummyclip);
    .end

Greetings

Matthias







reply via email to

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