A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: problem with set variable

  1. #1
    Member
    Join Date
    Jan 2002
    Posts
    95

    problem with set variable

    I have a number of buttons each of which sets a variable when clicked. Here's the code:

    on (release) {
    movname = "socevents";
    gotoAndPlay(90);
    }

    The movie then jumps to frame 90, plays a 10 frame animation then jumps to a different scene based on the variable. Here is the code:

    if (movname=socevents) {
    gotoAndPlay("socevents", 1);
    }

    The problem is, when I export it, it will play the same scene regardless of which button I select (each button sets a different variable).

    I'm just experimenting with variables, so if I'm totally off, I apologize.
    Last edited by fruiter; 06-19-2003 at 12:36 PM.

  2. #2
    The ActionScript Master Master64's Avatar
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    654
    Hoi

    code:

    if (movname=="socevents") {
    gotoAndPlay("socevents", 1);
    }


    there has to be two == in an if
    you a asinged movname a string so you should test a string
    Master64
    useing:XP,MX

    don't send me PM's because i never check it so if you what to contact me use Email

  3. #3
    Member
    Join Date
    Jan 2002
    Posts
    95
    I got it. Thanks so much for your help!
    Last edited by fruiter; 06-19-2003 at 01:22 PM.

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