A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Assigning Variables

  1. #1
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702

    Assigning Variables

    I'm wondering???
    I need to assign some "hidden" variables. In the last version is was simple. You simply LET "variable" = "value"

    However, there doesn't appear to be a LET command in V4.

    I was just going to make a SCRIPT and just enter it like this:

    variable name="variable value"
    variable name="variable value"

    BUT does anyone know if this will pass the data as variables?

    My first attempt was to create text boxes with the data in it and change the colors to that the text box couldn't be seen - Problem - When tabbing through the form, the EDIT boxes(Even the one's I want hidden)become selected.

    Any thoughts???

  2. #2
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    Just a note...I just thought of a way, using the EDITBOX.

    DE-Select the SHOW AT START OF MOVIE option {the little arrow button}

    I still am curious if the scripting would work as well.

    Another thought is, has anyone found a way to set TAB ORDER?

  3. #3
    hates sounds in preloaders.
    Join Date
    Nov 2002
    Location
    Sweden
    Posts
    361
    The TAB order depends on the position in the element list. If you want an edit box to not be selectable, uncheck the editbox "is selectable" and check the box "read only".

    Yes, you assign a string to a variable by using
    variablename = "variable value";

    And if you want a boolean:

    variablename = true or false

    And a number:

    variablename = number
    hurg.

  4. #4
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    All variables are sent. So yes assigning them in script will work.

    Not sure about the tab order. I had issues with that in the guest book example

    By the way if we get the bugs out I've got a new simple guestbook example coming for v4!

  5. #5
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    Anyone figured out how to pass these variables?

    In 3.7 there was an option under the OPEN URL box.

    I can't find an equivilent in v4

  6. #6
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Everything is done in script now.....

    loadVariables("URL","GET | POST")

    So if you PHP script is at http://mydomain/mycode.php you would do:

    loadVariables("http://mymydomain/mycode.php","GET");

    Note the pulldown syntax help is missing the GET POST part. This is fixed in next beta.

  7. #7
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    That's great BUT, it didn't work.

    Is there another Beta update?

  8. #8
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Hmmm it's working for me.....

    Make sure to enclose either GET or POST in quotes.

  9. #9
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    where did you put the script?

    Did you put it under the BUTTON DOWN action or did you put an OPEN URL under the BUTTON DOWN and just put the script somewhere else?

  10. #10
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Well in my paritcular movie I put it in the startup script as it is a guestbook and I want to retrieve entrys at the start. It's in a function in the start script and then the same script calls it. This way it can be called later when the entries need to be update from the database.


    You should put it somewhere that it will be called only once when needed be it in a button action, in a scene action whatever.

  11. #11
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    Ok, I've found the problem.

    You have to actually use a full URL. You can't use the root ./scriptname.php

    It doesn't recognize that it's loading a webpage the above way.

    Now, that I've figured that out. I'm running into a different problem.

    One- once the variables are passed to my php script the flash program doesn't seem to do anything. HOWEVER the email that is supposed to be sent DOES get sent.

    When I was using the OPEN URL method it would open the page and say "Thanks, your information has been sent."

    Now, it does nothing. It stays on the flash file.

  12. #12
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Originally posted by dniezby
    Ok, I've found the problem.

    When I was using the OPEN URL method it would open the page and say "Thanks, your information has been sent."

    Now, it does nothing. It stays on the flash file.
    In you PHP do it this way

    $sent=@mail(to,subject,message,header)


    then send $sent back as a variable to the flash and have flash check the variable and when ($sent=true) display you thank you.

  13. #13
    Senior Member
    Join Date
    Jul 2001
    Location
    Tinley Park, IL
    Posts
    702
    Very interesting idea....
    I will look into that method.

    I'm having a hell of a time getting my CONDITIONAL statements to work.

    I'm posting the movie file in my other thread.

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