<%
'decalare needed variables
Dim fso, file, name, email, i
'
Get data from variables coming from flash
name = Request("userName")
email = Request("userEmail")
'sets variable fso equal to a file system object
set fso = Server.CreateObject("Scripting.FileSystemObject")
On Error Resume Next
'
Check to see if the text file already exists
if fs.FileExists("emails.txt") = true then
On Error Resume Next
  'If file already exists then open the text file for editing
  Set File = fso.OpenTextFile(Server.MapPath("emails.txt"), 8, 0)
  On Error Resume Next
  '
add the variable name to the text file
  file.writeline name
  On Error Resume Next
  'add variable email to the next line of the text file
  file.writeline email
  On Error Resume Next
  '
add a blank line to text file. Number indicates number of blank lines to add.
  file.writeblanklines(1)
  On Error Resume Next
  'close object
  file.close
  On Error Resume Next
 
else
 
  '
if file does NOT exist, create it
  Set file = fso.CreateTextFile(FlastText.txt, true)
  On Error Resume Next
  'add the variable name to the text file
  file.writeline name
  On Error Resume Next
  '
add variable email to the next line of the text file
  file.writeline email
  On Error Resume Next
  'add a blank line to text file. Number indicates number of blank lines to add.
  file.writeblanklines(1)
  On Error Resume Next
  '
close object
  file.close
  On Error Resume Next
 
end if
'If any errors were encounter then run this code
If Err.Number <> 0 then
'
tells flash ASP failed and terminates the ASP file.
Response.Write "&server_mes=fail"
Response.End
else
'Send message back to flash saying everything was ok.
Response.Write "&server_mes=success"
End if
'
set fso object equal to nothing
set fso = nothing
%>
That is it! I hope you enjoyed the tutorial and learned something. If you need some help, just post in the forums here. If you need professional help, feel free to contact me.

BYE!