|
|
|
#1 |
|
Member
Join Date: Feb 2005
Location: manchester, england
Posts: 98
|
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 |
|
|
|
|
|
#2 |
|
Flashmatics
Join Date: Mar 2005
Location: London, UK
Posts: 4,823
|
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.
__________________
Flashmatics | Flashmatics Library (free downloads) ----------------------------------------------------- Latest Projects: The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience ----------------------------------------------------- Flash Certified Developer |
|
|
|
|
|
#3 |
|
Member
Join Date: Feb 2005
Location: manchester, england
Posts: 98
|
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? |
|
|
|
|
|
#4 |
|
Flashmatics
Join Date: Mar 2005
Location: London, UK
Posts: 4,823
|
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
__________________
Flashmatics | Flashmatics Library (free downloads) ----------------------------------------------------- Latest Projects: The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience ----------------------------------------------------- Flash Certified Developer |
|
|
|
|
|
#5 |
|
Mod
Join Date: Mar 2002
Location: press the picture...
Posts: 12,312
|
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. - | www.Flashscript.biz | Help a little girl, Ana, who has cancer. | Flashscript Biz Classes/Components | The new Event design pattern | Clothing for Haiti | |
|
|
|
|
|
#6 |
|
Member
Join Date: Feb 2005
Location: manchester, england
Posts: 98
|
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).
|
|
|
|
![]() |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|