ActionScript 3.0 :: Loading Dynamic Data Using PHP To Flash
Jul 15, 2010
I have a database which looks like this
//---ID--//---Name---//---Price---//---Description---//
//--01--//--Classic---//----22----//---blahblahblah--//
I would wish to parse this data using php to flash. In flash, I have 3 dynamic text field. (classic_food_name, classic_food_price, classic_food_des )
This is my php codes
f ($_POST['sendRequest'] == "get_food_text") {
$sql = mysql_query("SELECT food_name, food_price, food_description FROM food WHERE food_id ='4'");
while($row = mysql_fetch_array($sql)) {
$food_name = $row["food_name"];
$food_price = $row["food_price"];
$food_des = $row["food_description"];
print "food_text=$food_name&food_price=$food_price&food_des=$food_des";
[Code] .....
It only shows my Food Name and nothing else.
View 0 Replies
Similar Posts:
Aug 26, 2011
I have a simple Google Maps API with external data loaded from XML file (location, lat, long, info etc.). I also have a custom marker as a MovieClip (marker_mc), which works fine, but I want to add a Dynamic Text Field (label_txt) to this MovieClip and load a simple data (<label>) to it from same XML file (distribubtion.xml), so as a result every location would have it's own label on the marker.I know how flash loads XML data, but what I don't know is how to include that in Google Maps API (if it's even possible).
Here's the code:
Code:
// Import
import com.google.maps.LatLng;
import com.google.maps.LatLngBounds;
import com.google.maps.Map;
[code]...
View 1 Replies
May 15, 2007
I've created a piece of code that will send some info off to be inserted into a database and then it's recordID will be returned to flash. I'm trying to put the returned id into a dynamic text field but for some reason it's not going. I was wondering if someone could have alook at my code and let me know if I'm doing something wrong. The recordID is being returned to Flash as it's appearing in the trace.
[Code]...
View 2 Replies
Aug 14, 2009
Iam trying to create a user login system. i want to load all the data from an xml file. my problem is that i want to this whole thing with as3 & xml nd it shuld reject with username that does not exist in xml i do not want to use php
View 9 Replies
Aug 24, 2004
I have started working with Flash MX again and I am making a presentation CD.
I have a dynamic text field and a menu with buttons. Some of the buttons tell the dynamic text field to load data from online files, and some load it from offline files (which is obviously quicker).
The problem i have is
-I click Button 1, which loads online data
-I click Button 2, which loads offline data BEFORE the data for button 1 is loaded.
What this does is loads the data from button 2 which is fine. But then it overwrites it with the data from button 1 which was taking longer!
Is there some way i can tell it to stop running actionscript for button 1?
View 3 Replies
Feb 26, 2009
I'm trying to load text from an xml file to populate the labels of a column of buttons loaded with a for loop, but for some reason the text won't load. Here's my code thus far:
Code:
patents_xml = new XML();
patents_xml.ignoreWhite = true;
patents_xml.load("text/patents.xml");
patents_xml.onLoad = loadXML
[code]....
View 3 Replies
Aug 19, 2006
In my AS I load XML data into an array for titles which will be used later in dynamic text fields. I trace this, all of the titles load fine into the array. I use a for loop to attach a movie which has a dynamic text field inside of it. The movie attaches just fine, in a verticle menu just like I want it. The dynamic text field has the right instance name inside of it. I set the text field instance name to the array, but it didn't show anything in the text field. I knew it was there since it was Selectable and the selection cursor pops up whenever I hover over where it should be. So I create a string variable like so to try and go around whatever is messing it up:
[Code]...
View 2 Replies
May 11, 2010
I want to load text into a dynamic text field (called 'about_tab') using a class depending on the language selected (by clicking on a flag icon) by the user.
I managed to get this to work when the ActionScript was written directly in the timeline, but am having problems with doing the same thing via a class.
This is my class file:
*******
package
{
import flash.display.SimpleButton;
import flash.display.MovieClip;
import flash.events.MouseEvent;
[Code].....
When I run it, it returns my trace statements that the class ChangeLang and the function xmlLoaded are running, but no text appears in the dynamic text field (I should/want to see the word 'About'). I get this error message:
1120: Access of undefined property about_tab
View 5 Replies
Oct 20, 2006
i'm trying to load a full html page with layout table cells intact and full function (like an i frame)i can load text and image but i can seem to get the entire page flash just lods it how it wants.does anyone have an idea? Can this be done? i've tried it with a dynamic text field, componets, and i can get falsh to see table / cell layouts at all.[code]is how i load my content. but making several dynamic text fields to load one page of content is working my nerves.URL...
View 2 Replies
Jul 25, 2010
Well this is the problem right here. In my flash movie, I made it so a member from my PunBB Forum can login using their login information from the forum, This is using the LoadVars and it loads the variables into flash and displays the username. In the php script i made it so it will display profile information that user has on the forum, this is where the problem comes in.. I can trace the data perfectly fine in the output panel when you are successfully logged into flash.
I can also display the data in Dynamic text boxes IF they are on the main stage.. I need to be able to load the data of the user inside of a movie clip.. that is loaded when you click "User Profile" on the menu, Once the movie is loaded, no data is displayed. Yes i have all the instance names and paths correct, but no matter what i do I cannot load the data into this movie clip. So me thinking it just wouldnt work, I tried making a profile page on a different keyframe in the timeline, That also did not load the data onto another frame.
View 5 Replies
Apr 12, 2011
I am trying to read XML data from a SharePoint site. The issue I am having is that the flash project works just fine when I preview the swf in flash, however when I try to view it in HTML it does not load the XML file.Now the XML file is not a simple document that can live in the same folder as the swf. I have to use a link to a web page. This is the code that I am using (sorry. had to change the web address)
Actionscript Code:
var testXML:XML = new XML();testXML.ignoreWhite = true;testXML.onLoad = function(success) if (!success) { trace("testXML did not load"); } else {
[code].....
View 4 Replies
Sep 29, 2008
in loading an XML List intoFlash CS3.
View 1 Replies
Aug 19, 2011
My XML looks as follows [code]In my folder I have the XML as shown. There are 6 images in the folder and the names are given as urls. I have a combo box on stage. Its name myCB. There is an image holder imgHolder_mc.I have two tasks.Populate the combo box with the imageNames.Based on the imageName selected the image in the image holder must change. The image must be retrieved using the image url.[code]how I can bind this to my combo box and select images according to the selection I made in combo box.
View 1 Replies
Mar 31, 2010
loading a My Sql data base table in to flash
View 2 Replies
Nov 6, 2007
I'm going thru the kirupa example of using loading XML data in flash. I came across this example, most of the logic makes sense to me but I don't understand the syntax
preloadbar_mc.target = my_xml; //my_xml is reference to the loaded XML object.
what does movieclip.target mean? I've search for movieclip.target but could not find any documentation.***For some reason, the forum is stripping out all the newslines in the code I'm pasting below! argghhh preloadbar_mc.onEnterFrame = function(){if (!this.target) return (0);var loaded =target.getBytesLoaded();var total = target.getBytesTotal(); var scale = 0;if (loaded && total){var percent = loaded/total;scale = 100 * percent;} this._xscale = scale;}preloadbar_mc.target = my_xml;
View 1 Replies
Mar 25, 2009
loading XML data into Flash using the tutorials in Kirupa but I got stucked just by doing the load code in ActionScript 3.0.
Below's the code that I use...
Code:
var my_xml = new XML();
my_xml.onLoad = function(success){
if(success){
[Code].....
View 3 Replies
May 23, 2007
I got a music portfolio web site running PHP, MySQL and Flash. There's a page showing all the artists my client worked for and when you click on a song title, this title is passed as a variable to a PHP page then to a Flash page. The Flash page contains an actionscript music player which then looks for the right audio file in the database and plays the song. Everything works great except for the dynamic text field which displays the song title. If the song title contains an apostrophe or a single quote, the Flash dynamic text field then shows the apostrophe.[code]
View 1 Replies
Dec 28, 2009
I have to populate an Advanced Data Grid which have the following fields: Continent->State->Society-->Actual Value-->Estimate Value I want to simulate a financial market so i have to change some of the values by asynchronous request from an HTTPService; If necessary i'll post the .as file, but it is generated automatically by Flex Builder.
Here's the code of the client side Flex/Air application:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
[Code].....
View 2 Replies
May 15, 2010
I'm pretty new to AS3 but have a project with a very tight turnaround here, having been lumbered with it after a guy from work got taken ill. The basic idea is a visualisation of an XML feed, using the data pulled in to control the behaviour of movieclips. So far I have this;
[Code]...
it isnt too hard to see what I'm trying to do. The above code plops 5 movieclips on the stage, their size dictated by the 'tlength' value, and the next step is to get them moving. Ultimately I'd like these MCs to shift out from the centre of the screen and vary in size and distance depending on the data that is applied to them, but running the current code throws this error; TypeError: Error #2007: Parameter listener must be non-null.
View 4 Replies
Dec 28, 2009
I have a flash swf loading data from an xml via jsp from the same domain. The swf is displaying the data perfectly fine from where I am at and for most of my user. However, one of my most important user report to me that the flash isn't displaying the data.
So here lies my question. At first, I thought it was merely an Flash player not up to date problem, but that user said he's using flash player 10 already and he has tested it with all sorts of browser. I have also try connecting to the website from that user's area, and it appears to be fine as well.
Base on the user's feedback, he was able to load the flash, but the xml data just won't appear. Somehow, I believe that it could be an individual computer's problem, but since I am no expert in the networking, and am having some trouble solving this problem,
View 4 Replies
Apr 3, 2008
I want to load an RSS feed into flash so it is selectable if that is possible
View 2 Replies
Jan 19, 2010
i am creating a dynamic data list to show data for upcoming events on my website [URL] inside of the flash user interface I created: [URL] I loaded the XML file into the flash movie frame but the image will not show up Here is the XML file code used:
[Code]...
View 1 Replies
Jun 17, 2007
I have a Flash MP3 player that loads the song list from an XML file. I'm trying to set it up to take the customer to the online store to purchase the currently playing song. The player successfully loads the track name, artist name, and url to the song, but for some reason does not appear to the load the new attribute of buylink that I have just added. Given the code below, my buylink value is returned as undefined.
View 3 Replies
Jan 13, 2009
im trying to do is assign the font colour and text into multiple text fields.
this is the code i have for the xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data[
<!ELEMENT title (comments, image)>
<!ATTLIST title name CDATA #REQUIRED>
[Code].....
View 5 Replies
May 4, 2007
What I am trying to do is bring data in from (mysql)PHP into flash 8 (actionscript 2.0). I got part of this to work. I bring in the text and diplays just fine. So the next step was, To set the font size from anothere php loadvars (code below). Flash will not pick up that part of the code, were I set the font size.
Here is the code:
onClipEvent (load) {
info4 = new LoadVars()
lv = new LoadVars();
[Code]....
View 9 Replies
Jun 26, 2010
I am wanting to load a list of names from mysql into a textfield in flash. I also want to load just one image from an image path in mysql. How can this be done easily?EX. SELECT name FROM table WHEREEX. SELECT imagepath FROM images WHERE id=`1
View 1 Replies
Jun 26, 2010
I am wanting to load a list of names from mysql into a textfield in flash. I also want to load just one image from an image path in mysql. How can this be done easily?
EX. SELECT name FROM table WHERE
EX. SELECT imagepath FROM images WHERE id=`1`
View 5 Replies
Jul 5, 2002
it took me so long to write this tutorial Well, here I go... Section 1: Introduction So you want dynamic content on your Flash movie. Sounds simple, right? Well let me tell it is, and well, it isn't. This tutorial assumes a basic knowledge of Actionscript, PHP and MySQL. If you have that, it's time to move on. Otherwise, I recommend you do some reading on the subjects... Section 2: Setting up your SWF to receive external data Loading external data into an SWF is a fairly simple task. Although the external text file method is probably the most widely known, it is by far the clumsiest way to get data into your SWF. Of course, this may be your only option of your server doesn't support MySQL/PHP! But for those of us who are fortunate to have these privileges, let me show you how Flash can get external data without having to create additional text files.
Dynamic text fields In order for Flash to get data from an external source, you need to make use of dynamic text fields. Simply place a blank dynamic text field on the stage and make sure you give it a variable name (NB: dynamic text fields have both an instance AND a variable names. In this case we want to focus on the variable name). Note the name you give to the field's variable name, as we'll need it when we write our PHP script. Once you have a text field setup, convert it to a movie clip symbol. Attach the following code to the resulting movie clip:
[Code]...
View 8 Replies
Aug 20, 2010
I am doing a project that consists of AS3 in flash an importing an external xml data that will populate dynamic data in text fields in my flash project. The xml is all ready set up (pre existing) data. The structure of the XML Code looks like this:
<GlobalDynamicData xmlns:xsi"[URL]">
<schema version 1.0.0>version 1</schemaversion>
<DynamicDataFields>
<DynamicDataField>
<DataField> AlertOn</DataField>
<DataValue>0</DataValue
[Code] .....
which works fine,
My question to everyone is How do tell flash to pull specific dynamic data if all the datafields are exactly the same... I would think all data fields that are named have to be diffrent so when you script the code you are telling flash to go to that data source and pull from that record. If you have the same naming convention how does flash know which one to pull from if they all have the same name..
View 3 Replies
Jul 26, 2010
after i upload some images and one mp3 files on my site it will make a slideshow (.avi file)! but nothing fancy, only a simple slideshow!
i want to make a stereotyped in flash to load images and mp3 file and make a nice slideshow with some effects!
the problem is... how i can save the swf file? (later to convert .swf file to .avi or .mpg)
View 1 Replies