A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: need help reading check variable from external text file

  1. #1
    I am making a flash website template and I have encountered some problems. The first being a check variable that makes sure all the variables have been loaded before continuing.
    Here's the actionscripting and what the text file looks like:

    the first keyframe has these actions:

    Load Variables ("logo.txt", "")

    the second keyframe has these actions:

    If (check = "ok")
    Go to and Stop (5)
    Else
    Stop
    End If

    the text file looks like this:

    logo=corefactory
    &check=ok

    the problem that I am having with this is even if I change the value of the check variable to something other than "ok", it still Goes to and stops on frame 5. I have tried several different variations of check="ok"(like: "check"="ok" , check eq "ok" , "check" eq "ok")

    What am I doing wrong. This problem is the key to some other problems I'm having reading variables that have been loaded from an external text file.

    Thank you in advance for any help that is offered. Peace out!



  2. #2
    Member
    Join Date
    Mar 2001
    Location
    Venice, CA
    Posts
    88
    It's really weird that your indications are showing that check = ok rather than the other way around. I'm not sure why that's happening, but there were a few red flags I saw in your code:

    You're not loading your variables into any particular place - looks like they're going to an empty target mc (""). I'd try loading them into level0 (root) --
    Code:
    Load Variables ("logo.txt", 0)
    or into a mc you have set up ("/myMC") --
    Code:
    Load Variables ("logo.txt", "/myMC")
    Your syntax for the If statement should be
    Code:
    If (check eq "ok")
    - you have that one listed, I'd switch back to it. The = sign is for numbers, "eq" is for literals.

    Text file formatting: I've found that carriage returns in a text file tend to flummox my movies - if possible, try to keep your text data on one line --

    logo=corefactory&check=ok

    Finally - The trace action is your friend! You'll need to pin down whether the variable's not getting there, whether you think it's something different entirely, or whether the code isn't working. This can be cleared up by running the movie in test mode and having it tell you what the value of 'check' is every time you run it:
    Code:
    On (Release)
          If (check eq "ok")
                Go to and Stop (5)
          Else
                Stop
          End If
          Trace ("check = "&check)
    End On

    I know that doesn't solve your problem, but it might help you troubleshoot a bit (I hope!)

    Best,
    Kate
    [Edited by katharine on 03-28-2001 at 12:33 PM]

  3. #3
    I made another text field and made it show what the check variable was and it spits it out right, the "eq" doesn't work at all it will just sit on that frame. Maybe that's my problem. I don't know. I need more guidance...

    Thank you though for trying to help me out.

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