A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [F8] Argh, simple code help.

  1. #1
    wiggle your jiggle TrytoAnimate's Avatar
    Join Date
    Sep 2000
    Location
    Rhode Island, USA
    Posts
    149

    [F8] Argh, simple code help. (Resolved)

    I'm coming from flash 5 to flash 8 trying to learn actionscript, and for some reason I can't seem to code even the simplest things correctly I'm attaching a simple navigation I'm working on to help explain. Basically, I'm working with a variable and 5 buttons. I have 5 labels on the timeline acting as points to stop on, then a few frames after each I have a keyframe set to determine the value of the variable and send it to the corresponding keyframe. The function of the buttons is to set the variable to a certain string, then set the main timeline in motion. So in effect, this is what will happen:

    The timeline is stopped on the "welcome" frame. When you click on a button, it sets the "nav" variable to a string, and tells the maintimeline to play. The timeline comes to a frame with script saying:

    if (nav = "home") {
    gotoAndStop("home");
    }
    if (nav = "about") {
    gotoAndStop("about");
    }

    etc... Then the process should repeat whenever the user clicks on a button. Why isn't this simple script working??? If I'm having problems with actionscripting things this basic, I think I'm really going to need to find some serious "actionscripting for dummies" book.

    Any thoughts?
    Attached Files Attached Files
    Last edited by TrytoAnimate; 02-03-2007 at 08:12 PM.

  2. #2
    Senior Member
    Join Date
    Aug 2004
    Location
    plymouth-uk
    Posts
    313
    if your there could you re save as Flash MX file so I can have a peep for you :-)
    NOW! look whats happened! I told you to watch this space and now its gone.

  3. #3
    wiggle your jiggle TrytoAnimate's Avatar
    Join Date
    Sep 2000
    Location
    Rhode Island, USA
    Posts
    149
    sure thing
    Attached Files Attached Files

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    if (nav == "home")

    you need a double eq sign to compare. the way you wrote it, you assign a value.

    gparis

  5. #5
    Senior Member
    Join Date
    Aug 2004
    Location
    plymouth-uk
    Posts
    313
    as gparis mentions:


    double == means equals to
    where as
    single = means equals
    so:

    d=0;//d equals 0;

    d==0; d is equal to 0
    NOW! look whats happened! I told you to watch this space and now its gone.

  6. #6
    wiggle your jiggle TrytoAnimate's Avatar
    Join Date
    Sep 2000
    Location
    Rhode Island, USA
    Posts
    149
    Ahhhh, makes perfect sense. Thanks so much!

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