Buttons navigation

I'm just getting started using Flash Builder and need some help. Is there a way for me to make a button that will send a user to a different screen randomly. I'm a teacher and trying to create a math app for my students, where after there answer a question correctly, it sends them to the next question at random. Here is the code I have thus far, but it will only send them to the next question. Thanks for any help!
<s:Button x="324" y="273" label="Next Question"
              click="navigator.pushView(question2)" styleName="back" />

Turn the click handler into a full on separate function. Then store all the views in an array and use Math.rand() to randomly choose one.
Something like this:
<fx:Script>
     <![CDATA[
          var questionsArray:Array = {question2,question3,question5,questionRed,questionGeography};
          function buttonClickHandler(event:MouseEvent){
               var randomProblem:int = Math.floor(Math.random()*(questionsArray.length));     //generates a random integer between 0 and the total number of questions in the array (arrays are 0-based)
               navigator.pushView(questionsArray[randomProblem]);
     ]]>
</fx:Script>
<s:Button id="randomProblemButton" label="Next Problem" click="buttonClickHandler(event)" />
Haven't tested that, but something along that line should work

Similar Messages

  • New ARB Issue:  Button navigation and Declarative States

    <[email protected]il.forums.adobe.com>
    Message-ID: <C6277898.7F37%[email protected]>
    Thread-Topic: New ARB Issue:  Button navigation and Declarative States
    Thread-Index: AcnOqlv/oTWkTNjMukqDP18VFO76uA==
    Mime-version: 1.0
    Content-type: multipart/alternative;
         boundary="B_3324475544_8859892"
    This message is in MIME format. Since your mail reader does not understand
    this format, some or all of this message may not be legible.
    --B_3324475544_8859892
    Content-type: text/plain;
         charset="US-ASCII"
    Content-transfer-encoding: 7bit
    A new ARB issue has been posted to the flex open source site:
    http://opensource.adobe.com/wiki/display/flexsdk/buttonnavigationand+decla
    rative+states
    This issue concerns the new state syntax and what it means to leave a value
    of a property implicit in one or more states.
    Comments, suggestions, and feedback are welcome.
    --B_3324475544_8859892
    Content-type: text/html;
         charset="US-ASCII"
    Content-transfer-encoding: quoted-printable
    <HTML>
    <HEAD>
    <TITLE>New ARB Issue:  Button navigation and Declarative States</TITLE=
    >
    </HEAD>
    <BODY>
    <FONT FACE=3D"Calibri, Verdana, Helvetica, Arial"><SPAN STYLE=3D'font-size:11pt=
    '><BR>
    <BR>
    <BR>
    A new ARB issue has been posted to the flex open source site:<BR>
    <BR>
    <a href=3D"http://opensource.adobe.com/wiki/display/flexsdk/button+navigation=
    anddeclarative+states">http://opensource.adobe.com/wiki/display/flexsdk/bu=
    ttonnavigationanddeclarativestates
    This issue concerns the new state syntax and what it means to leave a value= of a property implicit in one or more states.
    Comments, suggestions, and feedback are welcome.
    B_3324475544_8859892

    Ned Murphy wrote:
    Select the textfield that is inside the movieclip and in the properties panel you should see a dropdown for selecting the type of textfield.  If you select Dynamic and then assign an instance name to the textfield you can use that instance name in your code to assign the text when the file runs.  If you were to name the textfield "tField", then the code you would use inside an instance of your movieclip named "mClip1" would be...
    mClip1.tField.text = "your text";
    So, if I have multiple buttons, using your example, would the code read
    mClip1.tField.text = "your text";
    mClip1.tField2.text = "your text2";
    mClip1.tField3.text = "your text3";
    mClip1.tField4.text = "your text4";
    And my buttons are built inside movieclips, ie
    Main Timeline > aboutButton_mc > aboutText_mc > "about"
                        > contactsButton_mc > contactsText_mc > "contacts"
    can the code be put at any level, or does it need to reside on the Main Timeline to access all the movie clips' text fields?
    Just in case this may be too complex to get into via this forum, if you know of any good tutorials, that would be awesome too!
    I tried doing a search, but it's so hard to tell if they might be in AS2, or AS3, and if they would apply to newer versions of Adobe Flash (I have CS5)

  • ARB Issue Committed:  Button navigation and Declarative States

    <[email protected]il.forums.adobe.com>
    Message-ID: <C62B9EEA.82F3%[email protected]>
    Thread-Topic: ARB Issue Committed:  Button navigation and Declarative States
    Thread-Index: AcnOqlv/oTWkTNjMukqDP18VFO76uACeTE1U
    In-Reply-To: <C6277898.7F37%[email protected]>
    Mime-version: 1.0
    Content-type: multipart/alternative;
         boundary="B_3324878165_1545235"
    This message is in MIME format. Since your mail reader does not understand
    this format, some or all of this message may not be legible.
    --B_3324878165_1545235
    Content-type: text/plain;
         charset="US-ASCII"
    Content-transfer-encoding: 7bit
    the  ARB issue at:
    http://opensource.adobe.com/wiki/display/flexsdk/buttonnavigationand+declara
    tive+states
    has been updated with a decision (in short, keep the status quo).
    Ely.
    --B_3324878165_1545235
    Content-type: text/html;
         charset="US-ASCII"
    Content-transfer-encoding: quoted-printable
    <HTML>
    <HEAD>
    <TITLE>ARB Issue Committed:  Button navigation and Declarative States<=
    /TITLE>
    </HEAD>
    <BODY>
    <FONT FACE=3D"Calibri, Verdana, Helvetica, Arial"><SPAN STYLE=3D'font-size:11pt=
    '><BR>
    <BR>
    <BR>
    </SPAN></FONT><BLOCKQUOTE><FONT FACE=3D"Calibri, Verdana, Helvetica, Arial"><=
    SPAN STYLE=3D'font-size:11pt'>the  ARB issue at:<BR>
    <BR>
    <a href=3D"http://opensource.adobe.com/wiki/display/flexsdk/button+navigation=
    anddeclarative+states">http://opensource.adobe.com/wiki/display/flexsdk/bu=
    ttonnavigationanddeclarativestates
    has been updated with a decision (in short, keep the status quo).
    Ely.
    B_3324878165_1545235

    graf_ix_guru wrote:
    >
    > Hey everyone I am new, and really could use some help.
    > I have created button symbols in Fireworks with Pop-Up
    Menus. As of right now
    > I have 4 states. The up, over, down and over while down.
    Everything is working
    > great except when the user clicks on the navigation
    button they get taken to
    > the top of the page.
    On click should open a new page, yes? So it won't matter.
    Linda Rathgeber [PVII] **Adobe Community Expert-Fireworks**
    http://www.projectseven.com
    Fireworks Newsgroup:
    news://forums.projectseven.com/fireworks/
    CSS Newsgroup: news://forums.projectseven.com/css/
    Design Aid Kits:
    http://www.webdevbiz.com/pwf/index.cfm

  • Simple button navigation script

    This question is so simple-I can't really find the answer
    anywhere, but as a complete NooB I have no idea how to make this
    work. I have a nested movie 1 layer down from main stage that has
    several navigation buttons that move to different main stage
    labeled frames. I get an 1120 error because I am somehow not
    calling them out on the script. I have named the instances..so
    that's not the problem. I think I just need to somehow direct the
    script to the nested location. If I move the buttons to the main
    stage I get no errors and it all works perfectly. Please help.
    Here's a sample script for the button:

    ok..not to mix things up but here's the instance name of
    button I'm currently working on: "buttonbio".
    It's located in a mc called "movFilmbackground". I'm trying
    to get the playhead to go to the frame label "bio" on the main
    stage.
    If I put the first code in...on the main stage at the
    beginning of the timeline, nothing happens when I try the button...
    If I put the second code in.. I get 1120 error.."access of
    undefined property buttonbio" & 1180 error "call to possibly
    undefined method movFilmbackgound"
    CODE

  • I've got a new computer with windows 7 & i downloaded firefox yesterdayerday. there are no menu buttons/navigation buttons showing up.

    i downloaded firefox yesterday. it is only showing maps4pc and googlechrome. there are no navigations tabs. i don't want the above two features. i only want plain simple firefox with navigation tool bar. everything i tried to fix the issue following instrurctions on the support pages didn't solve the problems. thanks

    Make sure that you do not run Firefox in full screen mode (press F11 or Fn + F11 to toggle; Mac: command+Shift+F).
    If the menu bar is hidden then press the F10 key or hold down the Alt key, that should make the menu bar appear.
    Make sure that toolbars like the "Navigation Toolbar" and the "Bookmarks Toolbar" are visible: "View > Toolbars"
    * If items are missing then open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout"
    * If a missing item is in the toolbar palette then drag it back from the Customize window on the toolbar
    * If you do not see an item on a toolbar and in the toolbar palette then click the "Restore Default Set" button to restore the default toolbar set up.
    See also:
    * http://kb.mozillazine.org/Toolbar_customization
    * https://support.mozilla.com/kb/Back+and+forward+or+other+toolbar+items+are+missing

  • LOV button navigation in multi row block

    We have two fields in a multirow block, Role Type and Parent Role Type(which is a LOV button). When the current row selector is on a Role Type row all Parent Role Type LOV buttons for all the rows change only the current selected row. With Designer we set Keyboard/Mouse navigable properties to Yes(in the OLB) which fixed it but with Headstart these properties do not fix this problem. Any info and suggestions would be appreciated. Thanks.

    Ok, now I understand.
    Unfortunately, you have run into some standard forms behavior that doesn't work the way you want it to. The LOV button is not navigable, because your cursor needs to be sitting in the data item when the call to the LOV is made. Since this button is not navigable, the cursor will not move to the current record when you press the button. (Actually, the button is identical on each record.)
    Possible solutions:
    1 - use only 1 button in an overflow below. (Create your own action item instead of using the LOV button preference.)
    2 - don't use a button at all. (Headstart provides the LOV toolbar button.
    3 - Try generating the lov as a poplist. (See Oracle Designer online help).
    4 - Use the new Oracle Look and Feel (available only on the web) to create a button in the field ('...').
    Regards,
    Lauri

  • Button Navigation Problems

    Hi, I'm having a frustrating problem when copying/pasting buttons. Its probably a bit unusual but here goes. I'm a composer and I'm creating a showreel for my music and soundtracks, so I needed the dvd to have a page with numerous audio tracks that the viewer could click and listen to. The only way I could find to achieve this was to have duplicate pages linked to each other that each had a different background track. For example, you see a menu with tracks 1 through 10, when you click track 1, nothing appears to happen but you actually go to an identical menu that plays track 1 in the background. My problem is that when i copy and paste the identical buttons from one page to the next, the navigations (up, down, left, right) don't copy. I update these tracks fairly often so its a lot of tedious work every time. Suggestions greatly appreciated.

    If you select the items in the menu, then Command C, go to the other menu (make sure to click on it) then Command V it should carry through.
    What I would so is set the first menu with proper navigation and color schemes for the menu.
    Then duplicate the menu 20 times
    On the 19 copies delete all the buttons, then set links in the buttons for the first menu, then copy and paste buttons as above, it saves the navigation
    Download this file
    Buttons Zip File
    I made menu 1, duplicated it 3 times, set the links in menu 1 buttons, removed the other buttons, copied from menu 1 then pasted.
    It actually took more time to write that last section than do it so it is pretty quick.
    Note that UP/LEFT press takes you backwards and RIGHT/DOWN goes forward (numerically) then cycles from 4 to 1 or 1 to 4 when the end is reached

  • Button navigation musical chairs

    I am running into a nightmare trying to set the navigation direction within a title that include 5 chapter menus. I will go through each of the buttons and set the direction, but once I am done, and double-check the buttons, the navigation is nothing like I set. Occasionally, some of the setting stick, but most often, I am going back through the setting again to re-set.
    I'm not sure if this makes any sense, as I feel like I am not describing the problem very well. I am hoping it's a common issue, or a simple operator error.
    I would be most appreciative of any insight into what I might be doing wrong. Please post any further questions if the issue I'm having isn't described very well.
    Thanks!
    Van Grafton

    Have a look in the 'Settings' drop down box and make sure the 'Auto Assign Buttons' is not checked. If it is then every time you move a button or make a change it will force DVDSP to reassign the navigation, overwriting your changes. If it's checked, just click on it again to remove the check and try to assign your navigation manually again.
    Another 'feature' of this setting is that on complex menus with lots of buttons it causes the app to run like treacle on a cold day any time you make a small adjustment to the position of a button. I tend to turn it off except for simple projects, and use the 'Assign Now' option instead.

  • Jsf command button navigation

    Hey can anyone tell me if this is correct way to go to the back page using the command button.
    <navigation-rule>
    <from-view-id>/History.xhtml</from-view-id>
    <navigation-case>
    <from-outcome>admin</from-outcome>
    <to-view-id>/Admin.xhtml</to-view-id>
    </navigation-case>
    </navigation-rule>
    History page.xhtml
    <input type="submit" jsfc="h:commandButton" name="back" value="Back" onClick="admin"/>
    Its getting refreshed in the same page.
    Any help?
    Thanks

    it should be action="admin", but not onClick="admin"

  • Flash Button Navigation Issues

    Hello all,
    I am a novice site designer. My first challenge is to design a navigation bar once and used by all web pages.  I built it using Flash buttons.  The concept works fine in a flat file, but when I'm viewing a web page that sits in a different directory than the flash navigation buttons, the buttons point to a file in the current directory which doesn't exist. I want the buttons to still point to the flash files in the parent directory.
    I'm using Dreamweaver CS2 to create my flash buttons. I'm using PHP include statements to include my flash navigation bar. When I create the php file in another directory, click on flash button, all heck breaks loose. I look at the URL and the link appends the PHP file that the flash button should be pointing to whatever directory my current web page is in.
    It seems like, I should just create each button  as a absolute path, http://rootdirectory.com/filename.php, but it still uses relative path when I'm looking at web page that sits in another directory and appends the navigation link to the current directory http://rootdirectory.com/currentdirectory/filename.php although it points to a link in the root or parent directory.
    Do I not know how to create flash buttons using the absolute paths?

    Movie1 and Movie2 should have a name in (Properties -
    Instance name).
    Assuming that button on Movie1 is on the movie, not inside
    the movie, that both movies are on the same timeline, and that you
    want to go to Movie2 frame 5, for example.
    Button on Movie1
    on(release){
    _root.Movie2.gotoAndStop(5);
    Hope this helps.

  • Forms 10g Alert button navigation/focus

    Hi,
    I have an alert that pops up on a certain condition that has 3 buttons to choose from. Navigating between buttons using the left and right arrow keys on works between the first 2 buttons only. Focus does not navigate to the 3rd button.
    This did not happen on Forms 6i. Is this normal behavior? Is this a bug in forms 10g? Is there a work around this? Any help will be appreciated.
    Thanks

    Hi,
    Im reactivating this thread because I just discovered this problem.
    You are rigth when you say that keyboard navigation works in lookAndFeel=Generic but not lookAndFeel=Oracle.
    But this not the only problem encountered.
    There is also the default button set in the alert that doesn't work and either in lookAndFeel=Generic and lookAndFeel=Oracle.!
    The focus is always on button one, and that is for me a big problem because it usualy the one we use for 'OK' and others for 'CANCEL'.
    I let you imagine what problems we can have if the user press return and send ok to the application .......
    Is there any patch that correct this behaviour (we are in 9.0.4 patchset 1 at the moment) ?
    Thanks
    Jean-Yves

  • Pop-Up menu button navigation?

    Created my first BR project in Encore CS5.1 with no issues that I thought. I made some pop-up menus for several timelines all works well in that area but the issue I had with the final (BD-RE on my player since I cannot preview pop-ups in Encore) is the navigation with the pop-up menu.
    Normally on a menu you can select "left, right, up, down" but on these pop-ups I made the pressing of the buttons on the remote do not correspond with where the selection goes. I press down and it skips over the next one down and instead goes to the third one down, I press "right" and nothing, I need to go "up" to go to the next line of buttons, etc.
    Is the issue that I have 10 buttons on my pop-up? Is there a limit to how many buttons are on there? I organized everything correctly in the project; the 10 buttons are spread out in three rows and I assigned them top to bottom 1,2,3,4,5 etc.....
    Thanks in advance for any help!

    Thanks for that, I have been using Encore since 1.5 and I hardly ever used that "button assignment" tool so forgot it was there. I think the issue came about because I used a pre done PSD menu for it and later added a few buttons in Encore,  I re-made the menu in Encore itself using new buttons assigned through Encore and the assignments all look ok. Thanks again!

  • Whay does button navigation change after I burn to Blu-ray using Encore CS6?

    Very odd. I've set up my Blu-ray project - created and previewed all the buttons, menus and navigation. The main menu contains a "Play Video" button, which is supposed to trigger the entire video to play. The "Chapters" button takes the viewer to a chapters menu. Everything previews fine on my computer. After I burn the disc, however, the button functions on my main menu have flipped. The "Play Video" button now takes the user to the chapter menu page and the "Chapters" button now plays the video. Also, the "Play Video" button is programmed to be the default for this menu. Now the menu defaults to the "Chapters" button. By the way, I created the same project on a DVD which plays as programmed. Any idea why the Blu-ray is having these issues? I'm thinking I'll reload Encore CS5 and reconstruct the project there. Thanks.

    Hi, Stan.
    I realized the problem was that the colors for the selected buttons on the Blu-ray version display darker than they do on the DVD. So I was being fooled into thinking the selected buttons weren't selected. Anyway, this was pilot error on my part. I just need to monkey with the color menu until I get the BR to approximate the DVD. Thanks. Cheers, Steve

  • Add toolbar button navigation bar

    Hi, Can I add toolbar or toolbar button to navigation bar? I am using Interface builder and it seems that I could not do it.
    thanks,
    ff

    <u>'''Can't see the Menu Bar'''</u> (File, Edit, View, History, Bookmarks, Tools, Help)?
    Turning the Menu Bar on and off is a new feature in version 3.6.
    ''(Linux & OSX see: [[Menu bar is missing]] )''
    <u>''Windows'' Method 1.</u> '''''Hold down''''' the key and press the following letters in this exact order: V T M
    <u>''Windows'' Method 2.</u> Press and release the key. The Menu Bar will be displayed; then choose ~~red:V~~iew > ~~red:T~~oolbars and click on ~~red:M~~enu Bar.
    The Menu Bar should now be displayed permanently, unless you turn it off again using View > Toolbars. Check mark = displayed, NO check mark = not displayed.
    See: http://support.mozilla.com/en-US/kb/Menu+bar+is+missing
    <u>'''Navigation Toolbar, Bookmarks Toolbar and other Toolbars'''</u> under View > Toolbars. Clicking on one of them will place a check mark (display) or remove the check mark (not displayed).
    <u>'''To display the Status Bar'''</u>, View, then click Status bar to place a check mark (display) or remove the check mark (not displayed).
    <u>'''Full Screen mode'''</u>
    http://kb.mozillazine.org/Netbooks#Full_screen
    Also see:
    ''' [[Back and forward or other toolbar buttons are missing]]'''
    '''[[Navigation Toolbar items]]'''

  • Cancel button + navigation

    Hi,
         I have a form which gets validated when the user clicks the submit button.
         Now, I have also included a Cancel button in the jsp page. I want that when the user clicks the Cancel button then without any validation taking place, the page should navigate as specified in the faces-config.xml.
    The navigation-case for the Cancel action is as follows:
      <navigation-case>
       <from-outcome>Cancel</from-outcome>
       <to-view-id>/Type1.jsp</to-view-id>
         <redirect/>
      </navigation-case>          How do I use the Cancel button so that only the navigation takes place without validating the page.
    Thanks in advance,
    Deep

    Add immediate="true" to the button.

Maybe you are looking for