A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: It's been so long I don't know where to start..

  1. #1
    Senior Member
    Join Date
    Sep 2000
    Posts
    405

    It's been so long I don't know where to start..

    I don't think this will be too hard, but I need a nudge in the right direction...
    I want a flash movie to load different text files and picture sets based on a string passed in the URL. For example, user clicks on link "12-20-03" which looks like this:
    PHP Code:
    <a href="http://mysite.com/myphp.php?date=122003"
    An swf embedded in myphp.php will read the "date" variable and load the corresponding text file and pix.
    My question - how do I get the swf to read that when the page in which it is embedded loads?

  2. #2
    Senior Member
    Join Date
    Nov 2003
    Location
    Las Vegas
    Posts
    770
    You will need to add the variables to the URL of the SWF file in the object and embed tags of your PHP output.

    Code:
    <?$MyVar='whatever';
    print "<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version=6,0,0,0\" ID=objects WIDTH=\"300\" HEIGHT=\"250\">
    <PARAM NAME=movie VALUE=\"draw.swf?MyVar=$MyVar\">
    <EMBED src=\"draw.swf?MyVar=$MyVar\" WIDTH=\"300\" HEIGHT=\"250\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">
    </OBJECT>
    ";
    Happy Holidays!
    Jerry

  3. #3
    Senior Member
    Join Date
    Sep 2000
    Posts
    405
    Okay I have the PHP working and the date is being passed to the page as it does display correctly on the 'dates.php' page. However I cannot get the variable to pass into Flash. Here is my code:

    First the PHP script. I have also used the $HTTP_GET_VARS method of frabbing the variable that is passed to via the hypelink to this page.

    PHP Code:
    <?php $_GET['date'];  print $date
    print
    "<OBJECT classid=\"clsidD27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash2/cabs/swflash.cab#version=6,0,0,0\" width=\"500\" height=\"500\">
    <param name=movie value=\"bf_dates.swf?date=
    $date\">
    <param name=\"quality\" value=\"high\">
    <param name=\"menu\" value=\"false\">
    <embed src=\"bf_dates.swf?date=
    $date\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"500\" height=\"500\" menu=\"false\"> 
    </embed> </object>"
    ;?>
    And the Flash actionscript:
    Code:
    if (date eq "") {
    	loadVariables("default.txt", "");
    } else {
    	loadVariables(date and ".txt", "");
    }
    It seems so simple. I'm probably missing one little thing...
    Last edited by Blutimus; 12-28-2003 at 07:15 PM.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center