Manipulating Variables Within a Flash-based Reference

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nitron
    Member
    • Apr 2004
    • 37

    #1

    Manipulating Variables Within a Flash-based Reference

    TRUMP 2020.
    Last edited by Nitron; 10-22-2020, 12:18 PM.
    Z Force Network
  • sdjl
    Senior Member
    • Mar 2004
    • 502

    #2
    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
    -----
    Do you fear the obsolescence of the metanarrative apparatus of legitimation?

    Comment

    • Nitron
      Member
      • Apr 2004
      • 37

      #3
      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?
      Z Force Network

      Comment

      • Buddha
        Senior Member
        • Mar 2004
        • 825

        #4
        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.
        "Whatcha mean I shouldn't be rude to my clients?! If you want polite then there will be a substantial fee increase." - Buddha

        Comment

        • Nitron
          Member
          • Apr 2004
          • 37

          #5
          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.
          Z Force Network

          Comment

          Working...