Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




MySQL And PHP Newbie Help



I have a database set up on my server with a table created. I am trying to get information for a mailing list.
name, address, age, comments, ect.
My problem is that I have never set up a form before. I am using Dreamweaver MX and Flash MX. My server admin told me to use PHP. I'm not sure where to start. I want to create the form in flash rather than having a pop-up from flash.

Does anyone have a good tutorial on this ( I have looked, but I can't seem to find one that is geared to what I need). Or if it is fairly easy could just explain it.

Any help would be wonderful.
Thanks in advance.



FlashKit > Flash Help > Flash MX
Posted on: 07-23-2002, 09:08 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Flash + PHP + MYSQL + Newbie = Hell
OK....here's what I'm trying to do. I want to basically click a button and it populates on dynamic text field showing all the fiels in my one table called players (it's for a hockey league). So I have a database called 'stats' a table in there called 'players' and a bunch of fields (i.e. name, goals etc)...I wrote a .php page with the following code
PHP Code:
<?php

   //Set up constants
   define ('MYSQL_HOST', 'localhost');
   define ('MYSQL_USER', 'myName');
   define ('MYSQL_PASS', 'myPassword');
   define ('MYSQL_DB', 'stats');
   //If we fail to connect
   if (! mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS) )
   {
      die('Failed to connect to host "' . MYSQL_HOST . '".');
   }
   else
   {
      echo 'Connected to mysql server ' . MYSQL_HOST . ' as user ' . MYSQL_USER . ' ';
   }
   //Tell mysql which database to use
   mysql_select_db(MYSQL_DB);
   echo 'Database ' . MYSQL_DB . ' selected for use.';
    
   //Select entire table
   $result = mysql_query('SELECT * FROM players');
    
   echo $result;

?>

** As a side note when I view this page in a browser I get 'Connected to mysql server localhost as user myName
Database stats selected for use.'' So that part looks cool.....

Now for flash....here's where I get stuck....I have a new flash file open with 2 layers. On the first layer I have my dnamic text box and on the second an actions layer. I give the dynamic text box a variable and instance name of 'content' and on the actions layer I assign the following:
PHP Code:
loadVariables("http://localhost/script.php", "this", "GET");


I test in flash and nothing.....I know I'm missing stuff....can any1 help? What I really need is for someone to show me the proper code. What do I have to name the dynamic text box instance and/or variable?




A Flash Newbie Needing To Know How To Combine Flash, Php, And Mysql...
If anyone has any ideas, please help. Also, I am working to code the login for it with flash as well, so if you can help that's great thanks!

Export Querries From Flash 8 To MySQL And Import Data From MySQL
Hi friends,
I am making a web site for a customer and i need to import data from MySQL Database but i don't know how to do it.
I would appreciate it if somebody could give me an idea or tell me where to find a tutorial.
Also i heard that there is a .dll file that Macromedia made, in order to make it easier to connect Flash with Databases, is that true ?

[FL8 + PHP + MySQL] Adding/Deleting/Viewing Content From MySQL Db
So... Viewing isn't actually the issue here, I just added it to make it a full triangle . I'm doing that with a PHP that writes the contents of the dB in XML syntax.

But, to make it clear, I am trying to develop an application that communicates with a MySQL database, via PHP. And you have the option to add/delete fields, but also in the Flash application.

I found some source at the gotoAndLearn forums, but it simply would not work! I am uploading a zip of the files. The main problem with this is that when I am adding something, the dB gets filled with blanks. This boggles my mind. Not being a big PHP knower (not knowing anything, really), my suggestion is that the variables don't get sent properly. But then again...

Some help with this please? I'm in a kind of a tight spot here, so some help would be really in handy!

Cheers

Php,mysql And Flash- How To Display Picture In Flash From Mysql
How are you all?
I have a question for php,mysql and flash gurus.
Before I ask this question I will describe what I want briefly.
Using php, I retrieve a path to a picture from mysql and send it to flash movie as a variable.
Now what I would like to do is using this path to a picture how to display the picture as a part of a movie?

Cheers,

Gibbosniper Vs Munkie Or Newbie Vs Newbie
Ok Gibbosniper,

This is the start of the thread, for our contest of Newbies brains in action. Let us set a time limit of sorts, and go from there.

Again, I am far from an MX master, I just started just over a week ago, so it might take a while for me to produce something worthy of public display, but if you are patient, so am I.

Game on!

Munkie!

Keyboard Control-for A Very Newbie Newbie
I was wondering if there is a simple way to control flash animations when
pressing a key on the keyboard. Example: Scene 1 is an animation of a
circle, this scene will continue to loop until I press the 'f' key, and
then the flash movie will change to Scene 2 where we see the circle
explode. I looked around flashkit.com and found some tutorials, but I
think they used an earlier version of flash, because I can't find the
instance properties in order to change the action from mouse click to key
press. I own flash professional 8. Anyway, I can use as much help as I
can get, so if you know of an action parameter in which I can execute
this...action, it would be greatly appreciated! Thank you for your time!
-Timmy

Newbie Asking A Newbie Question
Thanks for looking at my post. I am very new to Flash and I want to make a simple movie withsome text. I know how to insert text and customize it, but I wanted to know how I could jazz it up a bit. Add some effects to it. I was wondering if anyone could help show me how to make it shine, or glimmer, or glow, or something of tht sort, you know? You know on the Ultrashock logo when you put your mouse over it, it shines? I wanna know stuff like that. Can anyone help? Is there a tutorial or we page I can go to? Thanks in advance, and thanks for looking even if you can't help...

MySQL
Where can I see some tutorials on how getting SQL or/and ASP working in a Flash "movie"?

Php Mysql
I'm looking for a free host which accepts php and sql.
I'm trying to upload my own message board, and I'd rather the host be free. Any ideas anyone
Many thanks for any ideas......

MySQL
ok, im lookin 4 sum1 who uses (or has used before, or just knows about MySQL databases) brinkster for making a MySQL database... all i want to know is how to have people play my game but be able to save their username, password, and maybe 1 or two variables... please help me, anybody (note: i am almost a complete newb to MySQL... i know most of the functions, but i dont know what their purposes are)

A 'MySQL'
MySQL seems to perform an ignore case on a 'where' clause. Has anybody come across such a situation? If so how do I fix my query?

Here is an example of my problem:

If the LAST_NAME = 'SMITH' (notice last name is in upper case). LAST_NAME is a column from a MySQL table.
and I perform the query as:

select last_name where last_name = 'smith'

I still get a hit. MySQL returns the row.

That's incorrect; the comparison is ignoring the case of the pattern 'SMITH'.

Any suggestions will be appreaciated.

Thanks
Raymond

Php And Mysql :-)
Hi,

I'm wondering if it would be possible to insert php code into a flash movie.

Like when you build a button that will close window by inserting a javascript code ("javascript:window.close()")...

So I'd like to know if there's a way to insert php instead of javascript...

I'm trying to build a little application database based, but I'm not able to build what I really would...

I've build 3 scroll lists, the fisrt one pulls data from a php script on a mysql database, and according to user's choice, it will update the second scroll list, then user will be asked to select something again, but this time in the 2nd scroll list, and again, according to user's choice, 3rd scroll list will be updated too.
Finally, when user choose a name from 3rd scroll list, it will load an external movieclip into stage, witch path is stored in database...

As I've tried to do so and wasn't able to, I'd like to know if there's a possibility to insert php code in movies, doing so it will (if possible) directly connect to dabase without external php files...

Thanks for replying.

War_Angel

MySQL
hello,
using Jeff's tutorial, I installed Apache, PHP and MySQL. But being a newbie, I am asking for help: could anybody give me links where I can easily learn how to use (win)MySQL(Admin)1.4 ???

Thanks a lot

Xml + Mx Vs. Php+mysql+mx
hello all.
I've been working with flash+ php+mysql for over 2 years, can get data from database, manipulate it any number of ways, bring it into flash to suit the needs of a particular project and so on.

I'd like to now get into doing the same sort of thing using xml+flash, but I think I'm missing some basics. Here are some basic questions to get me over this hump and I'll be on my way.

can xml be dynamically generated?
if so... using php to extract data, then form xml nodes to be imptoted into flash... isn't that just an extra step in the process?
if not... what advantages are there to using xml vs. php?

could someone give me an example of the power of using xml+flash that will make me think..." Damn, I really need to learn this... NOW. "

Thank you in advance for your time.

MySQL
hey, i am thinking of useing mySQL/php for a game but i know nothing of mySQL or php but it seems i need a program so i can use them, any files that are in php i can't even look at or read, what program do i need to be able to read them?

Mysql Php Help
Hi Everybody,
if anyone could help me, that would be great.
i setup a mysql server, and i have php that
i want to be working off that mysql. Is there
a config file where i specify that php is using
mysql...

thanks again,
Robert,,.

MySQL Help
I already have a database setup with the users for my website. There are many records in it. I am working on a full flash website. I already know how to display records in PHP but dont know how in flash mx. The one thing that i want to do is only display the most resent entry. Can someone help!

MYSQL/PHP Into AS3
How can I receive data from MYSQL/PHP into AS3.


PHP Code:




<?php

$host = "locahost";
$user = "<username>";
$pass = "<password>";
$db = "<database_name>";

$link = @mysql_connect($host, $username, $pass) or die(mysql_error());
mysql_select_db($db);

$query = "SELECT * FROM site";
$result = mysql_query($query);

while($row = mysql_fetch_object($result))
{
  echo $row->title;
}

?>







I need help creating the script to receive data.

Thanks

Php+mysql
hi everybody, i created a movieclip named "rectangle" and i must duplicate it and assign its clones x,y and aplha values from mysql
my communication page outputs this:


Code:
totale=4&x1=324&y1=345&alpha1=65&x2=656&y2=34&alpha2=32&x3=231&y3=12&alpha3=87&x4=976&y4=567&alpha4=51
in the first frame of the timeline i wrote this:


Code:
myvars = new LoadVars();
myvars.load("mypage.php");
myvars.onLoad = function(success) {
for (this.a=1; this.a<=this.totale; this.a++) {
_root."rectangle".duplicateMovieClip("rectangle"+this.a,1);
setProperty("rectangle"+this.a, _x, this["x"+this.a]);
setProperty("rectangle"+this.a, _y, this["y"+this.a]);
setProperty("rectangle"+this.a, _alpha, this["alpha"+this.a]);
}
};
..but it clones the movieclip only once (without setting its properties)..
what did i mess up?

Help With MySQL
To get to understand MySQL, I'm triyng to follow this tutorial:

http://www.actionscript.org/tutorial...QL/index.shtml

However, it gets stuck in the process - the votes are recorded in the database but the flash program cannot successfully go through the rest of the program, showing the results.

My setup is here:
http://www.emvee.net/calendar/Untitled-3.html

Anyone know what might be wrong?

Following is the coding:

Frame 1:

Code:
stop();
submit_btn.enabled = false;
var loadVars_in:LoadVars = new LoadVars();
var loadVars_out:LoadVars = new LoadVars();
loadVars_in.onLoad = function(success) {
if (success) {
//If the values are in goto results
gotoAndStop("result");
} else {
//notify of failure
}
};
// Does the user wants to vote?
listenerObject = new Object();
listenerObject.click = function(eventObject) {
submit_btn.enabled = true;
};
radioGroup.addEventListener("click", listenerObject);
//Vote
submit_btn.onRelease = function() {
var selectedNum:Number = radioGroup.selectedData;
loadVars_out.choice = selectedNum;
label.text = loadVars_out.choice
loadVars_out.sendAndLoad("vote.php", loadVars_in, "POST");
};
Frame 10 (it never reaches this frame)

Code:
//How many votes in total?
var totalVotes:Number = loadVars_in.totalVotes;
var end:String
for(i=1;i<=4;i++){
vote = loadVars_in["vote" + i + "total"]
percent = Math.round(( vote / totalVotes) * 100);
if(vote==1){
end = " Vote";
} else {
end = " Votes";
}
_root["graph"+i+"_mc"].bar_mc._xscale = percent;
_root["graph"+i+"_mc"].percent.text = percent + " % - " + vote + end;

}
vote.php

Code:
<?
//User, password & database
$choice =$_POST['choice'];
$user="my username blanked out";
$password="my password blanked out";
$database="my database name blanked out";
mysql_connect("localhost",$user,$password);
@mysql_select_db($database) or die( "Unable to connect to database");
// what choice did the user choose in flash?
if($choice == 1){
$query="UPDATE votesystem SET vote1=vote1+1";
}
if($choice == 2){
$query="UPDATE votesystem SET vote2=vote2+1";
}
if($choice == 3){
$query="UPDATE votesystem SET vote3=vote3+1";
}
if($choice == 4){
$query="UPDATE votesystem SET vote4=vote4+1";
}
mysql_query($query);
//Get values from the database
$query="SELECT * FROM votesystem";
$result=mysql_query($query);
mysql_close();
//What are the values from the database?
$vote1_out=mysql_result($result,0,"vote1");
$vote2_out=mysql_result($result,0,"vote2");
$vote3_out=mysql_result($result,0,"vote3");
$vote4_out=mysql_result($result,0,"vote4");
//Votes in total
$total=$vote1_out+$vote2_out+$vote3_out+$vote4_out;
//Info to send back to flash:
$values="&totalVotes=$total&vote1total=$vote1_out&vote2total=$vote2_out&vote3total=$vote3_out&vote4total=$vote4_out";
echo "$values ";
?>
Thanks!

MySQL Vs. XML
I am planing to add a bus schedule to my site.
The way it would work is that a user selects a city, a schedule of departures, route, info (ex. weekday's only...) and bus company shows up.

All current text on my site is in xml files, so that I can update easily.

But for this section (communication) I am thinking of putting this info into MySQL into 4 tables (destination, route, info, bus_company)

Anyway is there an adventage of using a database for something like this, cause it seems to me that sticking to XML files would be better (easier to move files & make changes)

AS3 PHP MySQL
hi guys quick question,

building my first site in AS3, previous sites i've built have used a mySQL DB and php to deliver site content to flash and this was done with the 'LoadVars' class in AS2.

Has anyone done this in AS3 yet? i know they got rid of the 'LoadVars' class in AS3, and they now have the 'loader' class but has anyone read in variables from a php file without it being formated in XML?

eg. php page displays "&myVar1=this&myVar2=that"

is there a new way to do this?

Using AS3 And PHP/MySQL Together ? HOW ?
Ok here is my pain , and i believe not just mine but one that could once fixed help many people ... i am trying for example to create a website which needs quite a big database ... so i need MySQL .But the problem is that AS3 cannot directly operate MySQL databases as PHP. What i want to do is after collecting the data in flash and having the data i need in variables in AS3 i need then to pass them to a PHP which can then operate with the database and pass data back to the AS so i can perform checks if someone has already created acc with that name or if two product serial numbers match or whatever.
What i mainly need is a way to pass variables from AS3 to PHP and back from the PHP to the AS.
Can someone please tell me how does this happen if it is possible or post a link for a tutorial or maybe a Skype MSN ICQ or MIRC channel where i can connect him to explain me or send data or a tutorial.
I will be really grateful if someone helps me with this issue and i will return the favour with as much as i can.

MySQL Without PHP?
Alright, I'm fairly certain this shouldn't be too hard to figure out, but I'm a bit tired (4 am) so the words in the help files are kindof lost on me atm... Might be able to work it out tomorrow.

But yea, onto my point. I'm fairly sure that there should be some way to grab data off a SQL server without using external scripting in this new version, what with all the different data handling things they've added, so does anybody have any good tips / tutorials / help about doing this?

I have no problem with writing the scripts in PHP if I have to, just want to get this thing as clean as humanly possible.. Thus as few files as I can manage. Also keeping it all in one file feels a bit more organized to me.

I have never in my years had to ask for help for Flash before so I'm sorry if I needed to say something more specific.. But I think it's understandable.

Thanks,
Jonas.

Some PhP MySQL Help...please
Okay i did the tutorial on PhP and MySQL but my problem is they use

if(_root.checklog == 1){
_root.gotoAndPlay(60);

but since i'm using extrenal swf's the "_root" comand doesn't refer to the external swf. But i'm using "_root" to call the new external files so i can't ancor the "_root" I've tried to change it to

if(_parent.checklog == 1){
_parent.gotoAndPlay(60);

but now nothing happens. I'm about sixty seconds from going postal on my computer trying to figure this one out. but i know when i do i'll be a lot happier. If you want to check out my work to see what i'm talking about go to,
www.versusmediagroup.com

under the client login page and you'll see what it looks like and how it doesn't do a thing. To get the fla files go to http://www.versusmediagroup.com/kirupa/

its the client.fla file.

Any help would be really great.
Thanks

MySQL Or XML
I'm looking for recommendations on whether it's easier/better to get Flash to interact with a MySQL database or XML. Basically, I'm trying to develop some simple (and minimally animated) slides involving a list of words and their frequencies (number of occurrances). Ultimately, the Flash script needs to be able to call each word in the list, then size the word and a bubble relative to the number of occurances. Simple, right? Problem is that I'm not zippy with feeding the data into a script. I can handle simple flash animations and such, but I'd be grateful for any recommendations about how best to proceed.

Thanks!

MySQL Without PHP?
hi,

can i get data from a mySQL database without using a PHP-file?

thanks!

[AS][PHP][MYSQL]Something Big, Can You Help Me?
Hello,

I have a big problem and i don't know what is wrong! This problem sounds like this:
---------------------------------A little description of the site.
I have a main movie where i have 4 movieClips (with the instance name: home_mc, club_mc, gute_mc and stuff_mc), initial they are invisible (ex: home_mc._visible = false and when i click a button the movieClip assign to that button will become visible.
I have in every movieClip some text areas(input and dynamically), datagrids and button and in action layer i have #include "*.as" (* = the name of the movieClip; home has home.as, club has club.as etc)
Here are the actionscript files:
Main.as

ActionScript Code:
//Site initial property.home_mc._visible = false;club_mc._visible = false;gute_mc._visible = false;stuff_mc._visible = false;kontakt_mc._visible = false;news_mc._visible = false;adver_mc._visible = false;//Initial Animation Components////Tween First View.import mx.transitions.Tween;import mx.transitions.easing.*;var tw:Tween = new Tween (main_headline, "_xscale", Elastic.easeOut, 0, 100, 3, true);var tw1:Tween = new Tween (main_headline, "_yscale", Elastic.easeOut, 0, 100, 3, true);//Button Textsbtn_home.button_text_mc.button_text.text = "Home";btn_club.button_text_mc.button_text.text = "Club";btn_gute.button_text_mc.button_text.text = "gute Scheiben";btn_stuff.button_text_mc.button_text.text = "DJ Stuff";btn_kontakt.button_text_mc.button_text.text = "Kontakt";btn_news.button_text_mc.button_text.text = "News/Specials";btn_adver.button_text_mc.button_text.text = "Advertising";//Button Actionscriptbtn_home.onRelease = function () {    //Tween Home Mc    var tween_home = new Tween (home_mc, "_xscale", Elastic.easeOut, 0, 100, 1, true);    var tween_home1 = new Tween (home_mc, "_yscale", Elastic.easeOut, 0, 100, 1, true);    var tween_home2 = new Tween (home_mc, "_alpha", Elastic, easeInOut, 0, 100, 1, true);    //*    //    home_mc._visible = true;    loadMovie(home_mc);    //    club_mc._visible = false;    club_mc.unloadMovie();    gute_mc._visible = false;    gute_mc.unloadMovie()    stuff_mc._visible = false;    stuff_mc.unloadMovie()    kontakt_mc._visible = false;    kontakt_mc.unloadMovie()    news_mc._visible = false;    news_mc.unloadMovie()    adver_mc._visible = false;    adver_mc.unloadMovie()};btn_club.onRelease = function () {    //Tween Club Mc    var tween_club = new Tween (club_mc, "_xscale", Elastic.easeOut, 0, 100, 1, true);    var tween_club1 = new Tween (club_mc, "_yscale", Elastic.easeOut, 0, 100, 1, true);    var tween_club2 = new Tween (club_mc, "_alpha", Elastic, easeInOut, 0, 100, 1, true);    //*    home_mc._visible = false;    home_mc.unloadMovie();    //    club_mc._visible = true;    loadMovie(club_mc);    //    home_mc._visible = false;    home_mc.unloadMovie();    stuff_mc._visible = false;    stuff_mc.unloadMovie()    kontakt_mc._visible = false;    kontakt_mc.unloadMovie()    news_mc._visible = false;    news_mc.unloadMovie()    adver_mc._visible = false;    adver_mc.unloadMovie()};btn_stuff.onRelease = function () {    //Tween Stuff Mc    var tween_stuff = new Tween (stuff_mc, "_xscale", Elastic.easeOut, 0, 100, 1, true);    var tween_stuff = new Tween (stuff_mc, "_yscale", Elastic.easeOut, 0, 100, 1, true);    var tween_stuff = new Tween (stuff_mc, "_alpha", Elastic, easeInOut, 0, 100, 1, true);    //*    home_mc._visible = false;    home_mc.unloadMovie();    club_mc._visible = false;    club_mc.unloadMovie()    home_mc._visible = false;    home_mc.unloadMovie();    //    stuff_mc._visible = true;    //    kontakt_mc._visible = false;    kontakt_mc.unloadMovie()    news_mc._visible = false;    news_mc.unloadMovie()    adver_mc._visible = false;    adver_mc.unloadMovie()};btn_gute.onRelease = function () {    //Tween Stuff Mc    var tween_gute = new Tween (gute_mc, "_xscale", Elastic.easeOut, 0, 100, 1, true);    var tween_gute = new Tween (gute_mc, "_yscale", Elastic.easeOut, 0, 100, 1, true);    var tween_gute = new Tween (gute_mc, "_alpha", Elastic, easeInOut, 0, 100, 1, true);    //*    home_mc._visible = false;    home_mc.unloadMovie();    club_mc._visible = false;    club_mc.unloadMovie()    //    gute_mc._visible = true;    //    stuff_mc._visible = false;    stuff_mc.unloadMovie()    kontakt_mc._visible = false;    kontakt_mc.unloadMovie()    news_mc._visible = false;    news_mc.unloadMovie()    adver_mc._visible = false;    adver_mc.unloadMovie()};


*****************************

Home.as

ActionScript Code:
stop ();//save_home.button_text_mc.button_text.text = "Submit to Home";see_home.button_text_mc.button_text.text = "See Home site";//see_home.onPress = function () {    loadText = new LoadVars ();    loadText.load ("home.txt");    loadText.onLoad = function () {        current_home.text = this.home;    };};//save_home.onRelease = function () {    getURL ("home.php", _blank, "POST");};


*****************************

Club.as

ActionScript Code:
//Show Database in the Data Grid.club_parseXML = function () {    if (myXML.hasChildNodes) {        //  we check if this xml has children just to be sure        var xmlRootNode = myXML.firstChild.childNodes;        // define the root of the xml file for easy navigation        for (var i = 0; i<xmlRootNode.length; i++) {            // now loop through the xml and fill our dataArray with objects            var thisNode = xmlRootNode[i];            if (thisNode != null) {                var strid = thisNode.childNodes[0].firstChild.nodeValue;                var strpic = thisNode.childNodes[1].firstChild.nodeValue;                var strtext = thisNode.childNodes[2].firstChild.nodeValue;                var strlink = thisNode.childNodes[3].firstChild.nodeValue;                // here we go, creating an object instantly and adding it to our container                arrDataGrid.push({ID:strid, Pic:strpic, Text:strtext, Link:strlink});            }        }    }    // this is where the magic is, link the filled array to the datagrid..... that's it!    // you'll have full control over what comes in to you grid! Great ain't it ;)    club_dg.dataProvider = arrDataGrid;};club_loadXML = function () {    arrDataGrid = new Array();    // will contain the data for the grid    myXML = new XML();    // loads the xml in memory    myXML.ignoreWhite = true;    // ignore enters and whitespace in xml file    myXML.onLoad = club_parseXML;    // reference to the function above    myXML.load("club_db.xml");    // the actual command which will load the xml file};//Finish Load Database in Data Grid.//*//Initial propertys.club_dg._visible = false;refresh_club._visible = false//*//Ckeck Box'es.// create event listener object for checkboxclubbox = new Object();// click event handlerclubbox.click = function() {    if (club_db.selected) {        club_dg._visible = true;        refresh_club._visible = true;        club_loadXML();    } else {        club_dg._visible = false;        refresh_club._visible = false;    }};// register the event listenerclub_db.addEventListener("click", clubbox);refresh_club.onPress = function () {    club_loadXML();}//Finish Show Database AS.//*//Remove ID MCremove_id_head._visible = false;remove_id_head2._visible = false;remove_id_input._visible = false;remove_club._visible = false;//// Check Boxremove_club_ac = new Object();// click event handlerremove_club_ac.click = function() {    if (remove_club_mc.selected) {        remove_id_head._visible = true;        remove_id_head2._visible = true;        remove_id_input._visible = true;        remove_club._visible = true;    } else {        remove_id_head._visible = false;        remove_id_head2._visible = false;        remove_id_input._visible = false;        remove_club._visible = false;    }};// register the event listenerremove_club_mc.addEventListener("click", remove_club_ac);///*//Alertimport mx.controls.Alert;// Define action after alert confirmation.var alertHandler:Function = function (evt_obj:Object) {    if (evt_obj.detail == Alert.YES)    {        getURL ("delete_club.php", _blank, "POST");    }};// Show alert dialog box.remove_club.onPress = function () {    var club_alert:Alert = Alert.show ("Do you want to remove ID:  " + remove_id_input.text + "?", "Validation Alert!", Alert.YES | Alert.NO, this, alertHandler, Alert.YES);    club_alert._x = 384.4;    club_alert._y = 334.5;};

*****************************

Gute.as

ActionScript Code:
//Show Database in the Data Grid.gute_parseXML = function () {    if (myXML.hasChildNodes) {        //  we check if this xml has children just to be sure        var xmlRootNode = myXML.firstChild.childNodes;        // define the root of the xml file for easy navigation        for (var i = 0; i<xmlRootNode.length; i++) {            // now loop through the xml and fill our dataArray with objects            var thisNode = xmlRootNode[i];            if (thisNode != null) {                var strid = thisNode.childNodes[0].firstChild.nodeValue;                var strpic = thisNode.childNodes[1].firstChild.nodeValue;                var strtext = thisNode.childNodes[2].firstChild.nodeValue;                var strlink = thisNode.childNodes[3].firstChild.nodeValue;                // here we go, creating an object instantly and adding it to our container                arrDataGrid.push({ID:strid, Pic:strpic, Text:strtext, Link:strlink});            }        }    }    // this is where the magic is, link the filled array to the datagrid..... that's it!    // you'll have full control over what comes in to you grid! Great ain't it ;)    gute_dg.dataProvider = arrDataGrid;};gute_loadXML = function () {    arrDataGrid = new Array();    // will contain the data for the grid    myXML = new XML();    // loads the xml in memory    myXML.ignoreWhite = true;    // ignore enters and whitespace in xml file    myXML.onLoad = gute_parseXML;    // reference to the function above    myXML.load("gute_db.xml");    // the actual command which will load the xml file};//Finish Load Database in Data Grid.//*//Initial propertys.gute_dg._visible = false;refresh_gute._visible = false//*//Ckeck Box'es.// create event listener object for checkboxgutebox = new Object();// click event handlergutebox.click = function() {    if (gute_db.selected) {        gute_dg._visible = true;        refresh_gute._visible = true;        gute_loadXML();    } else {        gute_dg._visible = false;        refresh_gute._visible = false;    }};// register the event listenergute_db.addEventListener("click", gutebox);refresh_gute.onPress = function () {    gute_loadXML();}//Finish Show Database AS.//*//Remove ID MCremove_id_head._visible = false;remove_id_head2._visible = false;remove_id_input._visible = false;remove_gute._visible = false;//// Check Boxremove_gute_ac = new Object();// click event handlerremove_gute_ac.click = function() {    if (remove_gute_mc.selected) {        remove_id_head._visible = true;        remove_id_head2._visible = true;        remove_id_input._visible = true;        remove_gute._visible = true;    } else {        remove_id_head._visible = false;        remove_id_head2._visible = false;        remove_id_input._visible = false;        remove_gute._visible = false;    }};// register the event listenerremove_gute_mc.addEventListener("click", remove_gute_ac);///*//Alertimport mx.controls.Alert;// Define action after alert confirmation.var alertHandler:Function = function (evt_obj:Object) {    if (evt_obj.detail == Alert.YES)    {        getURL ("delete_gute.php", _blank, "POST");    }};// Show alert dialog box.remove_gute.onPress = function () {    var gute_alert:Alert = Alert.show ("Do you want to remove ID:  " + remove_id_input.text + "?", "Validation Alert!", Alert.YES | Alert.NO, this, alertHandler, Alert.YES);    gute_alert._x = 384.4;    gute_alert._y = 334.5;};


*****************************

Stuff.as is the same like Club and Gute, only that instead of club or gute i stuff.


Here is the PHP code for the home, and club(the gute and stuff are the same, instead of club i have gute and stuff, and the link of the text input area and variable are ok)
Home.php

PHP Code:



<?PHP$text = $_POST['input_home_text'];$fol = fopen ("home.txt",w);$sentOk = fwrite ($fol,"home=".$text);?>




*****************************

Club.php (submit_club.php)

PHP Code:



<?php//CLUB PHP SCRIPT////Variabile Flash.$locatie = $_POST['town'];$nume = $_POST['name'];$url = $_POST['link'];$id = $_POST['id_update'];//Variabile Locale.$username = "root";$password = "";$database = "electrotown";//Connectare la Database.$connect = mysql_connect("localhost",$username,$password) or trigger_error(mysql_error(),E_USER_ERROR);mysql_select_db($database);//Updatare Database.$update = "UPDATE club SET oras = '$locatie', nume = '$nume', link ='$url' WHERE id = '$id'" or die(mysql_error());mysql_query($update);//Scriere XML.$query = mysql_query("SELECT * FROM club ORDER BY id ASC");$xml = "<data>
";while ( $i = mysql_fetch_array($query)) {$xml = $xml . " <row>
";$xml = $xml . " <id>";$xml = $xml . $i['id'];$xml = $xml . "</id>
";$xml = $xml . " <oras>";$xml = $xml .$i['oras'];$xml = $xml . "</oras>
";$xml = $xml . " <nume>";$xml = $xml .$i['nume'];$xml = $xml . "</nume>
";$xml = $xml . " <link>";$xml = $xml .$i['link'];$xml = $xml . "</link>
";$xml = $xml . " </row>

";}$xml = $xml . "</data>";$fol = fopen("club_db.xml",w);$fold = fwrite($fol,$xml);//Scriere mesaj.echo "<center><font size = 3>Datele au fost updatate cu succes in:<b> ".$database."</b>.</font></center><br>";echo "<center>Datele: <b>".$locatie." </b>, <b>".$nume."</b> , <b>".$url."</b> au fost updatate in database-ul: <b>".$database."</b>.</center>";//Inchidere XML si Database.fclose ($fol);mysql_close($connect);?><script language="javascript">window.close();</script>



*****************************

Club.php (update_club.php)

PHP Code:



<?php//CLUB PHP SCRIPT////Variabile Flash.$locatie = $_POST['town'];$nume = $_POST['name'];$url = $_POST['link'];$id = $_POST['id_update'];//Variabile Locale.$username = "root";$password = "";$database = "electrotown";//Connectare la Database.$connect = mysql_connect("localhost",$username,$password) or trigger_error(mysql_error(),E_USER_ERROR);mysql_select_db($database);//Updatare Database.$update = "UPDATE club SET oras = '$locatie', nume = '$nume', link ='$url' WHERE id = '$id'" or die(mysql_error());mysql_query($update);//Scriere XML.$query = mysql_query("SELECT * FROM club ORDER BY id ASC");$xml = "<data>
";while ( $i = mysql_fetch_array($query)) {$xml = $xml . " <row>
";$xml = $xml . " <id>";$xml = $xml . $i['id'];$xml = $xml . "</id>
";$xml = $xml . " <oras>";$xml = $xml .$i['oras'];$xml = $xml . "</oras>
";$xml = $xml . " <nume>";$xml = $xml .$i['nume'];$xml = $xml . "</nume>
";$xml = $xml . " <link>";$xml = $xml .$i['link'];$xml = $xml . "</link>
";$xml = $xml . " </row>

";}$xml = $xml . "</data>";$fol = fopen("club_db.xml",w);$fold = fwrite($fol,$xml);//Scriere mesaj.echo "<center><font size = 3>Datele au fost updatate cu succes in:<b> ".$database."</b>.</font></center><br>";echo "<center>Datele: <b>".$locatie." </b>, <b>".$nume."</b> , <b>".$url."</b> au fost updatate in database-ul: <b>".$database."</b>.</center>";//Inchidere XML si Database.fclose ($fol);mysql_close($connect);?><script language="javascript">window.close();</script>



*****************************

Club.php (delete_club.php)

PHP Code:



<?php//CLUB PHP SCRIPT////Variabile Flash.$id = $_POST['id_remove'];//Variabile Locale.$username = "root";$password = "";$database = "electrotown";//Connectare la Database.$connect = mysql_connect("localhost",$username,$password) or trigger_error(mysql_error(),E_USER_ERROR);mysql_select_db($database);//Stergere ID din Database.//"DELETE FROM gute WHERE id = '$id'" or die(mysql_error());$delete = "DELETE FROM club WHERE id = '$id'" or die(mysql_error());mysql_query($delete);//Scriere XML.$query = mysql_query("SELECT * FROM club ORDER BY id ASC");$xml = "<data>
";while ( $i = mysql_fetch_array($query)) {$xml = $xml . " <row>
";$xml = $xml . " <id>";$xml = $xml . $i['id'];$xml = $xml . "</id>
";$xml = $xml . " <oras>";$xml = $xml .$i['oras'];$xml = $xml . "</oras>
";$xml = $xml . " <nume>";$xml = $xml .$i['nume'];$xml = $xml . "</nume>
";$xml = $xml . " <link>";$xml = $xml .$i['link'];$xml = $xml . "</link>
";$xml = $xml . " </row>

";}$xml = $xml . "</data>";$fol = fopen("club_db.xml",w);$fold = fwrite($fol,$xml);//Scriere mesaj.echo "<center><font size = 3>ID-ul:<b> ".$id."</b> a fost sters din Database.</font></center><br>";//Inchidere XML si Database.fclose ($fol);mysql_close($connect);?><script language="javascript">window.close();</script>



*****************************


When access a page (club_mc for exemple) and i write something everything goes ok, BUT when i access the second page (gute_mc) and i write something and i click SUBMIT the PHP is opened in a new window (this is ok) but nothing is writen down in the database, then the site is crashed!!!

Can you help me, you can see the exemple here:
http://www.electrotown.de/test

Thank you in advanced, Tiberiu!

Php,mysql
hello all,

i am trying to connect php to a mysql database by doing the following:

$con = mysql_connect("localhost:8080","username","passwor d");

when i try to run the php file in the browser it takes forever to load.

What could be the problem? and what am i doing wrong.

i created the database with mysql in xampp. pls help me out.

thanx
korkor5

XML Vs/or/and MySQL
Hi all,

I have a flash page which contains products, each product has the same heading, i.e. Price, Description, Availability... If I were doing this without Flash normally I'd build a PHP page and use a MySQL database... This still seems like the best option to me even in Flash, although a few people have told me I should set up a XML file which I can change and that would update the images and text, but isn't that why I would have a MySQL database? Wouldn't I change it on the server side and Flash would update it that way?

Not really understanding why we need XML and and how it benefits us when we could be using a MySQL db...

Thanks all in advance!

AS PHP/MYSQL Help
Hi,

I'm just beginning to work on flash and actionscript. I just finished working on a simple quiz game and I'd like to integrate with a current php/mysql script. How can I send/pass the score variable from the flash quiz to a php page so I can add the points to the user? thanks

AS3 Php Mysql
I am curious what the differences are from using AMFPHP and peakstudios.com as2 or AS3 flash panel extension (I use a MySQL database)?
I know the flash panel and use it all the time but there is a ton of tips on AMFPHP on the internet and not as many about the flash panel I use.

Does AMFPHP build the PHP code for you like the extension panel does?
Does AMFPHP run inside of flash like the flash extension panel?
Does AMFPHP it create classes for you?
Does AMFPHP allow you to access databases?

If there is anyone out there that has used both it would be great to know what features it has in comparison so i know when it would be beneficial to use? I have copied and pasted what the flash extension panel does bellow so please let me know if there are other functions that AMFPHP so i can use it too!


Quote:




Features include:
New features include:
•New - Test your code in the Flash IDE.
•New - Code is interchangeable between the ASP and PHP extensions by simply changing the class import from asp.* to php.*.
•New in 2.1 - Use Join, Union or Aliases in your table variable
•New in 2.1 - where clause operators can be used in like array =, <>, < , >, < =, >=, =, <>, >, < , <=, >=, BETWEEN, LIKE, IN. You can put TABLE (i.e =TABLE) after any of the operators to use a table field in the what array value. This upgrade adds functionality to select, update and delete classes.
•New in 2.1 - Code is generated into functions.
The Flash PHP MySQL Flash panel extension creates:
•Copy and paste capabilities which include, select, insert, update and delete functions for AS2 & AS3
•Embedded Peak Studios AS2 & AS3 classes
•PHP files for MySQL connection and queries
•A simple publish profile
This is a very easy extension to use. Once you start using it, it will save you hours of time connecting your database to Flash. The panel generates the code , and you simply paste the code into your actions layer. Therefore, the only thing you need to do is set the input data in simple arrays and tell the return function what to do with your results.

Php? MySQL?
I don't know if this is really the right forum for this question, but here we go...

Basicly i am completely confused with the terms php, and MySQL..
Well i have an idea of what they are, but could anyone direct me to a site, a tutorial, maybe an intro to php, my MySQL 101..something basic? i don't really know how to work with, edit, or use either..

MySQL Without PHP?
Alright, I'm fairly certain this shouldn't be too hard to figure out, but I'm a bit tired (4 am) so the words in the help files are kindof lost on me atm... Might be able to work it out tomorrow.

But yea, onto my point. I'm fairly sure that there should be some way to grab data off a SQL server without using external scripting in this new version, what with all the different data handling things they've added, so does anybody have any good tips / tutorials / help about doing this?

I have no problem with writing the scripts in PHP if I have to, just want to get this thing as clean as humanly possible.. Thus as few files as I can manage. Also keeping it all in one file feels a bit more organized to me.

I have never in my years had to ask for help for Flash before so I'm sorry if I needed to say something more specific.. But I think it's understandable.

Thanks,
Jonas.

Some PhP MySQL Help...please
Okay i did the tutorial on PhP and MySQL but my problem is they use

if(_root.checklog == 1){
_root.gotoAndPlay(60);

but since i'm using extrenal swf's the "_root" comand doesn't refer to the external swf. But i'm using "_root" to call the new external files so i can't ancor the "_root" I've tried to change it to

if(_parent.checklog == 1){
_parent.gotoAndPlay(60);

but now nothing happens. I'm about sixty seconds from going postal on my computer trying to figure this one out. but i know when i do i'll be a lot happier. If you want to check out my work to see what i'm talking about go to,
www.versusmediagroup.com

under the client login page and you'll see what it looks like and how it doesn't do a thing. To get the fla files go to http://www.versusmediagroup.com/kirupa/

its the client.fla file.

Any help would be really great.
Thanks

XML Or MySQL For My RIA
I'm planning on developing a notepad type application in Flash similar to that of Yahoo! mail. All it needs to do is store the user's note and there is a category system so that they can file their notes.

My question is how do I store the data? If I use a single XML file that file could end up getting quite large if I allow multiple users to access the system and work off of the same XML file. Or should I use MySQL to store the data and talk back and forth via scripts? Thanks.

Wayward780

Mysql Through PHP Or XML
Hi,
i wonder what the best option would be:
1- fetch data from an mysql database in PHP and parse the values into flash
2- or to generate xml files with PHP using the mysql data and use a flash xml connector?

Thanks a bunch

PAtrick

Mysql
This is very important for me.
Can anyone tell me how to retrieve the results from mysql and send them to flash using php

MYSQL
Hello all

I have use PHP Object to allow Flash to obtain information from a MYSQL database. No problem, It all works very well.

The problem I am having is "how do i get flas to recall a image LOCATION from flah. I do not wish to store a image in flash rather redirect it to a folder.

Here is the code recalling text.

+++++++++++++++++++++
#include "PHPObject.as"
tmp = new PHPObject();
tmp.setDefaultGatewayKey("secret");
// CHANGE THIS TO
// WHATEVER SECRET KEY YOU SET IN Gateway.php
tmp.setDefaultGatewayUrl("http://192.168.0.101/testing/Gateway.php");
// CHANGE THIS
// TO WHERE YOU PLACE Gateway.php
delete tmp;
myFoo = new PHPObject("cards");
// declare a new object and link it to a remote PHP class
// set up responder
myFoo.getcard_onResult = function(result) {
    id.text = result[0];
    id1.text = result[1];
    image.text = result[2];
};
// invoke method
myFoo.getcard("1");
++++++++++++++++


can any one help please or point me in the right direction

Mysql
Simple question can flash talk to it (mysql not sql) and if so how?

Z

XML Vs/or/and MySQL
Hi all,

I have a flash page which contains products, each product has the same heading, i.e. Price, Description, Availability... If I were doing this without Flash normally I'd build a PHP page and use a MySQL database... This still seems like the best option to me even in Flash, although a few people have told me I should set up a XML file which I can change and that would update the images and text, but isn't that why I would have a MySQL database? Wouldn't I change it on the server side and Flash would update it that way?

Not really understanding why we need XML and and how it benefits us when we could be using a MySQL db...

Thanks all in advance!

MYSQL/PHP Into AS3
How can I receive data from MYSQL/PHP into AS3.

Code:

<?php

$host = "locahost";
$user = "<username>";
$pass = "<password>";
$db = "<database_name>";

$link = @mysql_connect($host, $username, $pass) or die(mysql_error());
mysql_select_db($db);

$query = "SELECT * FROM site";
$result = mysql_query($query);

while($row = mysql_fetch_object($result))
{
  echo $row->title;
}

?>


I need help creating the script to receive data.

Thanks

MySQL
Hi all,
Okay, so I got my hoster now, and I'm trying to create Hasan's guestbook. I have create everything else, but not MySQL database, course I'm logged in, and there's 'Create new database' part, but there I have under that following text, "No Privileges". And I don't know what's going on. Can someone help me?

Thank you,
Kr4zY

Blog Using PHP/MySql
I'm trying to create my own blog system to use in a flash movie using PHP/MySql. Does anyone know of some tips or tutorials on blogs? Also, I am trying figure out how to return a result from a PHP script back to a movie. I know how to send info from a movie to a script, but how do I return that information back to the same movie? Thanks,

PHP + Mysql Ind Flash 5
Hey there, this is very important for me, so pleeeaaaaaseeeeee.....
I have a question concerning php4 and mysql.
Is there a possibility to use flash to get information or better to say databases from mysql and display, delete, change and use them through flash 5 in a swf-file (maybe as variables)?
And can I use php to write it into a mysql-database and use it in flash 5?
thanx a lot
jean3k

About MySQL And Apache
I'm not sure who it was but someone helped me an suggested that i use MySQL for databasing and use Apache as a server. Heres the thing. I have two questions, one for each subject. Wil i have to pay for MySQL? and how does it work? do i set it up on my computer like i would with Apache or is it somthing that i log on to and upload my info and then link to it with other programming languages?

Now about the Apache. Can someone please find the right link to download the lastest Apache server? I looked and there are so many different things and versions and i don't know. The site has sections for different programming languages lile PHP and Perl and what not. does this mean i have to download a specific version to install. I need this to work with Windows Me too. Also. Ome more thing.

does anyone know a good host to host my sites that excepts php, cgi/perl,asp, and all that good stuff? Oh and, when i install a server on my computer, can i actually give people the address and as long as i'm connected to the internet have it able to be viewed?

Any info would be appreciates. Thank you

Flash And MySQL
Can Flash be used with a MySQL database?

Flash5+php+mysql+xml
Hi!

How do you send a variable between 2 swf's via php-script?

On key "<enter>" a variable fx the 'id' of the chosen menu is sent to the php-script. The script selects data from the database given this variable or 'id'(select data from table where id=$id) and generates an xml document, which data is presented in Flash.

Now, I need this same variable in the next swf. My problem is that when I load the next swf using the loadMovie, the variable can no longer be accessed.

I can understand the logic in a way, but how do I make this variable persistent so that it can be accessed by all the swf's that need it?

I hope someone can help me. I'm pretty stuck ;-(

Thanks,
Cathy

Copyright © 2005-08 www.BigResource.com, All rights reserved