Macromedia Flash Server - problem on operating the File class

This is Interesting: Free IT Magazines  
Home > Archive > Macromedia Flash Server > April 2006 > problem on operating the File class





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author problem on operating the File class
xuming lu

2006-04-24, 7:59 am

Hi. I got a problem which has blocked my project several days. I want to
create simple log file every user,here is my code in main.asc:
application.onAppStart = function()
{
.............. Create infoLog variable
var infoLog = new File("infolog.txt");
infoLog.canAppend = ture;
...............
}
application.onConnect = function(newClient, name, password)
{
..................
if (infoLog.open( "infolog.txt", "append") ) {
SysDate = new Date();
Systime = formatTime(SysDate); //format the time
infoLog.writeln("Authorized user:"+ name + " login the system at " +
Systime);// Write to the file?
infoLog.close();
}
......................
}

But when I added this code to main.asc, it just doesnt work, even the whole
application doesn't work at all. Anyone can point out what's the problem? Or
how to use File class in server?


3x

________________________________________
_________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/...1ave/direct/01/

________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Yi-Lei Wu

2006-04-24, 7:59 am

Hi,

I am not sure if you are allowed to use the File class on the server...
secondly, did you check if you have permission to create and write to files=
?
You should trace your file operations.

Besides.... it should be spelled as "true"...

If all fails, you can still try AMFPHP....


Best regards,

Peter Wu


On 4/22/06, xuming lu <luxuming-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org> wrote:
>
> Hi. I got a problem which has blocked my project several days. I want to
> create simple log file every user,here is my code in main.asc:
> application.onAppStart =3D function()
> {
> ............. Create infoLog variable
> var infoLog =3D new File("infolog.txt");
> infoLog.canAppend =3D ture;
> ..............
> }
> application.onConnect =3D function(newClient, name, password)
> {
> .................
> if (infoLog.open( "infolog.txt", "append") ) {
> SysDate =3D new Date();
> Systime =3D formatTime(SysDate); //format the time
> infoLog.writeln("Authorized user:"+ name + " login the system at " +
> Systime);// Write to the file?
> infoLog.close();
> }
> .....................
> }
>
> But when I added this code to main.asc, it just doesnt work, even the
> whole
> application doesn't work at all. Anyone can point out what's the problem?
> Or
> how to use File class in server?
>
>
> 3x
>
> ________________________________________
_________________________
> Express yourself instantly with MSN Messenger! Download today it's FREE!
> http://messenger.msn.click-url.com/...1ave/direct/01/
>
> ________________________________________
_______
> FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>

________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com