Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

Flash and PHP

This is a discussion on Flash and PHP within the PHP | mySQL | Flash CS3 forums, part of the Flash CS3 eng category; hi, i need some some help with integrating flash and php.....basically i got records in mysql and i want ...


Go Back   Forum Flash CS3 Flash CS4 > English Forums > Flash CS3 eng > PHP | mySQL | Flash CS3

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 19-03-08, 18:03
Junior Member
 
Join Date: Mar 2008
Posts: 5
Rep Power: 0
moe122 is on a distinguished road
Flash and PHP

hi,
i need some some help with integrating flash and php.....basically i got records in mysql and i want to display them with a flash interface.....i've tried many tut out there but cant get any of them to work fully. i would appreciate it if you could help. thankyou

moe
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2 (permalink)  
Old 20-03-08, 07:32
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Re: Flash and PHP

Hi and welcome

I'd start to think this:
- how many data do I have to pass from DB to Flash ?
If it's a lot of data, I would write an XML with PHP and load it with Flash.
Otherwise if the data is just 3 or 4 values, you can use this solution:

Flash CS3 and PHP
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #3 (permalink)  
Old 20-03-08, 18:28
Junior Member
 
Join Date: Mar 2008
Posts: 5
Rep Power: 0
moe122 is on a distinguished road
Re: Flash and PHP

wel were talking a lot of records......so it would probably have to be the xml route.....i've tried a few tuturials.....which i've found from various sites.....the one i used was just php straight to flash and the problems i was having was that:
1) say i write &username=$username in php and then defined $username= "bla bla" in flash i get in the box $username instead of "bla bla" and that happens if i view the file from C:// and then the folder...
2) but if i view it straight up on http;//localhost.....it is now undefined but for a split second which i had to record as a movie and then watch you get an error saying something like level0....whats up with that?


also what is the best method to use?
actionscript2.0 or 3.0?
and i dont really want to be relying on like another program, because i want to keep it simple....

and finally thanx for the swift reply....appreciate it...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #4 (permalink)  
Old 24-03-08, 09:20
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Re: Flash and PHP

I would use Actionscript 3.0 .
I think, you can download the FlepStudio Flash guestbook and watch how I call PHP and PHP returns me an XML that I load to get the values.

Here is the guestbook:

http://www.flepstudio.org/forum/down...?do=file&id=95
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #5 (permalink)  
Old 25-03-08, 17:38
Junior Member
 
Join Date: Mar 2008
Posts: 5
Rep Power: 0
moe122 is on a distinguished road
Re: Flash and PHP

hey, i looked at that and it just looks to complicated, i want to keep it simpleso that later on when i come back to it, it is not a scary site.....well anyways i've done the following...where i have a php script and then a flash file, in the php i have an array which i can get to flash but after that do not know what to do with it.....how do i split it up and maybe assign values to it so i can load each bit to a different part of the flash layout ive got?

PHP Code:
<?php
require_once("Connections/Connection.php"); // Database Connection
/////
$query sprintf("SELECT * FROM clients");
$result = @mysql_query($query);
$row = @mysql_fetch_array($result);
/////
do{
$Username []=$row["Username"]."-";
}while (
$row mysql_fetch_array($result));
print_r($Username);
echo
"&Username=$Username";
?>
flash code
Code:
onClipEvent (load) {
// first we make a new loadvars object to hold the variables that are being loaded from the php filr
Profiles=new LoadVars();
//this is the part where we execute the function that handles the loaded data
Profiles.onLoad=function(){
 placeTheDataIntoTheRightPlace();//call the function
};
//here we load in the php file, make sure you set the right path to your file
Profiles.load("Profiles.php");
//this is the function that handles the data.
//the variables now sorta live in the loadVars object we set named myData
//So we can call em like myData.myVariableInthePhpPrintedString
//just look at the script and whatch carefullt how its being called and it should become clear to ya.  
placeTheDataIntoTheRightPlace = function(){
_level0.b1.Username=Profiles.Username;
_level0.b2.Username=Profiles.Username;
_level0.b3.Username=Profiles.Username;
_level0.b4.Username=Profiles.Username;
_level0.b5.Username=Profiles.Username;
_level0.b6.Username=Profiles.Username;
_level0.b7.Username=Profiles.Username;
_level0.b8.Username=Profiles.Username;
_level0.b9.Username=Profiles.Username;
_level0.b10.Username=Profiles.Username;

}}
so basically i want flash to get the array and split into values and carry on putting them into each b1,b2 etc...also thats limited to ten, im going to have a next page, how can i do the same again but this time start from where i left off?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Flash Multi Gallery
  #6 (permalink)  
Old 27-03-08, 10:33
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Re: Flash and PHP

You need to write an XML with PHP with the results of the query.
After that load the XML into Flash
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #7 (permalink)  
Old 27-03-08, 13:35
Junior Member
 
Join Date: Mar 2008
Posts: 5
Rep Power: 0
moe122 is on a distinguished road
Re: Flash and PHP

cant i load the php straight into flash? and could i get some help with the coding please?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #8 (permalink)  
Old 28-03-08, 07:32
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Re: Flash and PHP

I am not that good at PHP writing XML.
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #9 (permalink)  
Old 05-06-08, 09:59
Junior Member
 
Join Date: Mar 2008
Posts: 3
Rep Power: 0
Math is on a distinguished road
Re: Flash and PHP

Actually writing XML with PHP is quite easy. Only thing you need to watch is that you got all inside it you need. And when you write it to an .xml extension...then its xml...
If any problems reply and ill get an example inhere...

Happy XML-ing ;-)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:17.


Powered by vBulletin versione 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC4
Forum SiteMap


FlepStudio
by Filippo Lughi
P.IVA 03605860406