Flash Tag Board Running PHP And MySql Database
is there any ful tutorial how can i make a simple custom flash tagboard using php and mysql?
any links?
thanks..
ActionScript.org Forums > Flash General Questions > Flash 8 General Questions
Posted on: 05-23-2006, 01:56 PM
View Complete Forum Thread with Replies
Sponsored Links:
Flash, Php & Mysql Highscore Board
Hi group,
I grabbed this tutorial about creating highscore board with flash, php and mysql and have a problem in limiting the entries up to the 10 highest score. I tried to contacted the author of the tutorial but I guess the email wasn't working. I have this script working just fine, but it keeps adding entries. Attached is the tutorial. I'm not sure which one should I configure, the fla or the php file. So please help.
Here is the php file:
<?
if ($command=="init"){
$link = @mysql_connect("localhost", "YOURUSERNAME", "YOURUSERPASSWORD");
if (!$link){
print "&players=Error connecting to database";
exit;
}
if (!@mysql_select_db("YOURDATABASENAME")){
print "&players=Couldn't select database";
exit;
}
$players = "";
$scores = "";
$innerquery = "SELECT * FROM highscores ORDER BY scores DESC";
$innerresult = @mysql_query($innerquery);
$numPlayers=mysql_num_rows($innerresult);
for($loop=0;$loop<$numPlayers; $loop++) {
$newPlayer = mysql_result($innerresult,$loop,"players");
$newScore = mysql_result($innerresult,$loop,"scores");
$players = "$players<br>$newPlayer";
$scores = "$scores<br>$newScore";
}
printf("&players=%s", $players);
printf("&scores=%s", $scores);
mysql_close($link);
}
if ($command=="update"){
$link = @mysql_connect("localhost", "YOURUSERNAME", "YOURUSERPASSWORD");
if (!$link){
print "&players=Error connecting to database";
exit;
}
if (!@mysql_select_db("YOURDATABASENAME")){
print "&players=Couldn't select database";
exit;
}
$players = "";
$scores = "";
$query = "SELECT scores FROM highscores where players = '$name'";
$result = @mysql_query($query);
if(@mysql_num_rows($result)>0){
$oldScore = mysql_result($result,"scores");
if($score>$oldScore){
$query = "UPDATE highscores SET scores = '$score' where players = '$name'";
$result = @mysql_query($query);
}
else{
exit;
}
}
else {
$query ="INSERT INTO highscores (players, scores) VALUES ('$name', '$score')";
$result = @mysql_query($query);
}
$innerquery = "SELECT * FROM highscores ORDER BY scores DESC";
$innerresult = @mysql_query($innerquery);
$numPlayers=mysql_num_rows($innerresult);
for($loop=0;$loop<$numPlayers; $loop++) {
$newPlayer = mysql_result($innerresult,$loop,"players");
$newScore = mysql_result($innerresult,$loop,"scores");
$players = "$players<br>$newPlayer";
$scores = "$scores<br>$newScore";
}
printf("&players=%s", $players);
printf("&scores=%s", $scores);
mysql_close($link);
}
?>
View Replies !
View Related
Problems Connecting To Database For Flash Message Board
hi guys, a little help if you please, database work is most definitely NOT my strongpoint. anyhow i'm trying to set up this board on a new site that has to use a database folder outside the main content folders to hold an access database named 'example.mdb' the code states that we're creating a 'dsn-less' connection... but i think i need to create a dsn connection, maybe you can see if there's some obvious problems with the code below? ... i am 2 folders deep in the main directory so i don't think actually getting to the database file is the problem, thanks for the help!
dd
-------------------------------
<%@Language="VBScript"%>
<%
'================
' ex1-emails.asp
' For Flash 4
'================
' Very good practice to include this line
Option Explicit
' RecordSet and Connection objects, and SQL string
Dim oRS, oConn, strSQL
Dim results
Set oConn = Server.CreateObject("ADODB.Connection")
Set oRS = Server.CreateObject("ADODB.Recordset")
' Make a DSN-less connection to the DB
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("../../database/example.mdb")
' Open our recordset accordingly
If UCase(Request("NameLast")) = "" Then
strSQL = "SELECT * FROM Emails ORDER BY ID DESC"
Else
strSQL = "SELECT * FROM Emails WHERE NameLast LIKE '" & Request("NameLast") & "'"
End If
oRS.Open strSQL, oConn, 2, 3
' 2 and 3 are numeric equivalents of adOpenDynamic and adLockOptimistic.
' These are the best choices for what we're trying to accomplish.
' See ADO documentation for other cursor and lock types.
If oRS.EOF Then
Response.Write "success=False"
Else
Response.Write "success=True&results="
Do While Not oRS.EOF
results = results & oRS ("NameFirst") & " " & oRS("NameLast") & vbCr
results = results & oRS("EmailAddress") & vbCr
results = results & oRS("Message") & vbCr & "--------------------------------" & vbCrLf
oRS.MoveNext
Loop
End If
oRS.Close
Set oRS = Nothing
oConn.Close
Set oConn = Nothing
Response.Write Server.URLEncode(results)
%>
View Replies !
View Related
Can Flash Get From A MYSQL Database?
hey every1
i was wondering if in flash i could conect to a MYSQl database and get infromation from the database and then put the informartion into Flash Action script?
EXAMPLE
in flash get a link from the database and then have a button and it goes to that link gathered from the databasE?
thanks
softz
View Replies !
View Related
Flash Mx To Mysql Database
ok can u show me how to search the mysql database i would greatly appreciate it cuz im pulling my hair out over here...im using flash mx and PHP....
here' the the query but i dont know how to put it in a script:
$query_searchRS = sprintf("SELECT city, `state`, `area code`, `venue type`, `music type`, `age group`, venues.city FROM venues WHERE `venue name` = '%s' AND venues.`state` AND venues.`area code` AND venues.email AND venues.website AND venues.`venue type` AND venues.`music type` AND venues.`age group` ORDER BY `venue name` ASC", $colname_searchRS);
can u show me how to wright the rest of the script plz..(and please explain like i am very slow lol...)..
here is the .fla......
and there is an example on my site nightspotz.com and go to the search link
View Replies !
View Related
DATABASE HELP (mySql Php Flash 8)
I have been trying to get my foot in the door on database building with flash for a few years now. I keep finding the same tutorials, and they seem to set them selves up for "local server"...
From what i know, i want to:
-have a flash file that logs into my web-server
-to view the database (using a tiny bit of php)
-writes/reads files to/from the database
-and allows for secure user logins
i want to use flash 8, i recently found a flash mx tutorial and i wonder if that will work the same... they are both AS2 right?
Please help me out.
Thanks:
Frostkeep
View Replies !
View Related
Linking A MySQL Database To Flash
Hi,
This is going to be a bit odd (and probably quite advanced as I'm still a beginner at AS)
Anyhow, I need to somehow link my flash SWF to a mySQL database. The SWF needs to contain places for Username and Password. The username/password fields need to be able to process both the bits of info once inputted.
I realise that this is probably very difficult and may need some PHP to do it (if so, could you supply it or give me an address to download it from???), but I need to find out how to do it!!
Anybody help??
View Replies !
View Related
Flash Mx, PHp, MySQL DATABASE INTEGRATION
hI, I NEED HELP WITH THE WRITTING OF CODES TO INTEGRATE FLASH WITH PHP AND THE PHP CODE WITH A MY SQL DATABASE. I AM AN INTERMIDIATE / EXPERT FLASH USER BUT I HAVE NO KNOWLEGDE OF PHP INTEGRATION WITH FLASH LET ALONE PHP WITH MY SQL PLEASE I NEED HELPAND I NEED IT URGENTLY THANK YOU
View Replies !
View Related
Loading Xml To Flash From Mysql Database.
Hi! for my project im trying to get output data from xml into flash...
with images & url with description on top of image, load like 10 images with ur and if there is more give me options with numbers.
i looked at lots of tutorials but im still lost, can any one please help me.
Thank you in advance.
sorry im so new to this action scripts so im so lost.
View Replies !
View Related
Flash & MySQL / Database Advice
I am using a FLA file from www.levitated.net (http://www.levitated.net/daily/levEmotionFractal.html)
The FLA contains the following logic (amongst other bits):
// word sets
// emotional words
vernacular = "merry happy christmas xmas greetings seasons";
// array of words
wordList = new Array();
wordList = vernacular.split(" ");
Then it fills the stage with randomly placed instances of the words, which have been split up into the array.
I'd really like to allow users to enter their own words into a form. Then store the words in MySQL, and then when the user views that ecard, I could pull the values entered by the user from MySQL and pass them to flash. Then, instead of the 'vernacular' variable being hard coded, it could be replaced with whatever the user entered when they set up the ecard.
Do you think this would be hard to do? Given the massively complex things people are doing with Flash these days, I am guessing not. But I wanted to check here first.
I'm not asking to be spoon fed here, I'm just after a bit of guidance, as I've never done Flash / MySQL integration before. Obviously I'd need to use ASP or PHP as well...
Thanks
Jim
View Replies !
View Related
INserting Data From Flash Into A MySQL Database HELP
Hello,
I am trying to post data from a flash game into a Mysql database using PHP.
I have written the insert PHP file which works fine with a HTML form but as soon as I try to get it to work from flash
nothing happens......
This is the code in the flash file
on (release) {
loadVariablesNum ("http://www.spiked.tv/stuff/test.php", 0, "POST");
}
Any Ideas Help etc
Regards
Christian
View Replies !
View Related
Help Linking Flash Form With Mysql Database
Hello! i have a flash form that is for 'contacting us' you enter email, name and question and click send and it should submit info into a MySQL database and also email me, i can easlily do that in PHP, but i dont know flash. Could someone look at my scripts or something? or help me out here? i dont know where to start........
Thanks
Jesse
View Replies !
View Related
Displaying Images Thru Mysql Database,php In Flash
i like wrote this
getcardimages.php
<?php
$server = "localhost";
$user = "khelorummy_d";
$pass = "khelorummy123";
$database = "khelorummy_d";
mysql_connect($server, $user, $pass);
mysql_select_db($database);
$SqlQuery = "SELECT `c`.* FROM `cards` c, `cardsets` cs WHERE c.`cardID` = cs.`cardID`";
$Result = $DBConn->ExecuteQuery($SqlQuery);
if (!Result || mysql_num_rows($Result)==0) {
$rowset = '&msg='.mysql_error().'&';
} else {
$rowset = '&n='.mysql_num_rows ($Result);
$i = 1;
while ($row = mysql_fetch_assoc ($Result)) {
while (list ($key, $val) = each ($row)) {
$rowset .= '&' . $key . $i . '=' . stripslashes($val);
}
$i++;
}
$rowset .='&';
}
return $rowset;
?>
and getcardimages.fla like this
var lvSend = new LoadVars();
var lvReceive = new LoadVars();
lvSend.SendAndLoad("http://192.168.1.9/projects/khelorummy/user/getcardimages.php",lvReceive,"get");
lvReceive.onLoad = function(bSuccess) {
if(bSuccess == true) {
for (var i:Number=0; i <= this.n; i++) {
this.root.createEmptyMovieClip("container"+i, i);
var mc = this.root["container"+i];
mc.loadMovie("http://192.168.1.9/projects/khelorummy/cards/"+this["label"+i]+".gif");
}
}
and in design mode i took one movie clip and i named it as "container". is it correct?
why images are not displaying when i execute getcardimages.swf?
plz give me right solution.
thankq
View Replies !
View Related
Flash And PHP/MYSQL Database Text Trouble
Hello, I am trying to put together a web site that takes ALL content from the MYSQL database and displays it in dynamic text boxes...
I am having no trouble getting the variables from PHP, it is just a problem of storing those variables so taht they can be used later. Problem is displayed here:
http://test.un-identified.com/gateway/index.html
click through all 3 buttons -- make sure it loads the content, after you have clicked through all three, try clicking them again -- the content does not show up and i cannot figure out why -- or a solution to it.
here is the function to get the content when given a page title.
Code:
function get_page(page_title){
//creates a new loadVars object with the title of requested page, then returns
// with the page content to put inside the text box
content = new LoadVars();
content.page_title = page_title;
content.onLoad = function(success) {
if (success){
// enters recieved content into text box
_root.content_box.scrollerText.htmlText = this.content; } else{
trace("Problems...");
}
}
content.sendAndLoad("http://test.un-identified.com/gateway/php/display_page.php?uniqueID=" + getTimer() , content, "POST");
}
Here is some button code that calls the function with the desierd page title as a parameter:
Code:
on (release) {
_root.get_page("Home");
}
(also: the 'loading' is just another variable i load with LoadVars everytime a button is clicked (before the get_page() function is called) so as to make sure the text box reloads with new content each time --is there a real way to check if the content is loaded, and possibly use a loading bar for this type of dynamic content?)
Thanks
View Replies !
View Related
Using Flash And PHP To Submit Data To A MYSQL Database.
Hey there. I'm fairly new to flash and AS as well as to this site. My first big(er) project I have undertaken is designing a flash registration system that takes form data, sends it to PHP which then sends it to a MySql DB.
I successfully made a working(I think) FLA with everything. There seems to be a problem with the data transfer from flash to PHP. As far as I can tell the PHP part works. I've been working on this for a while, not quite sure where to turn now, so I thought I'd turn to outside help. Could one of you guys kindly tell me what I'm doing wrong? I'm code savvy on an OK level with PHP so I can take explanations on a somewhat deeper level.
Ok, so, I am using URLVariables to (hopefully) send a retrive the vars. Here is my code:
Actionscript Code:
Original
- Actionscript Code
var scriptRequest:URLRequest = new URLRequest("http://localhost/reg.php");
var scriptLoader:URLLoader = new URLLoader();
var scriptVars:URLVariables = new URLVariables();
scriptRequest.method = URLRequestMethod.POST;
scriptRequest.data = scriptVars;
stop();
status_txt.text = "";
submit_btn.addEventListener(MouseEvent.CLICK, form);
function form(event:MouseEvent):void
{
//validate form fields
if(!cfirst_txt.length) {
status_txt.text = "Please enter your childs first name.";
} else if(!clast_txt.length) {
status_txt.text = "Please enter your childs last name.";
} else if(!gender_txt.length) {
status_txt.text = "Please enter your childs gender.";
} else if(!bday_txt.length) {
status_txt.text = "Please enter your childs birthday.";
} else if(!grade_txt.length) {
status_txt.text = "Please enter the grade your child just completed.";
} else if(!tss_txt.length) {
status_txt.text = "Please enter your childs T-Shirt size.";
} else if(!pn_txt.length) {
status_txt.text = "Please enter your name.";
} else if(!addy_txt.length) {
status_txt.text = "Please enter your address.";
} else if(!city_txt.length) {
status_txt.text = "Please enter your city.";
} else if(!hphone_txt.length) {
status_txt.text = "Please enter your home phone.";
} else if(!email_txt.length) {
status_txt.text = "Please enter an email address";
} else if(!validateEmail(email_txt.text)) {
status_txt.text = "Please enter a VALID email address";
} else if(!ecn_txt.length) {
status_txt.text = "Please enter an emergency contact name.";
} else if(!ecp_txt.length) {
status_txt.text = "Please enter an emergency contact phone number.";
} else if(!ss_txt.length) {
status_txt.text = "Please enter your Sunday School information.";
} else if(!med_txt.length) {
status_txt.text = "Please enter your childs medical information.";
} else if(!pickup_txt.length) {
status_txt.text = "Please enter who may pick-up your child.";
} else
scriptLoader.addEventListener(Event.COMPLETE, handleLoadSuccessful);
scriptLoader.addEventListener(IOErrorEvent.IO_ERROR, handleLoadError);
scriptVars.child_first = "cfirst_txt.text";
scriptVars.child_last = "clast_txt.text";
scriptVars.child_gender = "gender_txt.text";
scriptVars.child_birth = "bday_txt.text";
scriptVars.child_grade = "grade_txt.text";
scriptVars.child_size = "tss_txt.text";
scriptVars.parent_name = "pn_txt.text";
scriptVars.parent_address = "addy_txt.text";
scriptVars.parent_city = "city_txt.text";
scriptVars.parent_home = "hphone_txt.text";
scriptVars.parent_work = "work_txt_txt.text";
scriptVars.parent_cell = "cell_txt.text";
scriptVars.parent_email = "email_txt.text";
scriptVars.eme_name = "ecn_txt.text";
scriptVars.eme_phone = "ecp_txt.text";
scriptVars.sunday_school = "ss_txt.text";
scriptVars.med_info = "med_txt.text";
scriptVars.pick_up = "pickup_txt.text";
scriptLoader.load(scriptRequest);
function handleLoadSuccessful($evt:Event):void
{
gotoAndStop(2);
status_txt.text = "Registration Submitted.";
}
function handleLoadError($evt:IOErrorEvent):void
{
status_txt.text = "Registration Failed for some reason. Please try again.";
}
}
function validateEmail(str:String):Boolean {
var pattern:RegExp = /(w|[_.-])+@((w|-)+.)+w{2,4}+/;
var result:Object = pattern.exec(str);
if(result == null) {
return false;
}
return true;
}
var scriptRequest:URLRequest = new URLRequest("http://localhost/reg.php"); var scriptLoader:URLLoader = new URLLoader(); var scriptVars:URLVariables = new URLVariables(); scriptRequest.method = URLRequestMethod.POST; scriptRequest.data = scriptVars; stop(); status_txt.text = ""; submit_btn.addEventListener(MouseEvent.CLICK, form); function form(event:MouseEvent):void { //validate form fieldsif(!cfirst_txt.length) {status_txt.text = "Please enter your childs first name.";} else if(!clast_txt.length) {status_txt.text = "Please enter your childs last name.";} else if(!gender_txt.length) {status_txt.text = "Please enter your childs gender.";} else if(!bday_txt.length) {status_txt.text = "Please enter your childs birthday.";} else if(!grade_txt.length) {status_txt.text = "Please enter the grade your child just completed.";} else if(!tss_txt.length) {status_txt.text = "Please enter your childs T-Shirt size.";} else if(!pn_txt.length) {status_txt.text = "Please enter your name.";} else if(!addy_txt.length) {status_txt.text = "Please enter your address.";} else if(!city_txt.length) {status_txt.text = "Please enter your city.";} else if(!hphone_txt.length) {status_txt.text = "Please enter your home phone.";} else if(!email_txt.length) {status_txt.text = "Please enter an email address";} else if(!validateEmail(email_txt.text)) {status_txt.text = "Please enter a VALID email address";} else if(!ecn_txt.length) {status_txt.text = "Please enter an emergency contact name.";} else if(!ecp_txt.length) {status_txt.text = "Please enter an emergency contact phone number.";} else if(!ss_txt.length) {status_txt.text = "Please enter your Sunday School information.";} else if(!med_txt.length) {status_txt.text = "Please enter your childs medical information.";} else if(!pickup_txt.length) {status_txt.text = "Please enter who may pick-up your child.";} else scriptLoader.addEventListener(Event.COMPLETE, handleLoadSuccessful); scriptLoader.addEventListener(IOErrorEvent.IO_ERROR, handleLoadError); scriptVars.child_first = "cfirst_txt.text"; scriptVars.child_last = "clast_txt.text"; scriptVars.child_gender = "gender_txt.text"; scriptVars.child_birth = "bday_txt.text"; scriptVars.child_grade = "grade_txt.text"; scriptVars.child_size = "tss_txt.text"; scriptVars.parent_name = "pn_txt.text"; scriptVars.parent_address = "addy_txt.text"; scriptVars.parent_city = "city_txt.text"; scriptVars.parent_home = "hphone_txt.text"; scriptVars.parent_work = "work_txt_txt.text"; scriptVars.parent_cell = "cell_txt.text"; scriptVars.parent_email = "email_txt.text"; scriptVars.eme_name = "ecn_txt.text"; scriptVars.eme_phone = "ecp_txt.text"; scriptVars.sunday_school = "ss_txt.text"; scriptVars.med_info = "med_txt.text"; scriptVars.pick_up = "pickup_txt.text"; scriptLoader.load(scriptRequest); function handleLoadSuccessful($evt:Event):void { gotoAndStop(2); status_txt.text = "Registration Submitted."; } function handleLoadError($evt:IOErrorEvent):void { status_txt.text = "Registration Failed for some reason. Please try again."; } }function validateEmail(str:String):Boolean {var pattern:RegExp = /(w|[_.-])+@((w|-)+.)+w{2,4}+/;var result:Object = pattern.exec(str);if(result == null) {return false;}return true;}
Ok, so as You can see the movie is waiting for a mouse click on a button then runs the function "form". That includes an error check and, if all goes well, a "scriptLoader.load(scriptRequest);" which goes with this:
scriptRequest.method = URLRequestMethod.POST;
I think any problems I'm having are in the AS since it appears that my PHP works. If you want/need to see the PHP for submitting the data to SQL than I'll post that. I can also post the FLA after I get 5 posts
Thanks guys,
Nathaniel
View Replies !
View Related
Flash Reading From A MySQL Database And Adding To A Table In It
I'm wanting to know if anyone knows and code to query Variables from a database, or has a login page script that reads from a mysql database that will pull things from a table, and also add them when a user is signing up. Really, All i need is a login script that will connect to a mysql database and will call certain variables from a table in that database, and add to the table when a user signs up.
If anyone has a script or can point me to one so I can copy and paste the code in and edit it to my database and tables PLEASE let me know!! Im sick of using flat files!
Thanks!
View Replies !
View Related
Loading PHP Or Data From Mysql Database Into My Flash Movie
Hi
Im currently building a flash site which will replace a html site... There has been an admin part of the old site set up in which we can input information into and it displays the information on the page http://www.acusis.co.uk/v2/giglist.php
It uses a mysql database stored on the server.
I would like keep to admin part running and load the information on this page into my flash movie or just load the page into my flash movie, so that it can still be used... I'm relatively new to flash so any help would be much appriciated.
Does anyone know how I can do this???
Cheers
Marc Bernard
View Replies !
View Related
Posting Data To PHP/MySQL Database Via Flash Forms.
Hi, Can anyone direct me or guide me through as to how I can send some text in a dynamic flash textfield to a mySQL database and vice versa?
Basically I've created a text field - assuming it has to be dynamic (with an instance name of "tUserdata"), it's going to be multiline text, and upto 255 characters. As the user clicks the submit button, the data held in the flash text field is sent to the mySQL database and stored there. I understand that i have to use PHP as well - and heard i need to use the loadVars function.
Could anyone help me especially with the coding in PHP and connecting to a MySQL database, and what actionscript i need to insert.... it probably sound really easy for u guys.
View Replies !
View Related
Flash Online - And Constantly Updating A Mysql Database
Okay.. I've gone one step too far and now I'm regretting it. :P Well not exactly.
I've developed a pretty amazing game, as far as my skills are concerned using PHP and flash and now what I want to do is get the Flash file to update my database without refreshing any pages. :|
I need to constantly update the user's position (probably with onEnterFrame) in the database, so basically.. saving every single frame.
Can anyone point me in some direction? How to.. go about this? Because as far as I know, this would involve refreshing the page... which could get a bit tedious.
...
Don't call me crazy either. Or I'll throw onions at you.
View Replies !
View Related
Flash Audio Player For MySQL Song Database
Hi, this is my firts post here, after teading through the topics posted I couldnīt find an answer for my problem, so let me explain hoping that a someone could help me with this.
I work as a webmaster for a digital music dowload site www.musicdld.com we currently use .m3u files for audio prelistening. But to be honest it is a pain in the... making all the clips, and so on, takes a lot of time and effort to do such a basic task.
So I found a while ago the great site of www.bleep.com that uses an excellent flash audio player that calls songs from a database for prelistening, and it even stops the song every 40 secs, so you can listen to the entire song but wonīt be able to record it because it stops at certain points. And the greates part of it, is that it shows in some way the audio peaks of the song
I donīt have much expericne with actionscript, and it has been really hard for me to figure out the correct code. So I wonder if someone on the forum can guide me or help me solve this problem.
Thank you in advance!
View Replies !
View Related
List The Five Latest Posts From The Mysql Database In Flash MX?
Hi!
I am a newbie to Flash, I wonder how I can list the 5 latest posts from a mysql database in Flash?+
My index.php file looks like this:
<?
mysql_connect("localhost", "user", "pass")
mysql_select_db("dikter.dikter");
$dikter= mysql_query("SELECT * FROM dikter.DIKTER ORDER BY titel ASC LIMIT 5");
?>
So my question is how I should list these data in flash? What codes do I have to write in Flash to make it go?
/Thanx for answering..
View Replies !
View Related
Flash Script Error When Connecting To MySQL Database?
i have set up a basic news section whic gets its data from a MySQL table called news from a database called site. The problem is that when i click on the blog button to load in this data, the flash player chokes up and then it loads the data. Then i get this error message http://www.jacksrambles.com/error.JPG
does anyone have any idea about this.
you can test this error for yourself at http://www.jacksrambles.com. Then click on the blog button. Also i have to embed the fonts so don't mind them :wink:
If you need more information please ask..
From Jack
Also the connection to the database is done via a PHP script
View Replies !
View Related
Inserting Data To Mysql Database Trough A Flash Form - Combobox Script Not Working
Hi, im trying to build a flash form that pass som data to a mysql server database iīve been reading some tutorials and i made the actionscript for the submit(=grabar in spanish) button so that it colects data and send it to the server. (i have a form with textfield that is where people enter data, and 2 combobox, one for selecting a personīs name and the other to select a place).
but im having the same record duplicated on the database, but, the first record is complete and the duplicate itīs the same but for the two selections of the 2 combobox that are missing. As a result of running the form an loading data normally i then get on the database 2 records added the are equal but one of them has no combobox data.
I think the problem is definitly the combo box code that i use cos after using it the script worked perfectly maybe someone can help me with it. And also i īve found some tutorials for showing a mysql database content with flash but they are really difficult, some of they se PHPObject and others just tones of actionscript code, isnīt an easyier way for doing it??
Hereīs the script:
on (release) {
if (apellido =="") {
status = "Debe llenar el apellido del cliente!";
} else if (nombre =="") {
status = "Debe llenar el nombre del cliente!";
} else if (fecha =="") {
status = "Debe llenar la fecha de la entrevista!";
} else if (hora =="") {
status = "Debe llenar la hora de la entrevista!";
} else if (asunto =="") {
status = "Debe llenar el asunto del cliente!";
}else{
userData = new LoadVars();
userData.apellido = apellido;
userData.nombre = nombre;
userData.telefono = telefono;
userData.dni = dni;
userData.fecha = fecha;
userData.hora = hora;
userData.asunto = asunto;
userData.abogado = "";
userData.donde = "";
userData.abogado = abogado_cb.getValue();
userData.donde = donde_cb.getValue();
userData.send("inserta.php", "this", "POST");
getURL("inserta.php","this","POST");
status = "Datos Guardados!";
apellido = "";
nombre = "";
dni = "";
telefono = "";
fecha = "";
hora = "";
asunto = "";
}
}
Thanks.
Emilio
View Replies !
View Related
MySQL Database
I want to build a web site for a photographer using Flash. I want to connect it to a MySQL database so that the photographer can add or delete photos and descriptions in the database (This part I can do w/ASP or PHP)
How do I connect the Flash .swf to the database to reflect the new photos and descriptions. I am trying to set this up so that the photographer can maintain the site as far as adding new photos.
Thanks in advance for any help with this...
View Replies !
View Related
AS PHP To MySQL Database
As a newbie trying to get flash to export form data to a MySQL database via php is proving very hard. I really need to get this done though so if anyone could help I would buy them all kinds of doughnuts and cakes and lots of fizzy pop. My latest attempt at the code is below. I have also attached a basic .fla file if that helps.
SUBMIT BUTTON CODE:
on (release) {
if (name eq "" || email eq "" || mobile eq "") {
errorBox._x= 100;
} else {
loadVariablesNum("process.php", 0, "POST");
gotoAndPlay("thankyou");
}
}
PROCESS PHP CODE:
<?php
//Database Information
$dbhost = "localhost";
$dbname = "idaynes_testdb";
$dbuser = "admin";
$dbpass = "admin";
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
if($name=="undefined" || $email=="undefined" || $mobile=="undefined"){
echo "Please fill in all the fields";
}else{
echo "Thankyou for subscribing.";
mysql_connect("localhost", "subscribe", "admin");
mysql_select_db("idaynes_testdb");
mysql_query("INSERT INTO subscribe ('name',`email`,`mobile`) VALUES ('$name',`$email`,`$mobile`)");
?>
View Replies !
View Related
Link To MYSQL Database
Hi,
I am using Flash MX 2004 Pro to link an application that I have in one of the forms in an Accordion to MYSQL database.
The form is supposed to store the info in a table when the person clicks on the submit button. The submit button and all the fields I am using in the Accordion are components.
When I press the submit button, the form does not POST the info to the php file!
Any suggestions will be very appreciated.
This is the submit button action script:
code:
on(click){
with(_parent){
//assign values to variables
initials = initial_cmbbox.value;
forename = firstName_txt.text;
surname = surname_txt.text;
address = address_txt.text;
pCode = pCode_txt.text;
mobilePhone = teleMobile_txt.text;
homePhone = teleHome_txt.text;
email = email_txt.text;
if((forename == "")||(surname == "")||(address=="")){
gotoAndPlay("requiredFields");
}else{
result = "";
loadVariables("InsertPersonalDetails.php", this, "POST");
status = "Processing entry. Please wait...";
gotoAndPlay("thankYou");
}
}
}
Thank you,
RE
View Replies !
View Related
Searching A MySQL Database?
Our website ( mbtractor.com ) has a search option that queries a database of inventory items and displays the results. I am redesigning the header to make better use of the space (it's way too big) and would like to know if it is possible to put the search in the flash header?
MySQL
PHP
-Lee
View Replies !
View Related
Can Not Connect To MySql DataBase
I desigend a J2EE Aplication using JSP and Servlets in MVC design.
My system was working great untill i tried using filter for gzip compression for response output , after i used filter gzip, my whole application is destroyed, I cannot able to connect to my Mysql data base, my connection object always returns NULL, i tried every thing re-installing the mysql driver, re-installing the NetBeans ide , nothing is working, i am not able to connect with the database.
This application was working perfect before i experimented with the Gzip filter.please any body can help me what i did wrong, did i corrupted tomcat server. My application is still on my laptop and is not have been loaded on internet yet. i am posting some errors it is showing on the tomcat log.
I Want to mention i am using connection pooling which was working great,
all the servlets are present in the application, the whole application and connection pooling was working great before i used this gzip filter.....Also i like to mention the main problem is when i try to load the driver for Mysql database in my java class it always returns a null connection object. I use Class.forName function in java to load a driver for mysql database.Following is the code where my appliacation returns null connection object
public static Connection ConnectDB(String NameParm, String PasswordParm) {
try {
String url = "jdbc:mysql://localhost:3306/mysql";
Class.forName("com.mysql.jdbc.Driver");
conn = null;
conn = DriverManager.getConnection(url, NameParm, PasswordParm);
System.out.println("Database connection established");
return conn;
} catch (Exception e)
{
System.err.println("Cannot connect to database server ");
return conn;
}
}
please guilde me.. my application is totally stoped at this moment.
=========== E R R O R S- ON TOMCAT LOG ============
Jan 3, 2006 3:28:16 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FIL ES', '[Ljava.lang.String;@3a9bba')
Jan 3, 2006 3:28:16 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FIL ES', '[Ljava.lang.String;@1c5ddc9')
Jan 3, 2006 3:28:16 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeReplaced('org.apache.catalina.WELCOME_FIL ES', '[Ljava.lang.String;@163f7a1')
Jan 3, 2006 3:28:16 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
Jan 3, 2006 3:28:16 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()
Jan 3, 2006 3:28:32 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet ShadiManager as unavailable
Jan 3, 2006 3:28:32 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /CofeeAdvice threw load() exception
javax.servlet.UnavailableException: Couldn't create connection pool
at com.example.model.ServletController.init(ServletCo ntroller.java:69)
at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1091)
at org.apache.catalina.core.StandardWrapper.load(Stan dardWrapper.java:925)
at org.apache.catalina.core.StandardContext.loadOnSta rtup(StandardContext.java:3857)
at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4118)
at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDescr iptor(HostConfig.java:589)
at org.apache.catalina.startup.HostConfig.deployDescr iptors(HostConfig.java:536)
at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:471)
at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:1102)
at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1020)
at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:718)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1012)
at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:442)
at org.apache.catalina.core.StandardService.start(Sta ndardService.java:450)
at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:683)
at org.apache.catalina.startup.Catalina.start(Catalin a.java:537)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:271)
at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:409)
Jan 3, 2006 3:28:33 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Jan 3, 2006 3:28:33 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Jan 3, 2006 3:28:34 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class com.sun.faces.config.ConfigureListener
java.lang.NoClassDefFoundError: javax/faces/FacesException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Cla ss.java:2328)
at java.lang.Class.getConstructor0(Class.java:2640)
at java.lang.Class.newInstance0(Class.java:321)
at java.lang.Class.newInstance(Class.java:303)
at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:3618)
at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4104)
at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDescr iptor(HostConfig.java:589)
at org.apache.catalina.startup.HostConfig.deployDescr iptors(HostConfig.java:536)
at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:471)
at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:1102)
at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1020)
at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:718)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1012)
at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:442)
at org.apache.catalina.core.StandardService.start(Sta ndardService.java:450)
at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:683)
at org.apache.catalina.startup.Catalina.start(Catalin a.java:537)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:271)
at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:409)
Jan 3, 2006 3:28:34 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
View Replies !
View Related
Using Data From A MySQL Database
Here is the piece of my code:
if (this["projectName"+three] != "") {
_global.projectFile3 = this["projectFile"+three];
heading3_txt.htmlText = this["projectName"+three];
content3_txt.htmlText = this["description"+three];
if (this["thumbnail"+three] != "") {
picHolder3_mc.loadMovie("images/"+this["thumbnail"+three]);
}
} else if (this["projectName"+three] == "") {
content3_txt.htmlText = "";
heading3_txt.htmlText = "";
}
It is for a portfolio thingie i am working on. My script pulls the data from the db three at a time and displays it. the problem is on the last "else if" statment. If there is only 2 items left to display, the third listing is suppose to put in blanks, but instead it places "undefined" in both instances. Any ideas? thanks...
View Replies !
View Related
LoadVars With Mysql Database
I'm using this example found here: http://www.flash-creations.com/notes/servercomm_database.php
And like the tutorial shows I am loading data through php from mysql. The problem is when I create new frames the information from the mysql database wont go away and keeps loading in. Please take a look at the picture: Found here
Is there someway of clearing or unloading this data before the next frame loads?
Attach Code
select_lv.onLoad = function(ok:Boolean) {
if (ok) {
if (this.errorcode=="0") {
for (var i:Number=0; i < this.n; i++) {
scoreInfo.push(
{record:this["id"+i],
nickname:this["nickname"+i],
score:Number(this["score"+i]),
dateposted:this["dateposted"+i]
});
}
// only display Nickname, Score, and Date Posted (not record id)
scores_dg.columnNames = ["nickname", "score", "dateposted"];
// set formatting of nickname column
scores_dg.getColumnAt(0).width = 200;
// trap header click event to sort case-insensitive on this field
scores_dg.getColumnAt(0).sortOnHeaderRelease = false;
// this property will keep track of whether sort is ascending or descending
scores_dg.getColumnAt(0).sortedUp = false;
scores_dg.getColumnAt(0).headerText = "Nickname";
// set formatting of score column
scores_dg.getColumnAt(1).width = 100;
// trap header click event to sort numerically
scores_dg.getColumnAt(1).sortOnHeaderRelease = false;
scores_dg.getColumnAt(1).sortedUp = false;
scores_dg.getColumnAt(1).headerText = "Score";
// set formatting of date column
// auto-sort will work fine for this column
scores_dg.getColumnAt(2).width = 160;
scores_dg.getColumnAt(2).headerText = "Date Posted";
// set dataProvider for datagrid
scores_dg.dataProvider = scoreInfo;
// execute headerRelease function for correct sort when user clicks a header
scores_dg.addEventListener("headerRelease", headerListener);
msg_ta.text = "Enter data and click Add to add a score. Click a row and Delete ";
msg_ta.text += "Selected to delete a score. First four entries may not be deleted.";
} else {
// show kind of error
msg_ta.text = errorMsgs[Number(this.errorcode)];
// if query error, show mysql_error
if (this.errorcode == "3") msg_ta.text += ": " + this.msg;
}
} else {
// if loadvars failed (eg, if script not found)
msg_ta.text = "Flash-database select operation failed";
}
}
msg_ta.text = "Getting high scores from database...";
select_lv.sendAndLoad(filepath + "getscores.php", select_lv, "GET");
View Replies !
View Related
A Lot Of Info Out Of A MySql Database
Hi,
I have a music website.
Formerly I used PHP to get all information out of a MySql Database. Information like, "projectname", "Number of Tracks", "Information", "Track names"...
All this information was put in an Array.
Then the PHP read out the created Array one by one (Array[0], Array[1], etc) and processes a table with in that table all the info.
Now I try using flash. I have done all tutorials on this website about this subject, but I am still not sure how to do it.
I first let AS call to my PHP-file. This PHP-file pulls the information out of the database, and puts it in an array, just like it did before.
Now I want to copy the PHP-array into the FLASH-array, or at least I think this is the way to do it... I don't know how though...
What I want is that I am able then to read out the array in flash, array[0], array[1], etc...
please help me out !! Thanks,
Zagrad
View Replies !
View Related
Images And Co. From MySQL Database With Php
This one is heavy. In flash I have 15 image groups. Each group has 5 banknotes in it. When I choose one group, I get a screen with 5 preview pics, each with a short info text on mouse-over. On this page I can click <prev next> through all 15 groups of preview images. When I click on a preview image, I get a screen with the big banknote picture. On this screen, I can click <prev next> through other banknote pictures (front and back side - together 10 images in a group). Each banknote has a description text on the side.
I have it working in flash but now it's supposed to work with a content management system which means the images and text are somewhere in a mySQL db and have crazy names and I have to pull them via php. H E L P P L E A S E. I don't know how to do this in flash, for php I need some hints but not all details, I'll have support there once I know what exactly I need.
One more time: first I choose a banknote group, somehow tell php and it sends me back 1) the names and paths for the 5 preview images, 2) the small info texts for the 5 images 3) names/links to the 10 big images of the banknotes 4) longer description texts for the 5 banknotes
thank you thank you thank you
View Replies !
View Related
Form To Mysql Database
-------ok this is my script.......and my actionscript--------
<?php
$venuename = $_POST['venuename'];
$email = $_POST['email'];
$website = $_POST['website'];
$phonenumber = $_POST['phonenumber'];
$areacode = $_POST['areacode'];
$address = $_POST['address'];
$city = $_POST['city'];
$state = $_POST['state'];
$zipcode = $_POST['zipcode'];
$contact = $_POST['contact'];
$inputclubtype = $_POST['clubtype'];
$inputmusictype = $_POST['musictype'];
$inputcrowd = $_POST['crowd'];
$inputdresscode = $_POST['dresscode'];
$comments = $_POST['comments'];
$conn = mysql_connect("localhost", "nigolmvc_nigolmv", "******");
mysql_select_db ("nigolmvc_nightspotz", $conn);
$result = mysql_query("INSERT into venues ( venuename, email, website, phonenumber, areacode, address, city, state, zipcode, contact, clubtype, musictype, crowd, dresscode, comment) VALUES('$venuename', '$email', '$website', '$phonenumber', '$areacode', '$address', '$city', '$state', '$zipCode', '$contact', '$inputclubtype', '$inputmusictype', '$inputcrowd', '$inputdresscode', '$comment')");
if(!mysql_query($query,$conn))
{
echo mysql_error();
exit;
}
?>
----the actionscript is attached to frame not the button-----
submitBtn.onPress = function(){
if(venuename.text!="" && address.text!="" && email.text!="" && city.text!="" && website.text!="" && zipcode.text!="" contact.text!="" areacode.text!="" phonenumber.text!="" comments.text!=""){
myData = new LoadVars();
myData.venuename = venuename.text;
myData.address = address.text;
myData.email = email.text;
myData.city = city.text;
myData.website = website.text;
myData.zipcode = zipcode.text;
myData.contact = contact.text;
myData.areacode = areacode.text;
myData.phonenumber = phonenumber.text;
myData.comments = comments.text;
myData.sendAndLoad("advertise.php", myData, "POST");
gotoAndPlay(113);
venuename = "";
address = "";
email = "";
city = "";
website = "";
zipcode = "";
contact = "";
areacode = "";
phonenumber = "";
comments = "";
Emailstatus = "";
}else{
statusBox.text = "Fill out all required fields!";
}
}
----this is the error im getting from from actiocscript------
**Error** Scene=Scene 1, layer=form, frame=116:Line 15: ')' expected
if(venuename.text!="" && address.text!="" && email.text!="" && city.text!="" && website.text!="" && zipcode.text!="" contact.text!="" areacode.text!="" phonenumber.text!="" comments.text!=""){
**Error** Scene=Scene 1, layer=form, frame=116:Line 40: Unexpected '}' encountered
}else{
Total ActionScript Errors: 2 Reported Errors: 2
DONT KNOW WHAT THIS MEANS...........
View Replies !
View Related
Getting Variables From MySQL Database
I have a database with info about each of my movies (filename, size, length, credits, etc) How would I load the variables for a particular movie from the database into the flash?
I did a search on the forum, but I wasnt sure excatlly to search for so I didn't find anything.
View Replies !
View Related
Login From MySQL Database
I want to be able to load username and password info from a MySQL to check authentication. I'm not experienced in PHP and please don't redirect me to http://www.kirupa.com/developer/acti...entication.htm. I have tried it and I get some stupid output errors in flash.
Thanks in advance.
~Zuriki
View Replies !
View Related
Actionscript With Php Into A Mysql Database
http://www.sitepoint.com/article/create-flash-sketchpad
Hi I was looking to utilize a .fla similar to the sketchpad found in the above link.
Here's my situation.
I have a mysql database that goes through a series of steps. Upon reaching step 3 the user has the option to draw in the image area (thus the sketchpad function). What I wish to do is have two buttons created, which I would do so don't need explanations on that, which would clear the sketch pad and the other *save the image.
Thats what I'm looking for help on. Is there a script tutorial or any help one can give me that will allow flash to plot or save the image the user creates as a .jpg or .png (preferably) and truncate the white space and talk to some php file or the mysql database itself and save the image?
I'm in desperate need of finding this script, currently I'm using a java applet that does something similar but haven't found the correct php code to plot its exported .png file so I'm hoping that flash will allow for better communcations with php and mysql?
View Replies !
View Related
|