Re: PHP/Flash Help

From: Date: Fri, 08 Sep 2000 18:01:49 +0000
Subject: Re: PHP/Flash Help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-15920@lists.php.net to get a copy of this message
On Fri, 8 Sep 2000, Nashirak Bosk wrote: > I am testing the waters to see how well Flash 4.0 works with PHP. The It works very, very well. > problem I am beginning to relize is that when you run a PHP script > called from Flash and return the output to Flash, its a pain in the you > know what to debug. I guess I could take the long route and test the > script and make sure it works without the Flash or just write functions > to send errors back into the Flash program.... But I was wondering if > there is anyway you can direct the error message of a PHP script into > Flash. For those that dont know in order to send info back into the > flash progam you would echo a string with "&" like this: This is a problem because Flash is a difficult environment in which to program. Flash 5 (which came out a couple of weeks ago) is much better, but still has some shortcomings. The biggest problem is what you just described. What I have done is just make sure that the php script is outputting what I think it is (since loadvariables just calls a page, it's pretty easy to opening up a spare browser window and point it at the same address). To see what variables are being sent from Flash to the PHP script, I just log the $QUERY_STRING environment variable to a file and watch it with 'tail -f logfile.txt'. I don't think it's common knowledge that you can easily send variables to a Flash movie by doing this: embed src="movie.swf?variable=var1&another_variable=var2" Then, those vars are available in the movie, without having to worry about LoadVars. Thus, you can debug on the same page that the movie.swf is embedded. Of course, this isn't useful for movies that need to interact after the load, but for other circumstances it's nifty and simple and clean. -- Hans Anderson -=- me@hansanderson.com | PHP, SQL Databases, Flash 5 Animation http://www.hansanderson.com | & Programming, Killer Audio Production, http://www.goofiness.com | Search Engines, Brewmeister.

« previous php.general (#15920) next »