flash relative paths
- Started
- Last post
- 6 Responses
- hotroddy0
right now it looks like this:
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("galleries/galle...I want it to be:
slides_xml.load("slides.xml");so that I have the ability to copy the folder and paste it into
"galleries/gallery2/". That way I don't have to open the .fla file everytime to change the path.In other words, can I load a path directory that's not referenced from the main _root movie but from the movie that's calling the xml document?
- enjine0
heh, ok i don't really know what you're really trying to do... my guess is that you have different file locations for testing and for live use. but this will probably do the trick:
just put a conditional statement in your onload event handler to look in the one directory, and if it is not there, look in another directory:
slides_xml.onLoad = function(success){
if(success){
startSlideShow();
}else{
this.load("slides.xml");
}
}
slidex_xml.load("gal leries/gallery1/slid es.xml");and if that doesn't work, just make the two new folders in your local/disk directory.
- enjine0
huh?
(ie._root.movie1.mov ie2.slide.xml)?you need to load yr xml into a new XML Object. you did that, right? That's the way that you would path to it,... not sure why you have the .xml in there
- abizzyman0
yeah... what enjine said..
create the object first!
- enjine0
it's like this...
//declare a new xml object on any timeline:
var xmlHolder = new XML()//then declare an event handler to trigger whatever you want to happen after it's loaded... maybe even just to let the rest of the movie know it is loaded:
xmlHolder.onLoad = function(){
//do whatever
}//then finally load your external XML file into that object:
xmlHolder.load("yourXMLfile.xml...then just access the xml node tree through the xmlHolder object:
_root.someMC.someMC.xmlHolder.fi...
word?