View Full Version : flash writing to a text file using ASP
Zoren
01-01-2002, 01:22 AM
I would appreciate some help in creating a flash movie that can write to a text file using asp. I have seen similar tutorials and forum posts using PHP, but need it in ASP. I do not know asp, so an entire script for the flash and asp would be great. I do know the mapPath of the text file that I want to write to, so that's not a problem. I am also familiar with how to display dynamic text in fields through flash.
Thanks in advance to anyone that can help me.
in flash, you put
loadVariablesNum("myASPpage.asp",0,POST);
using post will send the variables to the asp page in the forms collection
if you use GET it will send the variables in the querystring
in asp you'll retrieve your vars like so...
myvar=request.form("myvarname") // thisis POST
or
myvar=request.querystring("myvarname") //this is GET
read the articles found here (http://www.flashswami.com/index.php?page=asp), they may help.
once the vars are in the asp file, just use the filesystemobject to write them to a .txt file or what ever.
Zoren
01-01-2002, 09:16 AM
Thanks tg. I will give this a try.
Zoren
01-01-2002, 11:25 PM
Originally posted by tg
read the articles found here (http://www.flashswami.com/index.php?page=asp), they may help.
once the vars are in the asp file, just use the filesystemobject to write them to a .txt file or what ever. [/B]
Thanks again for the lead tg - I'm a fellow Portlander-small world. But not knowing enough asp, I am unable to adjust the scripts to accomodate a text file over the .mdb file used in the example. If you know of another example of writing from a flash file to an asp form that writes to a text file That would be helpful. Or, if you could show what the adjusted code with a .txt file would look like. I found an example of exactly what I'm looking for at http://www.mentaleye.com/totext/ but cannot get it to work either. That would really help me out.
Thanks again.
how is the example you supplied not working?
i am at work now, but will try it out on my server at home tonight.
what OS are you using?
if 98, NT4.0WS,(ME?) do you have personal web server running?
if yes to above, did you place all files provided in the tutorial into the specified path?
let me know, glad to help.
roele
01-02-2002, 06:22 PM
If you need some samples please check out my page .....
--> www.rolandschaer.ch
there you'll find some samples with Flash and ASP ...
Zoren
01-02-2002, 10:22 PM
Originally posted by tg
how is the example you supplied not working?
i am at work now, but will try it out on my server at home tonight.
what OS are you using?
if 98, NT4.0WS,(ME?) do you have personal web server running?
if yes to above, did you place all files provided in the tutorial into the specified path?
let me know, glad to help.
Hey tg- thanks again for the assistance. Here's where I am running into trouble.
I have ftp'd all of the files from the mentaleye example to a win2k web server running the latest IIS.
I have listed the code in the asp file below:
<%@ Language=VBScript %>
<%
'written very quickly by Jeremy Brown for help4flash.com
'Spread the love and the link : www.mentaleye.com
'this is set up for sending with POST
' if you want to use GET then do
' MyText = Request.Querystring("Text")
' "Text" should be the name of the the text field in Flash
'this will write a text file on the server called Text.txt
' in the File it will write : Text=Whatever you send from flash
'YOU MUST CHANGE THE THIRD LINE TO MATCH YOUR SERVER!!!!!!!!!!!!!!!
'an example would be "C:\Inetpub\wwwroot\MyFolderOnWebSite\Text.txt"
MyText = Request.Form("Text")
Set FileSystem = Server.CreateObject("Scripting.FileSystemObject")
set fil = FileSystem.CreateTextFile("C:\virtuals\mydomain\Text.txt", 8, 0)
fil.WriteLine( "Text=" & MyText )
fil.close
%>
The only thing I changed here was the location of the text file path. I did a mappath to confirm the location of my directory folder. I was wondering if I needed to enter the script that would locate the file no matter where it was located(which I don't know how to do).
I left the code in the .fla file as it was. When I access the totext.html page it loads fine and I enter the password and enter the admin area. I input the text and click the upload button. It then displays the old text that was already there. They update is not made. To see if the flash file was not reflecting the change, I accessed the text.txt file and it did not reflect the changes there either. I am not sure where the breakdown is.
I need this to work for a client's site. For myself I would just write a new text file and upload it. But it will be nice for the client to update a greeting and news section on their own in an immediate need.
Zoren
01-02-2002, 10:28 PM
Originally posted by roele
If you need some samples please check out my page .....
--> www.rolandschaer.ch
there you'll find some samples with Flash and ASP ...
Roele- Thanks for the lead. It is a nice site. I looked at your opensource files available and were not able to use them for my needs. At this point I don't know how to work with an access database and am looking for specific examples using text files. I am new at this and unable to make the necessary adjustments without seeing exactly how to write the vb script. Thanks again.
-Zoren
zoren, i'll be taking off here pretty soon (done for the day). i'll give it a whirl at home and see what happens.
tg
the asp file is working, altho i couldn't get it to work with the flash file (worked with a regular html form -> post), ran out of time, but now i am courious as to why it is not working, looks like everything is good, took me awhile to get it going, check all permissions on the server, make sure that the text file has write permissions for everyone, and that permissions are set up correctly in iis.
i may give it another stab tonight, depending on my schedule.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.