473,320 Members | 2,080 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

flash/actionscript load from php

Hello I have a problem: I have a database(mysql) with the following fields:
test, descr, title
I want to display them into a flash file.
Now my php file called list.php (which collect the information from my database) is the following:

<?php
include_once '../library/config.php';
include_once '../library/opendb.php';
$query =mysql_query("SELECT * FROM `$table` ORDER BY(`title`DESC ");

$cant=0 ;
while($row=mysql_fetch_array($query)){
echo "$cant=$row[title]&$cant=$row[descr]&$cant=$row[test]";
$cant++;
}
echo "cant=$cant";
?>

My flash file has 3 input dynamic text (to display the database)called titletx, descrtx, testx.
and I put an actionscript code to call the php file into my flash file here it is:

myData = new LoadVars()

myData.load("www.ilgerss.it/mazzi/list.php")
myData.onLoad = function(succes){
if(succes){
for(var i=0; i<this.cant; i++){
titletx.text = this.title
descrtx.text = this.descr
testx.text = this.test
}
}
else
trace("Error loading data")
}

everything is in one fotogramma: the input dynamic text and the actionscript code.

Can anyone be so kind to tell me why this code do not work? or have any suggestion?
Thanks
Pa.
Jan 29 '07 #1
3 8593
BigMrv
1
I have the same darn problem...... You by chance haven't figured it out have you? I can get mine to load the actual text within the PHP but not the results of the execution..
May 3 '07 #2
Motoma
3,237 Expert 2GB
Try putting some trace functions in to see what you are actually getting when you load list.php.
May 9 '07 #3
ronnil
134 Expert 100+
You cannot reference arrays inside strings in php, this will produce an fatal error if i recall correctly. You also need to encapsulate the argument in the array with quotes.
Just so there's no confusion, i also always escape variable calls too, making the echo statement look like this:

echo $cant . "=" . $row['title'] . '&' . $cant . "=" . $row['descr'] . "&" . $cant . "=" . $row['test'];

since $cant is an increasing integer your string would now look something like this:

0=rowtitle&0=rowdescr&0=rowtest

I'm pretty sure AS treats this string just like PHP would treat a querystring, meaning yoo actually only have one variable, and you overwrite it constantly

The solution would be to either put some square brackets around them (loading it as an array), like this:

echo $cant . "[]=" . $row['title'] . '&' . $cant . "[]=" . $row['descr'] . "&" . $cant . "[]=" . $row['test'];

or use a prefix:

echo 'title_' . $cant . "=" . $row['title'] . '&descr_' . $cant . "=" . $row['descr'] . "&test_" . $cant . "=" . $row['test'];

Either way, try turning on all error messages on your PHP server and check out the response. If that don't work, that's where you start

Another idea might be to set the mimetype of the php file to text.

And like Motoma said... trace every step of the execution.
Jun 1 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Matt | last post by:
Hello, I am attempting to get a software prototype UI/demo built in Flash to talk with existing C++ (so I can exchange data and commands between the application-software already developed in the...
4
by: vunet.us | last post by:
I would like to create web charts. My site is using AJAX, so I thought of VML and SVG for chart graphics. But there is a browser compatibility issue. Flash would be a good solution but I do not...
13
iam_clint
by: iam_clint | last post by:
Starting a thread for flash tutorials and such.. got a good link? pm me. http://www.kirupa.com http://www.actionscript.org/resourc...ries/Tutorials/ http://www.gotoandlearn.com ...
5
by: ASP.NET explorer | last post by:
I have been asked to create some simple animation using Adobe Flash player in ASP.NET(C#) web application. While I am fairly well versed with ASP.NET C#, I absolutely have NO IDEA about how to...
1
by: jfalberg | last post by:
I was recently given a request to simply change a phone number for a website at http://www.axis-group.net since the original developer was unreachable for the past year or so. thinking this was only...
2
elamberdor
by: elamberdor | last post by:
Hi All! Well, i'm modifying a dynamic map, with lat and long datapoints, my problem is it loads in text perfectly onto exact points I specify on the map, ..well now I want to load in...
0
by: jiwas78 | last post by:
Hey there. I am learning XML and Actionscript. I have a problem with getting my XML data to load when my SWF is in an HTML page in a browser. When I open the SWF on it's own whether in Flash Player...
0
by: jiwas78 | last post by:
Hey there. I am learning XML and Actionscript. I have a problem with getting my XML data to load when my SWF is in an HTML page in a browser. When I open the SWF on it's own whether in Flash Player...
1
by: npm | last post by:
Hi, I've got a list of radio stations that load from an XML file into dynamic textboxes. The text loads fine, but some of them have links that are supposed to show up, but they don't. Flash ends up...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.