|
-
Loading content of a local folder
Hi
I'm developing yet another Flash appliction and this time it's going to run localy as well as web. The problem here is that at one stage the user photos will be loaded onto the stage and I want this to load from a folder on local hard drive but I can't seem to find anyone, as PHP is a server side script I dont think i can use it.
Any help is appreciated
thanks
Ameretat
-
Senior Member
Just create a folder on your harddrive and place the images in there and use: movieclip.loadMovie("nameoffolder/image.jpg");
- The right of the People to create Flash movies shall not be infringed. -
-
thanks for the reply, i do know that, but my problem is that, I dont know whats going to be inside the folder the user will put their photos in there for use inside the application so I need to load them in, but I have no information whatsoever about the image files.
Ameretat
-
Senior Member
You need to know the path and name of the files.
- The right of the People to create Flash movies shall not be infringed. -
-
so you mean there is no way for flash to read the content of a folder on the local harddrive?? 
so what would you suggest, is there anyway to show a load file dialogue box to load files from local drive, to use in the application? I've already done this but for use on the web and uploading to the web using PHP.
thanks for the help
Ameretat
-
Senior Member
Flash would not know any names unless you feed them. The only way to know is if the user opens the folder and clicks on the file to show, but then you need to add the folder name separately (look for filereference in the help files).
- The right of the People to create Flash movies shall not be infringed. -
-
ya, thats what i was just trying, thanks for your help anyway, Flash needs to introduce more functionality with local drives!
I'll post the solution if I get to work for others to use here 
thanks
Ameretat
-
I know that php can scan the folder for files:
PHP Code:
<?php
$a=opendir(".");
while($b=readdir($a))if(strpos($b,".")!==0)if(strpos($b,".swf")!=false)if($b!="arrayCollect.swf")echo $b."\n";
closedir($a);
?>
I got this script earlier when I was trying to do something like what you are doing. I got this from a way earlier post of mine and someone gave me this script.
I think that this is the actionscript that I got to go with it.
code: for (var i in d=c.split(",")) {
var e = this.createEmptyMovieClip(d[i], i);
e.createTextField(0, 0, 20, i*20, 200, 20);
e[0].variable = "_name";
e.onPress = function() {
this.createEmptyMovieClip(0, 0).loadMovie(this._name);
};
}
Enjoy.
-
thanks swak
but as far as i know PHP is a server side script so it needs to be run on the server for it to function, but in my situation everything is local, so wont be able to run PHP code.
Ameretat
-
Then you have two options. Either look at the program zinc. Zinc compiles swfs into actual programs so that you can save. A simple solution is having a text file that has a list of the things you want loaded.
-
thanks, yes i have seen that program, but for this project i just took a different approach, which is fine so far, have to see what other say.
i just created a a folder called User and all the pictures are inside there, and in the instruction I ask the users to copy their image files over to this folder then load the ones they want from there!
thanks again
Ameretat
-
-
using the FileReferenceList to open the browse box and they select the images, but it has to be from that folder otherwise, obviously, it won't load up. also im using the loadClip(); than the loadMovie(); function so that I can catch errors if they select a file outside of that folder.
Ameretat
-
I was thinking of trying the fileReferenceList as well to do the same kind of thing. Good job taking the initiative. I didn't think of fileReferenceList because I need to experiment with it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|