Do you know how I would get a viewer to add another swf dyanmically. For example I have 10 swf files that it displays in the viewer - then I upload a new swf to a flash folder, how do I tell the script to count the contents of the folder and display the total. Can anyone help - or send me a link to a script. I have MySQl and php if that helps.
Simon.
system
January 15, 2003, 12:22pm
2
<?
$dir = opendir(".");
$i = 1;
while($file = readdir($dir))
if(is_file($file))
echo "&file". $i . "=" . $file;
?>
you’ll have file1, file2, …, filen as variables corresponding to your files in the current folder if you use loadVariablesNum()
system
January 15, 2003, 12:23pm
3
i’d help you more but now i gotta go… i’m at school
system
January 15, 2003, 12:36pm
4
*Originally posted by c0ldfusion *
**i’d help you more but now i gotta go… i’m at school **
Thanks for that - I’d be grateful if you could expand, if you have the time.
Thanks
Simon
system
January 15, 2003, 12:48pm
5
So this basically works as follows then:
/* Returns the filenames from the directory */
<?
$dir = opendir(“flash_1”);
$i = 1;
while($file = readdir($dir))
if(is_file($file))
echo “&file”. $i . “=” . $file;
?>
on (release) {
loadVariablesNum (“filenames.php”, 0, “GET”);
}
How do I then load in the .swfs (pic1.swf, pic2.swf …)
Thanks, Si
system
January 15, 2003, 9:28pm
6
_root.createEmptyMovieClip(“container”, 1);
loadMovie(“pic1.swf”, “container”);
//put this code for a button <on(release)>
so you have to create an empty mc and load inside it an external .swf
still have no time for this forum as I want… now i’m home and i have to do some homeworks and work on an educational software in flash (i’m being payed :)))
system
January 15, 2003, 9:38pm
7
one idea just hit me… for learning how to learn to load .swf/s, consult kirupa.com at:
http://www.kirupa.com/developer/mx/loading.asp#Loading%20movies%20into%20target:%20Flash%20MX
hope i’m being usefull here
system
January 15, 2003, 9:40pm
8
hmm… sorry, i gave a wrong url…
the correct one is:
http://www.kirupa.com/developer/mx/loading.asp
system
January 15, 2003, 10:46pm
9
Thanks for your help I’ll give it a try…:rambo:
system
January 16, 2003, 10:27am
10
Can’t get the php script to work - can you help. Thanx
system
January 16, 2003, 9:29pm
11
the php script should work; you’re probably messing up with the path to the folders you’re using