A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Evaluating returns from Cookies

  1. #1
    Junior Member
    Join Date
    Apr 2000
    Posts
    1

    Question

    I am using Flash with FS commands to write to and read from Cookies. I have succesfully got Flash to pass values to cookies and for cookies to pass values to Flash. What I cam doing is loading a string from a cookie 'WWUserName' into a variable (an editable text field) named realname. I want Flash to parse the text so that if it equals 'NULL' the text is changed to something else. I have tried, but failed. I used the following Action Script:

    FS Command ("GetName", "")
    If (realname eq "testing123")
    Set Variable: realname = "Correct"
    Else
    Set Variable: realname = "Incorrect"
    End If

    The FS Command GetName puts the value from the cookie into the realname textbox fine, but the script after isn't working.

    Any suggestions? I would really appreciate if people emailed me suggestions (james@newerawd.co.uk) as I won't have much time to check back here.

    Cheers.

  2. #2
    Junior Member
    Join Date
    Mar 2000
    Posts
    22

    Post

    Hi

    I think your problem is that you have the commands all in the same frame.

    Flash is trying to evaluate 'realname' before it has got it from the cookie.
    I know its only a tiny pause while you access the cookie but it is long enough for flash to miss the result, even though it is very quickly displayed in your text box.

    Just to test if this is the problem try having two buttons the first calls the cookie and gets back 'realname' and the second then evaluates it.

    eg:
    "button1"
    On (release)
    FS Command ("GetName", "")
    End on

    "button2"
    On (release)
    If (realname eq "testing123")
    Set Variable: realname = "Correct"
    Else
    Set Variable: realname = "Incorrect"
    End If
    End on

    If this works I'd love to see the code you've used to write to cookies, I've done it using Get URL and javascript but I haven't tried FS commands yet.

    Cheers

    Dan



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