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





_______________________________________________
Swftools-common mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/swftools-common

Reply via email to