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

    Join Date
    Jan 2003
    Posts
    1
    Rep Power
    0

    Question Load Variables into Buttons


    Can anyone tell me how to load a variable from PHP into a button. For example; I want to get a value from a PHP file and load it in the getURL values within a Flash Button.
    Since I cannot seem to give a button a variable name I cannot loadVariablesNum and have it read it correctly.

    Thanks for your help.
  2. #2
  3. macho member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Posts
    207
    Rep Power
    12
    you probably know this part:

    /********************************

    // inside a movie clip i placed this ...
    onClipEvent(data
    {
    // let say your var name is ... dynaLink
    // I passed it to a bunch of variable holders on _root
    // I hear inserting data into objects will make code much more modular

    dynaLink = _root.dynaURL;
    }

    onClipEvent(load)
    {
    loadVariables("processMe.php",this);
    }

    *********************************/

    then, then on your button just do this

    /*********************************
    // if its a folder and not a file
    // eg: http://www.abc.com/flash/
    on(press)
    {
    getURL("http://www.macromedia.com/"+_root.dynaURL+"/");
    }


    // if its a file - the difference is the trailing slash
    // eg: http://www.abc.com/flash/gallery.html

    on(press)
    {
    getURL("http://www.macromedia.com/"+_root.dynaURL);
    }


    // the trailing slash has cause me some trouble last time, so i empahsise here, you probably know ...

    *********************************/

    cheers~
  4. #3
  5. macho member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Posts
    207
    Rep Power
    12
    oops, the trailing slash thing could be quite an issue if u use my example above ...

    beter way is just to pass a proper value. eg:

    // use this
    on(press)
    {
    getURL("http://www.macromedia.com/"+_root.dynaURL);
    }

    then dynaURL value should already have the trailing slash if its needed ...
    this is the easiest way i can think of.


IMN logo majestic logo threadwatch logo seochat tools logo