To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Reply
 
Thread Tools Search this Thread Display Modes
Old 01-29-2006, 07:02 AM   #1
ric frankland
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
ric frankland is offline   Reply With Quote
Old 01-29-2006, 07:21 AM   #2
silentweed
Flashmatics
 
silentweed's Avatar
 
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
silentweed is offline   Reply With Quote
Old 01-29-2006, 09:00 AM   #3
ric frankland
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?
ric frankland is offline   Reply With Quote
Old 01-29-2006, 12:03 PM   #4
silentweed
Flashmatics
 
silentweed's Avatar
 
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
silentweed is offline   Reply With Quote
Old 01-29-2006, 12:07 PM   #5
cancerinform
Mod
 
cancerinform's Avatar
 
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 |
cancerinform is offline   Reply With Quote
Old 01-29-2006, 02:12 PM   #6
ric frankland
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).
ric frankland is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:11 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.