Click to See Complete Forum and Search --> : dynamic images without xml
Divyakedia
09-15-2007, 12:53 AM
I have to create a flash movie which shows transition between images. But, this won't be like placing images in the library, or putting on stage. Images will be coming dynamically. Now, the normal procedure would be like using XML, specifying image name in the XML file. But, here, i am not allowed to use XML. I have to just specify the name of the 'folder' where the images are kept, and that too in the flash file. So that, if the user places new images in the folder the flash movie automatically shows the new images and the user does not have to do anything but place or delete images from the folder.
Please help me as i am not able to do anything in this project.
discorax
09-15-2007, 01:31 PM
Sounds like you have a complex development task here. I've created something that does this in the past and you really do need to use XML even if they say you don't :)
PHP and or other Server-Side languages have some wonderful functions that allow you to cycle through a folder and look at all the files. You can set this up in a function so it happens each time a user visits your website so it's always up to date. Then the PHP makes a list of all those files and you can format the results to dynamically spit out that list as XML and read it into the flash.
var myXML:XML = new XML();
XML.load("yourPHPfile.php"); // note this isn't an XML file but rather a PHP file.
I'd suggest brining this question to the PHP forums where you'll get a lot of help using PHP to cycle through your folder and dynamically generate the XML.
I'll keep an eye out for that post and I'll see what code I have from my original project that might be useful to you.
Cheers,
Ryan
Divyakedia
09-16-2007, 04:26 AM
thanks for the quick reply. a frnd of mine who is in php told me that he would do the php part and the flash movie will get comma separated names of all the images in the folder and it is upto me now that i somehow display the images. I am able to display the name of the images but don't know how to 'display' images.
is there something u could suggest? pls help!
discorax
09-17-2007, 02:21 PM
You could use loadMovie('THE_FILE_NAME');
Or you could use the MovieClipLoader class.
var mcl:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
mcl.addListener(listener);
listener.onLoadStart = function(targetMC) {
//do something when the image starts to load.
};
listener.onLoadProgress = function(targetMC, lBytes, tBytes) {
//do something as the image is loading...
};
listener.onLoadComplete = function(targetMC){
//this event is inconsistant and I wouldn't recommend using it for anything.
}
listener.onLoadInit = function(targetMC) {
//do something once the image is loaded.
}
};
listener.onLoadError = function(targetMC, errCode) {
//spit out an error if something happens
};
mcl.loadClip('THE_FILE_NAME','MOVIECLIP_TO_LOAD_INTO');
Try those...and let me know if that's what you're looking for.
- Ryan
Divyakedia
09-18-2007, 01:01 AM
ok, i tell u what, i have been told that we have to use asp. no problem in that, i have made an asp page and it extracts names of the images and i tested it by displaying it in my flash movie by:
myVars = new LoadVars();
myVars.load("images.asp");
myVars.onLoad = function(){
//trace(myVars.images_list);
name_txt.text = myVars.images_list;
image_array = myVars.images_list.split(",");
}
where,
images.asp is my asp page,
images_list is the variable where the names get stored,
and for the time being 'name_txt' is my dynamic text field where i am able to show the 'names' of my images.
But, what i don't understand is how do i 'show' these images one after another, i have been told to show transitions between these images.
how do i do this?
I am sorry but am not an expert in actionscript and thus my ques may sound dumb :(