Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2008
    Posts
    36
    Tokens
    0

    Default Actionscript grab PHP vars

    Right i need some help, im using flash CS3 AS2 and i have made a simple mp3 player. I need the flash to grab a php variable and use it.

    the php variable would be:

    PHP Code:
    $getp[user
    And it needs to go where the bolded PHPVAR is:

    Code:
    playlist.load("playlist.xml?s=PHPVAR");
    any ideas how to do this?

  2. #2
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Why not just send it to the flash player via a variable in the filename.

    Like

    bla.swf?user=<?php echo $getp["user"]; ?>

  3. #3
    Join Date
    Aug 2008
    Posts
    36
    Tokens
    0

    Default

    Thats what i did in the end.

    in the flash object i had:

    Code:
    .swf?filename=<?php echo $getp[user]; ?>
    and then in my actionscript i just put:

    Code:
    myVars = new LoadVars();
    myVars.load("http://website.com/pagewiththevars.php");
    myVars.filename;
    
    playlist.load("playlist.xml?s="+filename);
    and it worked

  4. #4
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    I would recommend you using <?php echo $getp["user"]; ?> for effiency.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •