473,693 Members | 2,654 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

flash/actionscript load from php

5 New Member
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("S ELECT * FROM `$table` ORDER BY(`title`DESC ");

$cant=0 ;
while($row=mysq l_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("ww w.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 8624
BigMrv
1 New Member
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 Recognized Expert Specialist
Try putting some trace functions in to see what you are actually getting when you load list.php.
May 9 '07 #3
ronnil
134 Recognized Expert New Member
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=ro wdescr&0=rowtes t

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
1958
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 C++ source with its prototype UI/demo to be built in Flash). Can anyone provide examples or guidance for such an effort? More details:
4
2590
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 know ActionScript (only basic animation). Any other ideas or links or feedbacking the 3 above technologies are so welcome... Thank you.
13
16088
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 http://www.flashkit.com http://www.senocular.com http://www.echoecho.com/flash.htm http://www.tutorialized.com/tutorials/Flash/1 http://www.video-animation.com/flash8_001.shtml
5
5943
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 say "Hello World" in a Flash enabled web page rendered via ASP.NET. Can any one let me get started? ---
1
1487
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 a simple request, I was able to at least obtain ftp access, but to make a long story short, the text that needed to be changed was actually a text component in a flash file where you would hover over "introduction", then click onto "Contact Us" and...
2
3733
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 icons(images) instead of text. (yes i'm being difficult) and i'd like the text to load into a static placeholder symbol instead. Problem is, I can get images to load in a separate file, text to load in a separate file, and text to appear in a static...
0
2352
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 or browser, my playlist of songs comes up. But in the HTML page it's a no go. Here is what my XML looks like: <?xml version="1.0" ?> <playlist> <song title="Alliance" artist="Jack Hammer & B Mac" src="../content/music/Alliance.mp3" /> <song...
0
2236
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 or browser, my playlist of songs comes up. But in the HTML page it's a no go. Here is what my XML looks like: <?xml version="1.0" ?> <playlist> <song title="Alliance" artist="Jack Hammer & B Mac" src="../content/music/Alliance.mp3" /> <song...
1
3452
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 displaying the entire URL as well as the text...everything I have in between the CDATA tags. Here's the actionscript I'm using: function loadXML(loader) { stations = loader.firstChild.childNodes; for (var i=0; i<stations.length; i++) {...
0
8616
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8552
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9107
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8816
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8812
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7647
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4332
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2992
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.