A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: buttons and keyboard

  1. #1
    Member
    Join Date
    Feb 2003
    Location
    center of the universe!!
    Posts
    47

    buttons and keyboard

    can i activate buttons with a keyboard? howto if yes? i guess it can be done with actionscript, but i really need expert help on this one...
    And out of the darkness the zombie did call,
    True pain and suffering he brought to them all.
    Away ran the children to hide in their beds,
    For fear that the devil would chop off their heads.

  2. #2
    Flashkit Padawan
    Join Date
    Aug 2001
    Location
    P.V. Mex
    Posts
    78
    you can do it from the button actions pane, the resulting code os stoping the movie on both key press, and pressing the "s" on the keyboard is like this.

    on (release, keyPress "s") {
    stop();
    }


    if you allready have inserted actions to a button it wouldn't be a problem.

    Next time tell us what version of flash you use to provide a solution for that version, i don't know if the menus are different in the other versions of flash but it helps anyway.

    I did it with flash mx

    hope it helps.
    Share the love!

  3. #3
    Member
    Join Date
    Feb 2003
    Location
    center of the universe!!
    Posts
    47
    i'm using mx2004
    thanks, i'll try it, if i don't manage it, i'll let you know..
    And out of the darkness the zombie did call,
    True pain and suffering he brought to them all.
    Away ran the children to hide in their beds,
    For fear that the devil would chop off their heads.

  4. #4
    Member
    Join Date
    Feb 2003
    Location
    center of the universe!!
    Posts
    47
    nah, didn't help.
    i added the script, but i was awarded with absolutely nothing. it works, when i click, but won't respond to keyboard.
    what i did find in scripts, under components for button was something onkeydown, but it looks like this when i add this action:

    instanceName.addEventListener("keyDown", );

    looks too confusing to me...

    why the hell did they change action script in this new version??? they changed absolutely everything, i can't find things, i was so used to the old one, in mx and especially flash 5...
    And out of the darkness the zombie did call,
    True pain and suffering he brought to them all.
    Away ran the children to hide in their beds,
    For fear that the devil would chop off their heads.

  5. #5
    Im back baby!
    Join Date
    Apr 2004
    Location
    Redditch
    Posts
    207
    i agree wiv u there!

    I wasnt exactly a pro but i cud do basically ANYTHING in flash 5.

    I recently came 2 2004MXPro and evrything is just....


    BLARRG

    U cant find anything...

    look on the bright side........ you have got alot further than i have!!!


    jag
    howdy pardner!

  6. #6
    OK....so....I'm a pig... Texas^Trainer's Avatar
    Join Date
    Mar 2004
    Location
    Austin, Texas
    Posts
    140

    try this...

    Not exactly the same scenario...but....

    I have a button that I want to work when I click it or when the user hits the enter key. The button then changes a variable and sends the user to a specific key frame. Here is the code:

    on(release, keyPress "<Enter>"){
    _root.menudisplay = "";
    gotoAndPlay(_root.PageForward);
    }

    Works like a charm. I am using MX 2004 so hopefull this will help you.
    -Tex-

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center