A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: navigation options

  1. #1
    Junior Member
    Join Date
    Oct 2004
    Location
    Edmonton, Canada
    Posts
    14

    navigation options

    I'm trying to get a movie to either show frames 1-3, 1-5, 1-7 or 1-10, by having the user choose one of four buttons on a starting menu screen that corresponds with the choices. But, no matter what I do (using GOTOs or, StopandPlays, etc...) I can't seem to get the program to recognize which button is pushed by the user, so it only displays words 1-3. Any navigation Gods out there?

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    You mind attaching this .fla of your's so we might better understand what you're getting at?

    It would have to be zipped up, and in a MX only format, not MX2004.

    You would have to save a copy of your MX2004 .fla, (using Save as...) and changing the Document type to MX only in the Save as... window.

  3. #3
    Junior Member
    Join Date
    Oct 2004
    Location
    Edmonton, Canada
    Posts
    14
    Thanks for the hint oldnewbie...never thought of that (as it was my first post). BTW, I only have MX, not 2004 yet. Hope the zipped folder works.
    Here it is
    Attached Files Attached Files

  4. #4
    Inspector General
    Join Date
    May 2001
    Posts
    493
    pepperman,
    you're on the right track but a few small common errors are mucking it up.

    first on the button press you have this:

    on (release) {
    counter = "1";
    }

    putting the 1 in quotes is telling flash that it is a string, similar to dog, cat, house. I'm assuming you want it to be a number so just remove the quotes.

    ---

    second your conditional statement is like this:

    if (counter = 1) {
    gotoAndStop(22);
    }

    this is the grand daddy of flash annoyances and i fall for it all the time.

    you need to have ==
    like this:
    if (counter == 1) {
    gotoAndStop(22);
    }

    if you have one = in an if statement it SETS counter equal to 1. one = sign is what they call an ASSIGNMENT operator. it ASSIGNS a value to something. you use this when you are defining your variables.

    if you have == it is called a COMPARISON operator which is used in conditional statements. you are comparing a variable to a desired value.

    i've spent hours troubleshooting this in my own movies dozens of times. it will sink in

    ----

    another problem is that you are using
    gotoAndPlay to point to frames that have a stop() action on them. the stop action w/i the frame will terminate the gotoAndPlay action that sent you to it.


    i am going to modify your fla with the corrections mentioned above so you can have it as a reference.i'll post it shortly.
    Last edited by meglomor; 10-31-2004 at 11:17 PM.

  5. #5
    Inspector General
    Join Date
    May 2001
    Posts
    493
    done:
    flashcards_mx swf to see working
    Attached Files Attached Files

  6. #6
    Inspector General
    Join Date
    May 2001
    Posts
    493
    hey pepperman,

    i just reallized that you have a button setup to advance frames on keypress which wasn't particularly clear in your post or fla.

    what you will have to do is...

    reinsert the stop actions on the proper frames, and on the big button simply have a play function.

    this way the movie will stop on everyframe and advance on press or keypress. when the playhead reaches one of the intermittant conditional statements it will read it and do as it is told.

    also also, i noticed your button had 2 on(press) handlers, this will confuse flash.
    Last edited by meglomor; 10-31-2004 at 11:35 PM.

  7. #7
    Inspector General
    Join Date
    May 2001
    Posts
    493
    ah what the heck, i put the "click mouse / right arrow " to advance feature in for you too.

    *note there is only one instance of the button on stage with only one action on it.

    *note i initiated your numcorrect variable as 0 in the first frame
    flashcards with button press functional
    Attached Files Attached Files

  8. #8
    Junior Member
    Join Date
    Oct 2004
    Location
    Edmonton, Canada
    Posts
    14

    you rock!

    meglomor,
    You rock! The == totally solved my main stumbling point (lots of stuff to still work on though). Who woulda thought missing a single = would cause such a headache. Sorry about forgetting the arrows for frame advancement; brain cramp! Still trying to figure out some of the layers you added on what you returned to me. Thanx again. Likely be hearing from me again.

  9. #9
    Inspector General
    Join Date
    May 2001
    Posts
    493
    happy to help. thanks for checking back.
    feel free to ask about the fla.

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