Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > Adobe Web Programming > Flash (all versions)
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Flash (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 19th, 2005, 05:24 PM
Authorized User
 
Join Date: May 2005
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default flash and PHP.. somebody please help

Hi,

After getting to grips with programming in php,mysql and combining it with html, i am now having a little difficulty in grasping, how flash works with php.. I have followed many tutorials and books, but still i cannot understand how php send data back to flash


Here is my code:
in flash

_root.loggedIn=false;



sym.onEnterFrame=function()
{
_root.LoginApplication.Login.submit.onPress = function()
{


//connect to database
var ab = new LoadVars ();
ab.username = this._parent.username.text;
ab.pass = this._parent.pass.text;
ab.onLoad= validate;
ab.sendAndLoad ('http://www.jsten.com/flash_login.php', ab, "POST");


function validate()
{

if(this.output=='success')
{
trace("success");
sym._alpha=0;
}

if (this.output=="fail")
{
sym._alpha=0;
}


}
}
}



and simply in the flash_login.php file is one line for now:

echo("output=success");

From what i understand, the flash file should simply access this php file on submit button press, and then the 'output=success' returned, whereby flash then prints a trace to the screen, for my benefit, to say that it has worked.

Except it doesnt.....

Please can someone explain what im doing wrong

Thanks
Steve
Reply With Quote
  #2 (permalink)  
Old May 20th, 2005, 09:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Oklahoma City, Oklahoma, USA.
Posts: 249
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Steve
If you go to the Flash help and search in actionscript dicitionary sendandload there at the bottom it tells you where a sample is of login.fla the only difference is they are sending to a coldfusion file.

Here is a tutorial that explains using the sendandload and how to send back the php content
http://actionscript-toolbox.com/samplemx_loadvars.php

These 2 samples can explain it a lot better and in more detail than I could. If you have any questions on these let me know.






Peace
Mike
http://www.eclecticpixel.com
http://www.homegrownmusicjam.com
Reply With Quote
  #3 (permalink)  
Old May 20th, 2005, 05:21 PM
Authorized User
 
Join Date: May 2005
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Thanks for the reply.

I figured out what it was and it doesnt really make any sense. My domain is registered as jsten.co.uk, but i have also jsten.com which directs to it.

You will notice in the url, that i am using jsten.com.... and this is what caused the problem. I changed it to jsten.co.uk, and now i can access the php fine.

This must be some kind of bug...i will contact my host on Monday, to ask why using com would be causing a problem

Thanks
Steve

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to modify flash so it pulls php url every 15 s method Flash (all versions) 4 February 27th, 2007 06:19 PM
PHP Flash communicatie Dj Kat Flash (all versions) 2 May 18th, 2006 04:18 AM
PHP Mysql with Flash based display robprell Beginning PHP 0 November 3rd, 2005 10:06 PM
flash php mail xeno Flash (all versions) 1 July 9th, 2005 04:45 PM
PHP varibles in FLASH Ashleek007 Beginning PHP 1 November 30th, 2004 12:44 PM



All times are GMT -4. The time now is 10:33 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.