#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    4
    Rep Power
    0

    Unhappy Help Please Question about Flash Sending and Loading..


    hey i just have a question i am pretty new to flash
    but i have figured a few things out.

    I have retrieve button on my form, which recalls information entered. what i want to do is
    when a person enters examppe 7855 it pulls up there information..

    so far i have this. to demonstrate abit of my code
    PHP Code:
    //actionscript not php..

    on (release)
    {
        
    myLVs = new LoadVars();
        
    myLVs.load("lrm.asp");
        
    myLVs.onLoad = function(success)
        {
            
    other.text myLVs.other
            details
    .text myLVs.details 
    this only loads my data from the database,
    So i have the Input box called "store" with MyLVs

    do i have to use the sendAndLoad ? to send the number and then get a responce from the server?..

    and if so where would i have to place it in my script and what would i change?

    thanks if someone coupld help me please.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    126
    Rep Power
    12
    Well, if its asp we are dealing with im not gonna be able to help you on that part.... the flash part is pretty simple though....
    if you are using the value "7855" in your php or asp script, you DO need to sendAndLoad. for example...

    Code:
    scriptURL = "http://www.me@myhost.com/script.php";
    myLVs = new loadVars();
    // query is the variable name we will use in the php or asp script. 
    
    myLVs.query = inputText.text;
    myLVs.sendAndLoad(scriptURL, this, "POST");
    myLVs.onLoad = function(){
           // we will say that the php or asp script sent back a variable named response and we are going to display it in a text field named responseText;
    
    responseText.text = myLVs.response;
    
    }
    No matter what scripting language it is you are using, make sure that all responses to flash are structured like this....

    PHP Code:
    // echo is the way to send info back to the users browser in php... use the according method in other languages.... 
    echo "&response=$variable"

    Hope this could be of help to you. If you have any questions, feel free to ask.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    4
    Rep Power
    0
    so basically the response.Text

    will be written back in the dynamic box right?


    is there a way that i can make PHP or ASP

    make a javascript pop up?


    maybe?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    126
    Rep Power
    12
    If php sends
    PHP Code:
    echo "&response=$text"
    then flash's loadVars object that called the php script will recive the variable "response" with a value of "$text". To access this variable....

    Code:
    trace(myVars.response);
    will print out the value of response.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    4
    Rep Power
    0
    in my form i have a whole bunch of radio buttons
    here are two

    radioGroup.setValue(myLVs.radioGroup);
    radioGroup1.setValue(myLVs.radioGroup1);

    but thisis my problems becase it's tied to an asp page and access file mdb

    access send asp a TRUE or FALSE value

    how can i make my radio buttons recongnize this? under flash mx.
    ?
    i dont know how to do if statements for radiogroups either can someone show me?
    does it matter what the component names are for the radio buttons
    ? please help
  10. #6
  11. No Profile Picture
    flash junkie
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    CO, USA
    Posts
    172
    Rep Power
    12
    all you'd need to do is reference the instance name of the radioGroup or radioButton and set the setState method to set the checked value. the if statement is exactly the same as any other if statement

    cheers,

    bret
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    4
    Rep Power
    0
    does anyone
    know how to make when u press the TAB button work properly?

    it jumps all over the place!!
  14. #8
  15. No Profile Picture
    flash junkie
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    CO, USA
    Posts
    172
    Rep Power
    12
    you can set the tabOrder of any MovieClip or button. i believe it's

    object.tabIndex = num;

    where num is any real number. You'll need to speicify for every tabable item.

    cheers,

    bret

IMN logo majestic logo threadwatch logo seochat tools logo