A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: variables if statement

  1. #1
    Junior Member
    Join Date
    Jan 2001
    Posts
    5

    Smile

    Hello

    Can anyone help - I have a movie which loads a variable in from a TXT file (&intro=y)

    loadVariablesNum ("intro.txt", 0);

    which is loading fine as i can get the value back using dynamic text - however I want to write a script that says if intro = y then go to frame 3 else if intro = no goto frame 200 this is the script i have written but nothing seems to happen

    if (intro = "n") {
    gotoAndPlay (200);
    } else if (intro = "y") {
    gotoAndPlay (3);
    }
    I have not really used actionscipt before so any help is much appreciated

  2. #2
    Senior Member
    Join Date
    Mar 2000
    Location
    London
    Posts
    961
    Try this (use == to test equality):

    if (intro == "n") {
    gotoAndPlay (200);
    } else if (intro == "y") {
    gotoAndPlay (3);
    }

  3. #3
    Junior Member
    Join Date
    Jan 2001
    Posts
    5
    Thanks - I've tried that but still no change any more ideas?

  4. #4
    Junior Member
    Join Date
    Apr 2001
    Posts
    10

    How about eq

    if (intro eq "n") {
    gotoAndPlay (200);
    } else if (intro eq "y") {
    gotoAndPlay (3);
    }

    Try setting intro to a value at the start.

    Are you posting any variables to it?
    I have found that some versions of IE 5.5 mainly can't handle this function correctly, don't know why

    If anyone can help with that problem I would apreciate it.

  5. #5
    Junior Member
    Join Date
    Jan 2001
    Posts
    5
    Thanks Paul - Yes when I enter a value for intro at the start it works - however I worked round it a different way in the end - as the movie is part of an authorware project - I got the Authorware movie to send the variable to the flash object using the flash asset xtra - bit long winded - but saves having to use a text file - would also work if using Director.

    Thanks again for your attention

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