I am trying to put together a BBS made with Flash MX. I hear that Flash is powerful, so I would imagine it can handle it... I want Flash to use MySQL as a database so I can store pictures, text, and member data. I also want Flash to keep a constant connection with the database, or update frequently. Also, I need to know what to do to get the text/pictures/member data to load in the Flash movie. If anyone could help, thanks a bunch!

Lybib

    😕 Uuuh... Does anyone have any answers to my questions?

    Lybib

      Create a script in php who read your pictures, text,.. from a data base and send it to your flash. In your falsh you could read your variables with loadvariables function I think.

        I think that this is a bit more difficult than you imagine - especially if you're gonna update your db as well as pilfering data from it 😉

        But flash can use a php-script to load variables, app. like this example:

        You'll need a flash film that loops, with a load variables-statement on frame 1. The length of the film decides how often it will update itself (and this should be paid attention to! A very frequent update will result in a request being sent to the server in - say, every second. With 10 users loading and running the film, the server receives a request every 0,1 second. Moreover, if they go for lunch without exiting the page, the film continues to reload the php-script in question, thus giving the server much unneccesary load).

        But enough of that, one way to load vars:

        loadVariables ("script.txt", "/", "POST");

        this is action-script, and will load the contents of script.txt into the film. And the script.txt contains one line:

        &url=http://yoursite.com/da_php_script.php

        which is the php-script that actually do the pick from mysql.
        It's probably possible to link the phpscript directly in the loadVariables, but this way opens for more than one script being used. Its how I did it, anyway 😃

        You'll probably code the php/mysql yourself, but here's an example on how to load an output from the script into the film:

        <?PHP
        ## Headers to control caching ##
        header("Cache-Control: no-cache, must-revalidate");
        header("Pragma: no-cache");
        ## Note the output below: output is the dynamical field in the film to receive the data ##
        ?>
        &output=
        <?PHP
        ## Do the php/mysql stuff here and echo the data ##
        ?>
        

        Well, it's a suggestion... 😃

        Each time the film loops, the script is loaded and does whatever it was meant to do, and loads the result into the field output.

        knutm

          🙁 Wow... This is more complicated than I thought... 😃 Well, thanks for helpin' out, guys!

            It can be a bit tricky. Here is a great book on the subject:

            "Server-Side Flash"
            by William B. Sanders & Mark Winstanley

            It covers flash with database connectivity very well.

              😃 Dude, thanks! I'll have to look into that...

              Lybib

                3 months later

                take a look at this temporary site to see how flash can use MySQL in action. everything you see is from the sql, even the images and the songs you can listen to.

                The owner can upload images and mp3-files and assign them to proper pages. Finally he can choose a skin for the site as well.

                The guestbook and the newspage are sort of what you want, if you regard the main menu as a selectiontool you can make many different categories to display any data in.

                ps-the site is in Dutch, if you want to hear anything use a button called 'luister'

                  Write a Reply...