|
-
can AS see if there is a text file on the server...
i'm just wondering if it's possible for some AS to check to see if there is a text file on the server... if there is, i'd like a MC to play, which would then load the contents of the text file...?
this is for an events calendar; i'd like to save the text files with a file name that is the date (29.01.06.txt for example), and for the Flash movie to play and load the contents into the calendar if such a file exists.
if anybody's got any better suggestions for making such a calendar... that's very easy to update/add to, that'd be great!
cheers
-
Flashmatics
Well i think strictly speaking to see if a file exists you would need to use a server side file such as php, asp that flash would call and which would then check if the file exists.
However u can achieve the same 'effect' by using the loadVars object load to try loading the text file. If it doesnt succeed in loading the text file ( you will know that either the text file doesnt exist or for some other reason was not successfully loaded).
Regarding you calender are you thinking of creating a NEW text file for each new event? It prob would be better if you made ONE XML file which contains all the information about the different events on each day.
-
thanks silentweed... just looking into the XML option... i've never used it before, but so many people seem to be talking about it with regard to dynamic content for Flash.
can you create links to websites in XML, to open in a new browser window? (can't find anything on Google on how to do this)... have found how to create CSS for an XML file, which would be useful.
and, would it be possible to write to the XML file from Flash, ie. to add more events, from the main website?
-
Flashmatics
Yes u deifintely can create links using an xml file. You would load the xml content into flash and then create the links using the values retrieved from the xml object.
You can write to the xml file from flash but you would need to use a server side language to update/overwrite the xml file with the new content.
I think if you do a few google searches or even ask here you may find quite a lot of good articles of integrating flash with xml
-
Senior Member
All you need to do is call the text file and load it. If it cannot be loaded it does not exist on the server.
var myFile:LoadVars = new LoadVars();
myFile.onLoad = function(success:Boolean){
if(success){
trace("File exists");
}else{
trace("file does not exist");
}
}
myFile.load("file.txt");
- The right of the People to create Flash movies shall not be infringed. -
-
thanks guys! i've a got a bit research to do to figure out if XML is the way to go... (came across this: http://www.flashkit.com/movies/Scrip...7645/index.php which uses XML in a calendar).
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
|