displaying mysql info via php in flash

Ask a Question related to Macromedia Flash Data Integration, Design and Development.

  1. #1

    Default displaying mysql info via php in flash

    I have a movie sample that I downloaded because I dupoicated the same movie how
    I wanted it to look. However when I was done it didn't work. To check if it
    was me, I downloaded the exact sample and changed the database info, then
    uploaded the page and it still didn't work. I made a move that will get some
    variables from a php page, which tapped into a database for the info, and
    display the data in a text field. The data doesn't display. Here is the flash
    page:
    isle10.com/unit.html.

    Here is the same php page:
    isle10.com/test.php.

    Can anyone help me?

    Code for php:
    <?php
    mysql_connect("dbname","dbuname","pwd");
    mysql_select_db("whatdb");
    $qr = mysql_query("SELECT * FROM unit");
    $nrows = mysql_num_rows($qr);
    for ($i=0; $i < $nrows; $i++) {
    $row = mysql_fetch_array($qr);
    echo $row['lastName'].", ".$row['firstName']."<br>";
    echo " ".$row['phone']." ".$row['email']."<Br>";
    echo " ".$row['picFile'].":
    ".$row['caption']."<Br><Br>";
    }
    ?>


    Now, here is the tutorial site which is here on macromedia:

    [url]http://www.macromedia.com/devnet/mx/flash/articles/flashmx_php.html[/url]

    action script code:

    function showjpg(paramString) {
    // get the individual parameters:
    // params[0] = picture file name
    // params[1] = caption
    var params = paramString.split("#");
    picHolder.loadMovie(params[0]);
    caption.text = unescape(params[1]);
    }
    function showContent() {
    var i;
    content.htmlText = "";
    for (i=0; i < this.n; i++) {
    if (this["picFile"+i] != "") {
    content.htmlText += "<b>" + this["firstName"+i] + " " + this["lastName"+i]
    + "</b>" + "<a href='asfunction:showjpg," + this["picFile"+i] + "#" +
    escape(this["caption"+i]) + "'>&nbsp;&nbsp;(<font
    color='#0000cc'>pic</font>)</a><br>";
    } else {
    content.htmlText += "<b>" + this["firstName"+i] + " " + this["lastName"+i]
    + "</b><br>";
    }
    content.htmlText += "&nbsp;&nbsp;" + this["phone"+i] + "<br>";
    content.htmlText += "&nbsp;&nbsp;<a href='mailto:" + this["email"+i] + "'>"
    + this["email"+i] + "</a><br><br>";
    }
    }

    // Create new load vars object c for data transfer
    var c = new LoadVars();
    c.onLoad = showContent;

    // define content and actions for each tab
    for (var i=65; i<=67; i++) {
    this["tab"+chr(i)].letter.text = chr(i);
    // when this tab is clicked
    this["tab"+chr(i)].onRelease = function() {
    // can't use chr(i) here -- must use mc name
    c.thisLetter = this._name.substr(3,1);
    bigLetter.text = c.thisLetter;
    content.htmlText = "Loading data for " + c.thisLetter;
    // scope of this function is main timeline so can refer to c directly
    c.sendAndLoad("power.php",c,"POST");
    }
    }

    stop();

    The php page works just fine without flash, but the flash will not display it.
    Can anyone point me in the right direction. I'm using Flash MX. Thanks.

    Josh.

    isle10 Guest

  2. Similar Questions and Discussions

    1. Help with a popup window displaying info from a recordset
      Hi I am working on a Shopping cart web site I have set up my database and I have created my page to display items from the database. The fields in...
    2. Sending form info to mysql
      Could anyone advise me of a suitable tutorial to send information, via a form, to mysqldatase. Ideally, im looking for a tut that also encompasses...
    3. Displaying Images from the Mysql Database
      Hi! everyone, i need help with displaying the images from the database. I successfully inserted an image to mysql database by converting it to...
    4. displaying info from database that was entered in aprevious page
      HI All. im using DWMX vbScript + Access i have just made a very simle user registeration form - basic name, add, payment deatails etc using text...
    5. Displaying images from a MySQL Database
      Hi I'm have difficulty displaying images that are stored in a MySQL database. I've tried using the odbc.net provider, the ByteFX provider and the...
  3. #2

    Default Re: displaying mysql info via php in flash


    // When you use this syntax to invoke the onLoad function:
    c.onLoad = showContent;

    // You'll need to use this syntax to define the function:
    showContent = function() {
    // function body
    }
    JamesDad Guest

  4. #3

    Default Re: displaying mysql info via php in flash

    I already created a function for that:

    function showContent() {
    var i;
    content.htmlText = "";
    for (i=0; i < this.n; i++) {
    if (this["picFile"+i] != "") {
    content.htmlText += "<b>" + this["firstName"+i] + " " + this["lastName"+i]
    + "</b>" + "<a href='asfunction:showjpg," + this["picFile"+i] + "#" +
    escape(this["caption"+i]) + "'>&nbsp;&nbsp;(<font
    color='#0000cc'>pic</font>)</a><br>";
    } else {
    content.htmlText += "<b>" + this["firstName"+i] + " " + this["lastName"+i]
    + "</b><br>";
    }
    content.htmlText += "&nbsp;&nbsp;" + this["phone"+i] + "<br>";
    content.htmlText += "&nbsp;&nbsp;<a href='mailto:" + this["email"+i] + "'>"
    + this["email"+i] + "</a><br><br>";
    }
    }

    I also tried the one you showed, still didn't work.



    isle10 Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139