ActionScript 3.0 :: Using URLLoader For MySQL Queries?

Jul 22, 2011

The basics of my problem is I need to have actionscript query a MySQL server. I figured the best way to do this was create a Database class that will hold several static methods for the various queries. I created the PHP program necessary to run the queries, and the MySQL database (no problem there). I also figured out the basics of URLLoader to get the info back from the PHP. Now lastly, I am trying to figure out the best way to make the data usable.

Essentially the flow I wanted was the static method in the Database class would return the result of the query (e.g. return user's name) so in the main class I would just write something like firstName=Database.getFirstname(idNumber);. However, I quickly learned this may be impossible since the loader obviously takes some time to load everything and storing and manipulating the data is best done through a Event.COMPLETE event. Is there a way to have a function pause and not run subsequent lines until an event occurs? The ideal function would look like this I guess

Code:
private static variable url:String = "phpFilesUrl.com"
public static function getFirstName(id:String):String

[code].....

View 3 Replies


Similar Posts:


Php :: Zend Class Variable Retention For Mysql Queries

Jan 9, 2010

I have a flash application which uses a single php file to retrieve records from a database (using the Zend framework). When the application first begins, I make a call to the php to set a class variable, so that all future requests to the database will use this variable to select records based on its value. So here is how the class begins: class MyClass

[Code]...

So my question is, how can I get a PHP class variable to persist so that I can set it once, and I can access it anytime during the life of an application?

View 1 Replies

Actionscript 3.0 :: URLLoader Encoding With PHP & MySQL

May 30, 2010

I'm stuck with a stupid problem of encoding. My problem is that all my accentuated characters are displayed as weird iso characters.

[Code]....

View 1 Replies

ActionScript 3.0 :: Make DNS Queries With It?

Aug 10, 2009

Are you able to make DNS queries with AS3? If not has someone developed a library to do so?

View 0 Replies

ActionScript 2.0 :: Shared Objects And Secure DB Queries

Aug 4, 2009

I'm working with a friend with some changes to their complex flash site after their previous developer jumped ship on them. In the process of making some edits I noticed that the previous developer had exposed all of their data to the world. Any slightly tech-savy user could pretty much read all the table data in their database by visiting a php page.

So here's the scenario I'm trying to solve.
- The flash site uses Shared Objects to save users access privileges when they log in successfully.
- There are frequent calls to the database to display information (whether logged in or not). The site calls a php page.. lets say... query.php?table="tablename" and returns all tables data... (what a mess). Only specific columns are needed to be returned to the user (whether they are logged in or NOT logged in). there is no check to see if the user is logged in or not when this page is called. so anyone can call a page and get this data.
- Only the ADMIN should get returned the full table set as they are the ones that need to see all the data in flash. however the same php query is called for the admin and for the regular user and any non-logged in user.

So. I guess I can limit the data set returned for the average logged in or not logged in user so the more sensitive data isn't shared. But how can I authenticate the logged in admin to share the full table data?

View 0 Replies

Asp.net :: Text-boxes For Performing Queries To MSSQL Databases?

Jan 6, 2011

could you please point me out good Flash and ASP.NET integration tutorials out there? For example reading values from FLASH text-boxes for performing queries to MSSQL databases, and writing back values to flash.

View 1 Replies

Mysql :: Migrate A Preexisting Flex/Java/Hibernate/MySQL App Onto A CD For Portable Distro?

Feb 2, 2011

I have a typical Flex-based application that was written to use a Java/Hibernate/MySQL backend. The client changed the requirements - now they want to distribute it on a CD where the user can just run the app without any installation or a network connection.

To do this, I certainly need to eliminate the web server and the database server and adapt my application (with as few changes as possible, of course) to a stand-alone application that will fit on a CD/DVD. I've managed to export the data to XML and read it into Flex, but I'm wondering if there's a way to recreate the Hibernate data structures in Flex so I could change as little code as possible. Failing that, is there any way to keep the existing Java/Hibernate external to the Flex code but retrievable without installing Apache Tomcat or MySQL?

View 3 Replies

Mysql :: Create An Insert Form With TextInput Containing ComboBox Provided By MySQL Database Table?

Jan 13, 2010

I have a Flex application which manage a database composed by 7 tables.I have created the insert form and all work great. Now I wanto to improve the Form performances; the idea is to replace the TextInput of the Form with ComboBoxes which are provided by the DataBase tables

View 1 Replies

Configure MySQL JDBC Driver Mysql-connector-java-5.1.12?

May 25, 2010

I have downloaded MySQL JDBC driver from [URL]... How do I configure it?

View 1 Replies

Data Integration :: Sends Queries To A Database And Receives XML Formatted?

Sep 16, 2008

I have a project that sends queries to a database and receives XML formatted data:

Markets_xml = new XML();
Markets_xml.onLoad = readMarketsXML;
Markets_xml.load("
http://208.62.199.74/ws_ckp_data/Service.asmx/GetMarkets?MarketName=Al l&MarketTypes=Industrial");
Markets_xml.ignoreWhite = true;

This works fine when I test the movie from Flash (on my local machine) and if I type the query string directly into my browser, I get the correctly formatted information. The problem arises when I post the swf to my server and test. From my server, I get nothing The swf files and the data are on different servers. Is this the problem? What is a good quick solution.

View 1 Replies

ActionScript 3.0 :: Calling Random Functions And General Game Queries?

Jul 24, 2011

I am currently making a game with Flash CS5 and AS3... namely Tetris I have created my main menu and the objects and so on and have a few questions
 
1) How do I quit the game should a player press the quit button?

2) How do I get a button (Z and X) to rotate an object whilst the object is moving downwards (it is moving downwards using the timer function)?

3) How do I get the object to stop once it reaches the bottom of the screen? (im thinking something along the line of the hit detect but havent had much luck)

4) Any ideas on how to get flash to detect if a line is complete and therefore delete it? (it needs to segment blocks off the graphic)

5) My final and most important question (the bit im working on at the minute) how do i get flash to call random functions so that random tetrominoes appear on screen so that the game is different everytime and the blocks are random as the player plays)

View 2 Replies

ActionScript 2.0 :: Making A Tycoon Game And Have A Few Queries To Do With Controlling Sound?

Oct 17, 2009

I'm making a tycoon game and have a few queries to do with controlling sound. I have two buttons, one is my play button playBTN and my other is my stop button stopBTN. Now i want to play the song mainSong using actionscript from the second frame, but I also want to play the song without it going over the top after you release playBTN.

P.S: I'm sure the stopBTN code is:
ActionScript Code:
on(release){

[code]......

View 5 Replies

ActionScript 2.0 :: Include A Variable From PHP Which Queries A Database With A Dynamic File?

Jul 26, 2007

I am trying to include a Variable from PHP which queries a database with a dynamic file..Obviously I have marked out passwords with "*"Here is My Php file to display the variables I need

[Code]...

What I need to do is have the flash file pull in videoid which is a string on a dynamic link from the page where the player resides. VideoID is dynamically created in the Mysql Database..how to get this dynamically into the flash file?

View 2 Replies

Mysql :: Accent MySQL-Flex/ZendFramework?

Oct 22, 2011

In my table the Collation is:latin1_swedish_ci (but i tried UTF8_unicode too).In my flex application when it shows the table,it displays it correct,with all accent and pointing correct,but in the table is like :

View 1 Replies

ActionScript 3.0 :: Program That Queries A Database For Options And Displays The Options In A Number Of ComboBoxes?

Aug 29, 2011

Im building a program that queries a database for options and displays the options in a number of comboBoxes. The comboBoxes are dynamically built and loaded via code and added to the stage. I would like to build the comboBoxes into a single movie clip (maybe not the correct wording) so I can use options like tweening and such to make it look better. The code is below.

package classFiles
{
import flash.display.MovieClip;

[code]....

View 3 Replies

Flex :: Get Url From URLLoader?

Jul 31, 2009

Is there a easy / good way of getting the url from the URLLoader object? It seems at least two other people (this guy and this this guy) have wondered the same thing. Maybe we can get an answer here on s.o.?

View 2 Replies

ActionScript 3.0 :: Stopping A URLloader?

Mar 26, 2010

I'm building a portfolio website and I'm using URLloaders to load new content.I want the user to be able to change the content they're loading before it completes. aka, stop the current load and load something else.
 
Adobe Actionscript 3.0 reference says I can use the following:"Use the unload() method to remove movies or images loaded  with this       method, or to cancel a load operation that is in progress."
 
Here's what I have (my attempt to stop the loader is in bold):
 
button_btn.addEventListener(MouseEvent.CLICK, newPage);
function newPage(e:MouseEvent):void {    loaderState=true;    newDescription();
if (loading){

[code]....

I'm getting the following error on loader.unload(req);  :  "1137: Incorrect number of arguments. Expected no more than 0."I've also tried just using loader.unload(); but it doesn't work - the url loader just continues to load and doesn't load the new content.

View 5 Replies

ActionScript 3.0 :: URLLoader POST Actually Does A GET

Apr 13, 2011

I'm trying to do a real simple POST HTTP request using URLLoader. I'm following the next steps:

[Code]...

But, actually It does a GET request instead of a POST request. Is it possible to do a POST request without anything in the body of the request??

View 2 Replies

Flash :: Multiple URLLoader?

Jun 3, 2010

I am loading multiple xml files with URLLoader.

for (var i=0;i<xmlCount;i++) {
loadXML(xmlFiles[i], i);
}

[code].....

View 1 Replies

Actionscript 3 :: More Concise Way To Use A URLLoader?

Apr 21, 2011

I'm want to use a URLLoader in one line, but I know Internet Explorer has given me problems loading local files when the listener is added after the load call.

new URLLoader(new URLRequest('http://example.com')).addEventListener(
Event.COMPLETE, handleLoadedData
);

[code].....

View 2 Replies

ActionScript 3.0 :: URLLoader In IE With Https And SSL

Jul 8, 2009

Everything runs fine in Firefox, but when the SWF tries to make a request in IE, I get an IOError. I've read that it might have something to do with no-cache settings and that a possible solution is to use URLRequestHeaders.

View 0 Replies

ActionScript 3.0 :: Add Name Property To URLLoader?

Nov 4, 2009

I'm trying to add a name property to the xmlLoader object just as I have successfully done with the photoLoader object. When the last line of code is present the following error is thrown:

1119: Access of possibly undefined property name through a reference with static type flash.net:URLLoader.

I suppose this has something to do with the URLLoader not inheriting from Display Object like Loader does. Is there anything I could do to add a name property to this URLLoader?[code]...

View 4 Replies

ActionScript 3.0 :: URLLoader And PHP Not Functioning?

Mar 11, 2009

I am having an issue in getting flash to call my PHP script and then get the variables back into flash once the PHP script has queried a mysql database. I have tried to chop things in the php script down to their bare essentials. I am new to AS3 so I am having some trouble integrating the two. I know that my DB info and querying works so it must be something with passing data between flash and PHP.

import caurina.transitions.*;
import fl.controls.DataGrid;
import fl.controls.ScrollPolicy;[code]........

View 1 Replies

ActionScript 3.0 :: How To Unload An URLLoader

Jun 15, 2009

Anyone have any suggestions about unloading an URLLoader. I'm loading xml data and trying to load different data on button click, but it just keeps piling up, I'd like it to replace the old data.

View 7 Replies

ActionScript 3.0 :: Variables With URLLoader?

Jul 21, 2009

Recently i got job that finaly includes some AS3, so im getting back into the world of flash again. But as you all can imagen, not without problems... let me explain what i'm trying to get working:

A little background:We are currently recreating a game within flash, the game requires a login to create a sessionid (server side) to retrieve gamedata based on that sessionid. The login page for this, is done with a certain framework (cake), wich we are not going to change, because the existing game is already in production phase.

The problem:The original form sends the username and password with nested variables like this:

<input id="LoginUsername" type="text" value="" maxlength="40" name="data[Login][username]"/>
<input type="password" id="LoginPassword" value="" name="data[Login][password]"/>

AS3Trying to replicate the request in as3 like this:

[AS]
public function login(username:String, password:String):void{
var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest(this.baseUrl + this.loginPath);

[code].....

View 9 Replies

ActionScript 3.0 :: URLLoader And Just Loader?

Aug 5, 2009

Whats the difference between a URLLoader and just a loader?

and when would you use each one? Just been watching a video tutorial and the guy loaded some XML using the URLLoader but I've seen just the Loader being used for other items such as jpg's.

View 1 Replies

ActionScript 3.0 :: URLLoader Only Firing At 100%??

Feb 14, 2010

I am having a problem with my ProgressEvent.PROGRESS handler. It looks like this:

Code:
function handleProgress( event:ProgressEvent ):void {
var percent:Number = Math.round( event.bytesLoaded / event.bytesTotal * 100 );
trace("Uploading %" + percent);
}

It just traces "Uploading %100" every time

I am using a big file so I know its taking several seconds between calling URLLoader.load and complete. There just doesn't seem to be a report in between 0-100..

View 12 Replies

IDE :: Loading Sound With URLLoader?

Feb 21, 2010

I am loading a sound file with the URLLoader class passed to the URLRequest class, just as one would load any other external content type.

Code:
var loader:URLLoader=new URLLoader;
loader.load(new URLRequest("file.mp3"));

When the loading is complete I would like to pass the data to a Sound Object.

Code:
var mySound:Sound=e.currentTarget.data

The object returned on the complete event is of type flash.net::URLLoader.

Code:
e.currentTarget

How can I turn this URLLoader into a Sound Object?

View 5 Replies

ActionScript 3.0 :: Load An .xml File Using A URLLoader

May 23, 2011

I have encountered an interesting problem when I try to load an .xml file using a URLLoader (within my own custom class). I have several configuration .xml files which I use to configure the application when it launches. For example, in the code below, myCustomLoader is a custom class I wrote that takes an .xml file as a parameter. The myCustomLoader class encapsulates all the instantiation of the URLLoader class and error handling etc. The code below operates as expected, the configuration files load into memory, and they're accessible throughout my App.


[Code]...

View 7 Replies

ActionScript 3.0 :: URLLoader - Receiving PDFs From PHP

Oct 9, 2008

I want to instruct a server-side PHP script to generate a dynamic PDF using variables I submit from Flash. I then want to download that PDF back into my Flash application. Can I use "Loader" or "URLLoader" ? If so, how do I structure my code to render the PDF within Flash when it comes back from PHP? ...or do I have to use Flash Remoting or other means to achieve my goal?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved