Manipulating Variables Within a Flash-based Reference

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Nitron
    replied
    Excellent, thank you both.

    If you're interested in exactly what flash-object it is, it's for the new popular video game "Halo 2", check it out: http://zforcenetwork.com/stats.php (for example, type in nbot or stealth06, just some names to try).

    I'll be sprucing the page up a little later.

    Leave a comment:


  • Buddha
    replied
    Just get rid of the else block like this:

    PHP Code:
    <?php
    // See if the user has a playername
    if(isset($_POST['playername']) && !empty($_POST['playername'])) {
    // Load the flash movie with playername
    ?>
    <object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" height="180" width="470">
    <param name="movie" value="http://www.mlgpro.com/bnet/mlgstats.swf?playerName=<?php echo $_POST['playername']; ?>">
    <param name="quality" value="high">
    <embed src="http://www.mlgpro.com/bnet/mlgstats.swf?playerName=<?php echo $_POST['playername']; ?>" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" height="180" width="470">
    </object>
    <?php
    // If no playername is assigned, show a prompt box for them to type a name

    ?>

    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
    <input type="text" name="playername" />
    <input type="submit" name="submit" value="Play!" />
    </form>
    The HTML form should appear below the Flash.

    Leave a comment:


  • Nitron
    replied
    Sweet, it worked! Thanks a bunch.

    That method is cool, using PHP and all.

    One last question... Any idea on how to possibly keep the textbox and "Play!" button intact, even when the flash object is loaded, so one doesn't have to press the back button to get a new stat?

    Leave a comment:


  • sdjl
    replied
    Try this. It's PHP based:

    PHP Code:
    <?php
    // See if the user has a playername
    if(isset($_POST['playername']) && !empty($_POST['playername'])) {
    // Load the flash movie with playername
    ?>
    <object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" height="180" width="470">
    <param name="movie" value="http://www.mlgpro.com/bnet/mlgstats.swf?playerName=<?php echo $_POST['playername']; ?>">
    <param name="quality" value="high">
    <embed src="http://www.mlgpro.com/bnet/mlgstats.swf?playerName=<?php echo $_POST['playername']; ?>" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" height="180" width="470">
    </object>
    <?php
    // If no playername is assigned, show a prompt box for them to type a name
    } else {
    ?>
    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
    <input type="text" name="playername" />
    <input type="submit" name="submit" value="Play!" />
    </form>
    <?php
    }
    ?>
    It's untested, so give it a whirl and yell if something fails.

    David

    Leave a comment:


  • Manipulating Variables Within a Flash-based Reference

    TRUMP 2020.
    Last edited by Nitron; 10-22-2020, 11:18 AM.
Working...