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
Similar Posts:
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
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
Aug 12, 2009
I have a game file...i know the log in file is communicating with the database and working...I can not get the new user login to work. It is basically the same file set up with the extra query added The site is [URL]
I will post codes for both actionscript for login
Code:
stop();
// Create two LoadVars objects to send and recieve data
var sender:LoadVars = new LoadVars();
[Code].....
View 0 Replies
Aug 18, 2009
I've created a quiz with following variables: name phone email score.
The first three varibles are submitted by form and sent to db(these are 3 text fields).
A end of test I need to send the score (score is a dynamic text field which kept score throughtout quiz) to mysql db.The variable for score is also called "score"
Can this be done using loadVArs? should I be using "score.text" to ref score variable?
View 1 Replies
Jan 6, 2010
I am trying to send a php variable with one field from mysql. When I print the php variable on my php page it outputs the field, but when I try to send it to flash it doesn't output anything.Here is my php script that tries to send a mysql field to flash and there nothing is shown. It works on my php page, it outputs the mysql field.
$product=$result['product'];
$pro=$product;
$pro = "&pro=".$pro."&"; //~ make it a flashable variable
[code].....
View 2 Replies
Feb 17, 2012
I wrote a little test program to learn about mySQL integration in Flash. The program looks as: I have one button and one dynamic text field. If I hit the button, as3 starts an URLRequest to a php file which then connects to a mySQL database. The requested variable is send to as3 and displayed in the text field. Up to this point, everything is working fine. But when I hit the button again, after I updated my db, the text field still shows the old value. Although it should output the current value.
So, here's my as3 code:
mButton.addEventListener(MouseEvent.CLICK, onSQL);
function onSQL(e:MouseEvent):void {
var varSend:URLRequest = new URLRequest("[URL]");
varSend.method = URLRequestMethod.POST;
var varLoader:URLLoader = new URLLoader;
[Code] .....
I really don't know, why the program is not updating the value.
View 3 Replies
Dec 7, 2009
I've decide racing car game! and I want to be able to send the score to send to a mail box or send it to a table in php or database! at the moment I can send the Score Variable to be display in PHP but its not the way that I want!
Script that send the Score to php
submit.onPress = function () {
getURL ("getVars.php", "_blank", "POST");
[code]....
View 2 Replies
May 23, 2005
I am using a form I made in flash to send variables to a MySql Database.
Code for form:
trace(email1.text+", "+question1.text+", "+check1.selected);
status1.text
send1.onPress = function () {
status1.text = "sending..";
var ld:LoadVars = new LoadVars ();
[Code] .....
View 9 Replies
Aug 2, 2009
Currently I'm setting up a webservice, which includes a login to access the member area.I'm testing all components seperately, and I've ran into a problem. When the user logs in I want flash to retrieve the user_id as a variable, so that I can use this user_id for member related database access. However, I'm having problems with retrieving the user_id.The login is done by inputting the email and password of the user. If these variables match the data in the database the user is send to the member area. I want to get the user_id by posting the email variable to a php file. In the php file the following code is responsible for this:
PHP Code:
$email = mysql_real_escape_string($_POST["email"]);
View 2 Replies
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
Nov 2, 2006
is possible to connect to a mySQL database directly through the socket class?
View 1 Replies
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
Jan 14, 2011
I've got my flex, php & zend project working fine on localhost but when I try to move it to production I get the following error: Class "testService" does not exist: Plugin by name 'testService' was not found in the registry; used paths: : /home/myNewFolder/services/
[Code]....
View 2 Replies
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
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
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
May 25, 2010
I have downloaded MySQL JDBC driver from [URL]... How do I configure it?
View 1 Replies
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
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
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
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
Oct 12, 2010
i have a movie clip which is exported for ActionScript , i want to get a variable from the document class into the movie clip class i tried this but there was an error !!
ActionScript Code:
var main:Main=new Main();
main.txtScore.text="hello";
View 1 Replies
Feb 19, 2010
I realize this is kind of an odd issue, but I am wondering if there's any way to get Flash to allow me to access a class's static functions using a class variable that points to the class. Example:I create a class called FooClass that has a static function named fooI then create a variable of type Class that points to it
Code:
var class:Class = Class(getDefinitionByName("FooClass"));
However, when I try to call foo() using the variable, it errors saying the function
[code].....
View 6 Replies
Dec 28, 2009
I'm trying to create a class which will create a tween for several different instances of an object. I am creating the instances in the Document Class. The trick is, I would like to specify how long each tween will take.
Here's what I have so far:
DOCUMENT CLASS
ActionScript Code:
package {
import flash.display.MovieClip;
import mcCloud;
[Code].....
As you can see, I have a variable "myTime" which syncs the timer and the tween. This causes to tween to repeat and the clouds to continually scroll across the stage. How can I determine the var myTime at the time I create each instance of the Movie Clip mcCloud?
View 6 Replies
Aug 31, 2011
When I declare a class variable
private var myVar:MyClass = new MyClass();
It creates a new instance of that class that will trace as [Object MyClass].
However, as soon as I assign it to something
myVar = thisOtherVar;
It will now trace as [Object thisOtherVar].
I need to get it back to where it's just an "empty" blank class instance, if that makes any sense at all.
View 14 Replies
Mar 14, 2011
I've only been programming in as3 for a couple months, and so far I've written several compositional classes that take MovieClips as inputs to handle behaviors and interactions in a simple game I'm creating. One problem I keep coming upon is that I'd love to access the custom variables I define within one class from another class. In the game I'm creating, Main.as is my document class, from which I invoke a class called 'Level1.as' which invokes all the other classes I've written.Below I've pasted my class 'DieLikeThePhishes'. For example, I would love to know the syntax for accessing the boolean variable 'phish1BeenHit' (line 31) from another class. I've tried the dot syntax you would use to access a MovieClip inside another MovieClip and it doesn't seem to be working for me.[code]
View 1 Replies
Mar 14, 2011
I've only been programming in as3 for a couple months, and so far I've written several compositional classes that take MovieClips as inputs to handle behaviors and interactions in a simple game I'm creating. One problem I keep coming upon is that I'd love to access the custom variables I define within one class from another class. In the game I'm creating, Main.as is my document class, from which I invoke a class called 'Level1.as' which invokes all the other classes I've written.Below I've pasted my class 'DieLikeThePhishes'. For example, I would love to know the syntax for accessing the boolean variable 'phish1BeenHit' (line 31) from another class. I've tried the dot syntax you would use to access a MovieClip inside another MovieClip and it doesn't seem to be working for me
package jab.enemy
{
import flash.display.MovieClip;
[code].....
View 1 Replies
Mar 11, 2011
I need to increment an integer variable in a function within the document class upon transpiring event in another class. I can't seem to figure out how to call the function and reference the variable.
View 2 Replies
Apr 25, 2011
How do I listen from the main class to a sub class for a variable change?
package {
import flash.events.*
public class DataBase extends MovieClip {
[Code].....
This is what I have so far for the sub class but I can't seem to figure out how to listen to this variable change from Main() or even if I am dispatching the event properly.
View 2 Replies