How to make a keyboard navigating multiple choice list in Flash and control it through actionscript?

i am making an rpg style game in actionscript 3.0 and i want to make a multiple choice list. I know how to make the list with buttons and how to control it. My question is, how do you make a list that can be navigated using the keyborad arrows? What i am after is being able to hit up, and down to highlight the buttons and enter to chose the button.

You'll need to make the buttons as movieclips so that you can control which display state they are in (highlighted versus not).
Then you need to set up a listener for the keyboard keys so that you can have the selected button change and the execute if the Enter is pressed.  Here is a basic setup for a keyboard listener that shows how to detect the three keys you mentioned...
stage.addEventListener(KeyboardEvent.KEY_DOWN,keyIsDown);
function keyIsDown(e:KeyboardEvent):void  {
         if (e.keyCode == Keyboard.DOWN) {
                 trace("DOWN");
         } else if (e.keyCode == Keyboard.UP) {
                 trace("UP");
         } else if (e.keyCode == Keyboard.ENTER) {
                 trace("ENTER");

Similar Messages

  • How To Make an Array from Multiple Choices of a Drop-Down Menu?

    I have a drop-down menu (or a scrollable list). Visitors can make multiple selection from the list. How do I put those selected items into an array?

    See JList.getSelectedValues()

  • How can I get keyboard navigation to work on quizzes?

    I am using 6.0.1.240.  After testing on my machine I sent the file to our customer who published it for SME review on a url.
    Keyboard navigation on the quiz questions works great on my local machine but using the link the keyboard navigation tabs to the first response and then skips to the submit button on all single respnse questions.  It navigates properly on all multiple response answers.  Any help would be sincerely appreciated

    Hi there,
    If you have an MCQ with only one correct answer then you will get radio buttons on the Question slide for all the Choices.
    While tabbing when you get to the first answer choice, use the Down arrow key on your keyboard to go to the other answer Choices.
    It is the property of the radio buttons that they are defined in one container.
    Thanks.

  • How to make the KM Navigation iview role based

    Hi all,
    Can someone tell me how to make the KM navigation iview role based?
    First of all, is this possible? What I am trying to achive is display certain links for a user group and certain other links for another user group.
    Please guide me.
    Ashwini.

    Hi Ashwini,
    Can someone tell me how to make the KM navigation iview role based?
    >>>>>>>>>>>>>><i>You can have a Navig. iView in your own folder..Attach this iView to a page --> page to workset --> workset to a role. SIMPLE!</i>
    <b><u>Try this:</u></b>
    Have 2 iViews, 2 pages, 2 worksets, 2 usergroups (ug1 & ug2 (<i>say</i>))..
    Also, you have to separate your news links in 2 folders (folder1 & folder2):
         <b>iView1</b> --> links from <i>folder1</i> (for user of <b>ug1</b>)
         <b>iView2</b> --> links from <i>folder2</i> (for user of <b>ug2</b>)
    Hope it helps!
    Regards,
    SK.

  • How to make read only field in Task list?

    Hi All,
    How to make read only field in Task list?

    This can be done one of two ways:
    1. Customize the form in Infopath, right click your field and disable the control.
    2. Use JavaScript/jQuery on the page to disable the element.
    Andy Wessendorf SharePoint Developer II | Rackspace [email protected]

  • I don´t know how to make a phone call whit my ipad...and how to sent a message? is it possible?

    i don´t know how to make a phone call whit my ipad...and how to senSeleneGMt a message? What do i need? or is it impossible?

    You can't; not natively, anyway, since the iPad is not a phone. If you want to make a call, you'll need to use some third-party Voice-Over-IP service such as Skype.
    I'm not sure what you're asking when you ask about sending a message. If you mean a text message, you can either use iMessage, which can send messages to other users also running iMessage, or you can look in the iTunes Store for SMS apps, a few of which are available. They use separate services to actually send the message and so require an Internet connection, either WiFi or 3G.
    Regards.

  • My iphone 4s has ceased to make the keyboard click sounds. I reset it and made sure that the keyboard click sound is selected in the Settings menu but still no click sound. Can anyone help?

    My iphone 4s has ceased to make the keyboard click sounds. I reset it and made sure that the keyboard click sound is selected in the Settings menu but still no click sound. Can anyone help?

    In Settings - Sounds - Silent - Vibrate, I tried toggling back and forth from "on" to "off", but still no keyboard click.

  • How do I move imovie 11 events to an external drive and then access through imovie?

    How do I move imovie 11 events to an external drive and then access through imovie?  When I copied to the external, it came through as clips and doesn't play using imovie...is there a way to do this?  I have several imovie events and have no disk space left s trying to move them to free up space tp upload new photos and movies.  Thanks.

    joanne987 wrote:
    So, then what do I do if I have files on the external and won't fit back onto my HD?  How do I format it for imovie?  any suggestions?
    buy another HDD ... 500Gigs are ctually around 70-90€, saw yesterday a 1.5TB WD for 140€ ...
    .... 9TB of harddrives in use here ... don't forget to have at last one backup/copy per drive

  • How do I show my keynote file on a dvd player and control the slides?

    how do I show my keynote file on a dvd player and control the slides with the skip or next chapter command on the dvd remote? when I export to quicktime, it changes slides on a timed basis. I want the chapter button on a dvd remote to act like a mouse click would.

    Hi Robert
    You have to export the individual slides from your Keynote presentation, and then import them into your DVD application.
    I use DVDStudioPro - it works fine this. I'm sure iDVD will be OK.Going via QT has never worked for me.
    Regards Robert
    G4(7 y.o)1.5GHz 1.25 GB Ram, 2x120GB intHD, orig AGP & Radeon 9200 PCI card   Mac OS X (10.4.8)   2monitors, CRT TV, FCP5.0.4, DVDSP4.1.1, STP1.1, Comp2.3, LT2.1, QT7.1.3

  • How to make top level navigation not refresh

    Hello Guys,
    I have a question concerning on my External Facing Portal, my boss wants that when I click on a tab or a link in the Top Level Navigation , to load the content in the Content Area without refreshing the whole page, What I want is that when I click on a tab or link of the Top Level Navigation , the Top Level Navigation and the MasterHead not to refresh and that the content be loaded and refreshed only in the Content Area. The only way I know to do this is by making a frameset of my page and to make the masterhead and toplevel navigation a frame and the detalied navigation a frame and the content area a frame, and in the links to put the target property to the name of the content area frame, but I don't know if this is possible to do in the portal, I see that all is embedded and I don't know how to make a frameset like this in the portal.
    Any highlights to solve this will sure be appreciated.
    Thanks
    Rewarding points will be given.
    Luis

    Hi,
       When you are implementing External Facing Portal, i think you have used Light Framework Page.  In Light Framework Page, only one Framework has been used, so when you click on the top level navigation, the whole page will get refresh, so there is no otherway as of my knowledge.  If you use standard framework page in portal, it is possible to do (i.e. the content area only get refresh)  and the concept of your External Facing Portal is eliminated here.
    Regards,
    Venkatesh. K
    /* Points are Welcome */

  • How do I make groups for texting multiple people at a time and retain that group for future use?

    How do I make goups, in Contacts, for texting multiple people at a time and retain that group for future use?

    How do I make goups, in Contacts, for texting multiple people at a time and retain that group for future use?

  • How to change the design of multiple-choice checkboxes

    Hello,
    i want to change the look of multiple-choice quizzes. Instead of the typical checkbox with checkmark i would like to place a button that changes its color - for example blue for right (activated) and white for wrong (not selected).
    I think it should be possible, but I don't know where I can change the look of checkboxes. I Tried it with a hotspot-quiz, but that is not exactly what I'm searching for.
    The best solution for me would be a kind of button with mouse-over effect as known from websites (HTML).
    Can you please tell me what I have to edit?
    Thank you very much.
    Boris

    Hello and thank you for posting this information. I'm still seeing a number of problems with implementing a workable solution.
    For HTML5 only (not Flash), I have changed the image: HTML/assets/htmlimages/checkBox_selected.png to a blue button (118x53 pixels instead of the default 22x22pixels), and as expected the button will still be the same size until I change the code description of the checkbox. I found the CSS description of the checkbox button in: HTML/assets/css/CPQuiz.css and have made the changes to the width and height (see below), and even though the following changes are generated in the output files, they don't have any effect on the button. However, I found that if I changed the 'Project.js' file where it defines the width and height of the checkboxes that this would actually change the values, but this is always re-written over and generated each time you click 'Publish'.
    So, I then found some hard-coding in the file: HTML/assets/js/CPLibrary.js (just search for 22px and you'll see that the checkbox description width and height are not being read from the CSS file) and this appears to be where the actual code is coming from that gets generated for output when you click on 'Publish'.
    This is not an optimal solution, I feel that I'm beginning to hack around the default code for Adobe Captivate more than I should be expected to do. Is this really what others are doing to make what should be pretty simple and easy changes?
    Additionally, I noticed that when I click on my checkbox, the 'checkBox_selected.png' will be drawn, but if I click on it again the 'checkBox_disabled.png' appears to be drawn on top of the previous 'checkBox_selected.png' which is not the behavior I would expect. I want to be able to see what is underneath the button if I click on it again in order to un-check the box and instead it draws the 'checkBox_disabled.png' on top, covering up the default text I need to see!
    Below are my changes to CPQuiz.css (which were copied to the 'Published' file, but had no visible effect)
    input[type=checkbox]:checked
        background: url('../htmlimages/checkBox_selected.png') no-repeat center center;
        -webkit-appearance: none;
        border: none;
        -webkit-background-size: 118px 53px;
    .spanCheckBoxInput
        position: fixed;
        display: block;
        width:118px;
        height:53px;

  • How to Make a Keyboard Layout for X11/OpenOffice

    While OpenOffice has a setting to use standard OS X keyboard layouts, you may find that some of these do not work correctly, especially if deadkeys are involved. In that case you will need to create a new layout in the form of a keymap file, which you place in your home folder and invoke when needed via the command "xmodmap mykeymap" in an xterm (or by putting the same line in some config file).
    You keymap file should just contain the minimum necessary modifications of the default X11 map, which you can see by doing the command "xmodmap -pke | less" in an xterm (after making sure the preference item for using OS X layouts is turned off).
    Some fiddling with the entries of your file may be necessary, as both X11 and apps that use it have quirks and bugs of various sorts. Below is the file I made to do Vietnamese in OpenOffice as an example:
    keycode 26 = abreve
    keycode 27 = 0x00E2
    keycode 28 = 0x00EA
    keycode 29 = 0x00F4
    keycode 30 = dead_hook
    keycode 31 = dead_grave
    keycode 33 = dead_belowdot
    keycode 34 = dead_tilde
    keycode 36 = dead_acute
    keycode 37 = U0111
    keycode 38 = U01A1
    keycode 41 = U01B0

    This is a feature Apple should definitely add customization to on OS X.
    You can make custom keyboard layouts that include any characters you want using Ukelele.
    http://scripts.sil.org/cms/scripts/page.php?siteid=nrsi&itemid=ukelele
    I doubt Apple is going to incorporate this into OS X, but you can suggest it here:
    http://www.apple.com/feedback/macosx.html

  • How to make menus for navigation?

    I am coming from the Articulate world to Captivate. For those
    not familiar with Articulate, when you publish a Powerpoint file,
    it automatically creates a menu on the left with all the slide
    topics that you can skip to when clicking.
    How do I do this in Captivate? I see it is not automatic. I
    suppose the bigger question is, what is the best way to create a
    template that has functional buttons that allow me to skip to
    different modules and different slides within a module as well as
    the typical forward/back/exit buttons.
    All of the resources I see on Captivate focus on more linear
    presentations or simulations on how to fill out a form. I am trying
    to create e-learning that is not necessarily linear and allows the
    user to skip around to get the info they need.
    I am not expecting anyone to do the work for me, but I am a
    little frustrated on where to start with a solid resource on
    guiding me how to create the right navigation tools.
    Thanks.

    Hello DmltnMn
    Be welcome the community
    You would like being raised links for the created slies it
    will be able to create menu in his project lincando for each
    presentation, a good practice.
    To that be enough to go in Project> Skin> Menu and
    activate the Option Show Menu oh it is enough to create his menus
    indicating each slide.
    I wait what is this his doubt, and what it could have helped
    :)

  • How to make a keyboard shortcut for this character: ⌘

    I am growing very fond of the Character Palette, but there are some characters I like to use allot, and it's becoming a nuisance opening the whole window just to insert a ⌘. I was thinking maybe there is a way to make a keyboard shortcut for this character, just like option-shift-K creates . I opened the keyboard viewer and was thinking maybe I could drag the character into an empty space to create a combo...but it's not letting me. Is there any way to do this?

    This is a feature Apple should definitely add customization to on OS X.
    You can make custom keyboard layouts that include any characters you want using Ukelele.
    http://scripts.sil.org/cms/scripts/page.php?siteid=nrsi&itemid=ukelele
    I doubt Apple is going to incorporate this into OS X, but you can suggest it here:
    http://www.apple.com/feedback/macosx.html

Maybe you are looking for