View Full Version : PHP and Flash
Voursez
April 12th, 2005, 02:10 PM
Okay i hope theres some hard coders in here..
Weve got this school project, where the requirement is to make a site with Flash, but have some simple PHP stuff in it. Fair enough, though the teachers hardly know how to open Flash.. So ive got a lot of questions regarding this subject. I know PHP basics, and Flash.. Well lets say i can copy/paste the most code there is out there :huh:
1: Firstly, i would like to know, whether its possible to load PHP into Flash, like its done with external text-files?
2: I see some tutorials, on making drop-menus with XML, then, can i use PHP in XML documents, so Flash will detect the XML, and then just use the PHP as browsers does?
3: Can i use the opendir() from PHP, to make some kinda upload-bin in Flash, so i can with Flash, through PHP, read the content of folders, linking to it, and so on?
Hope you can help me on my way, thanks in advance..
Lukus
April 12th, 2005, 04:46 PM
For 1) Just 2 topics above this one, a sticky, "PHP And Flash: The Introduction"
http://www.kirupa.com/forum/showthread.php?t=32478
:)
Voursez
April 13th, 2005, 02:51 AM
Hehe, okay in my face there..
Well, seems pretty easy, though this still only makes me avaliable to filling out dynamic text-boxes right? Or can you explain me the better use of PHP and Flash, so i know what i can do, and CANT do? And i gotta start reading stickys..
CyanBlue
April 13th, 2005, 09:59 AM
Well... I am sure you know all the answers by now if you have read the sticky, but here is my take...
#1. You can have PHP output the string in 'variableName=value' pair and have Flash use LoadVars() object to read it...
#2. I don't understand the question, but you cannot put PHP script within the XML document...
#3. It'd be the same answer as #1... You do need to have PHP read the directory and return the list back to Flash... But you might want to look for some of those upload components such as YamzBrowser to see if you can use that...
;)
Jerryscript
April 16th, 2005, 02:19 AM
If it's allowed to use PHP modules, check out the Ming (http://ming.sourceforge.net) module for dymanically creating SWF files without the FlashIDE. Tell your instructors they won't need to open Flash! :lol:
petefs
April 16th, 2005, 02:27 AM
or mtasc (as), neoswiff (c#), alph (ruby), laszlo (j2ee), flex, xamlon (xaml), etc...
There are many many ways of generating SWF files dynamically without the flash IDE nowadays. And it only means good things for the web, as far as I'm concerned : )
Voursez
April 18th, 2005, 06:24 AM
Hehe thanks people, though the modules aint really an option (The project description states clearly, that we should use Flash MX 2004). Ive been reading the stick + a hell lotta other stuff, and im close to done. Ive still got a single problem though:
Ive got PHP to open, read, print and close the desired dir (Hurray!)
Ive got Flash to get variables from PHP into a textbox (Big surprise)
Flash WONT display all the printed information from PHP, actually it will only display the last file in the folder, and thats kinda a problem.
PHP code:
<?
if ($handle = opendir('../../php/')) {
while (false !== ($file = readdir($handle))) {
print "&recieve="."<a href='$file'>$file</a><br>";
}
closedir($handle);
}
?>
I think the problem is, that it prints a new "&recieve=" at each file, is there anyway i can still get it to work?
Voursez
April 18th, 2005, 06:44 AM
What are the odds, i found my own solution.. Changed the code to:
<?
if ($handle = opendir('../../php/')) {
print "&recieve=";
while (false !== ($file = readdir($handle))) {
print "<a href='$file'>$file</a><br>";
}
closedir($handle);
}
?>
Thanks for the help guys
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.