SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Jan 2003
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Integrating PHP scripts with Flash

    I use PHP all the time for news, guestbooks, polls, etc. on my site. I also use Flash for cool effects and interaction.

    So what I am trying to do now is find a way to incorporate the two, so that I can use Flash for the 'face' of the site and PHP for the dynamic content.

    I have googled all over and all I have found are a few examples of scripts that have been setup, but no good generic advice for achieving this.

    I am not great with code, but I get by. All I am looking for is a how-to that could help me figure out how to get the content called from PHP and incorporated into my Flash movies.

    Any help would be appreciated...

  2. #2
    SitePoint Enthusiast
    Join Date
    Sep 2002
    Location
    Hamburg
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hej SoulSe,
    to send variables from FLASH to a php-file
    try this:

    on (release ##or whatever you need##){
    loadVariablesNum ("yourphpfile.php", 0, "POST");
    }

    Cheers,
    Karsten

  3. #3
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also have a look at PHPObject - http://ghostwire.com/resources/phpobject/

    PHPObject is an opensource alternative to Flash Remoting for PHP developers. With PHPObject, you can call a method of a PHP class/library on your web server as if the class/ library was defined in Flash itself. It takes care of your client-server connections and makes passing of variables (properties) between Flash MX and PHP easy, and thereby providing a convenient way to connect rich media clients with data and business logic residing on your server.

  4. #4
    SitePoint Addict
    Join Date
    Apr 2002
    Location
    Miami
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SoulSe
    I use PHP all the time for news, guestbooks, polls, etc. on my site. I also use Flash for cool effects and interaction.

    So what I am trying to do now is find a way to incorporate the two, so that I can use Flash for the 'face' of the site and PHP for the dynamic content.

    I have googled all over and all I have found are a few examples of scripts that have been setup, but no good generic advice for achieving this.

    I am not great with code, but I get by. All I am looking for is a how-to that could help me figure out how to get the content called from PHP and incorporated into my Flash movies.

    Any help would be appreciated...
    I do alot of this type stuff and my PHP coding stinks but for talking to flash this is the basic approach... I amtalking to Flash 4 by the way
    PHP Code:
    <?php
    include("aconstants.inc");

        
        
    $precheck mysql_query("SELECT SUM(new) AS num_new FROM mailroom");
        
    $row=mysql_fetch_array($precheck);
        
    $sum$row["num_new"];
        
        if(
    $sum "1") {
        
    $newmail"0";
        
        
    $report"newmail=";
        
    $report .= rawurlencode($newmail);
        echo(
    "$report");
        
        } else {
        
        
    $newmail$sum ;
        
    $report"newmail=";
        
    $report .= rawurlencode($newmail);
        
        echo(
    "$report");
    }
    ?>
    For multiple variables use "&" without quotes to seperate variables
    ie: $report&$report2&$report3 and so on.

  5. #5
    SitePoint Member
    Join Date
    Jan 2003
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys, I'm off to try and get a news script running with Flash...

  6. #6
    SitePoint Zealot
    Join Date
    Aug 2002
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Some resources:
    There's a board for the PHP For Flash/ Advanced PHP for Flash book here: www.phpforflash.com
    www.flashkit.com has a good backend/scripting forum
    http://www.flash-db.com/


Bookmarks

Posting Permissions

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