Solved

send variables to a text file

Posted on 2003-10-27
19
366 Views
Last Modified: 2010-04-03
I know how to import variables from a text file into a flash file.
But I'd like to do the reverse ..then to send variables from an imput field inside my flash file to a text file on the distant server (in fact where my swf file is). And after that, this new created text file could be used by another swf file loading variables inside this text file.
0
Comment
Question by:yougy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 6
  • 4
19 Comments
 

Author Comment

by:yougy
ID: 9629791
Thanks but I have a problem
I put the swf file in the root folder and also the pagina.asp (inetpub/wwwroot).
When I play the movie and fill in the input field and press the button, I suppose I need to play after the pagina.asp to create the text file. In fact, it's created but it is empty.
I tried also with php and it's the same. The text file is created with 'content=' written inside but no variable.
What's wrong ? Do I need to insert the 'object tag' (for the swf file) inside the pagina.asp. I don't think so.
Also I need in fact to send most than one variable (on different scenes and on different levels) to the text file AND I need to keep visible all datas inserted in those differents 'input fields' BEFORE I push the button sending all those variables to the text file.
Thanks in advance
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9629827
>Also I need in fact to send most than one variable (on different scenes and on different levels) to the text file AND I need to keep
>visible all datas inserted in those differents 'input fields' BEFORE I push the button sending all those variables to the text file.

visible *where*?

(do you prefer a example with asp or php?)
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:yougy
ID: 9630096
To be well understood, I'm trying to developp a flash application in order to create 'swf file' from templates on my server...like this one :
http://www.jiwang.org/portal/modules/Flash_IntroBuilder/
I would like also a preview button and a save button saving the template (with his related text file and his variables) in a specific folder (named with the login of this user) not locally but on the server


I prefer to work with ASP but if you see the only solution with php, it's ok.
Thanks in advance.
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9630641
>To be well understood, I'm trying to developp a flash application in order to create 'swf file' from templates on my server...like this one :

well, this board is about "help" with flash developing, not on "developing" them from scratch.. :)

my example should show you how you can write a variable inside a text file. but nothing stops you from joining thirteen variables in one unique string, and save it...
are you sure that the asp example create only an empty text file? Are you trying the example from an html page viewed by your web server?
0
 

Author Comment

by:yougy
ID: 9631857
the example is only to give information about my objectives but I didn'y expect from you all the application of course. ;)
My test was made on the same pc with IIS on it. In the wwwroot, I put an html page for the swf object called 'movie.html' and on the same level there is the pagina.asp.
Then I suppose firstly I have to play the html and after the asp page. But it doesn't work !
0
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 9634825
negatyve  I tested your PHP Version and you have a problem in it.

 > loadVariablesNum("pagina.php", 0, "POST");
is Placed on the Button without any Event.

either put it in the button using event or place it on the MAIN Timeline.
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9634892
wow, it was an oversight creating the two examples..
many thanks, adilkhan! :)
0
 

Author Comment

by:yougy
ID: 9637482
Any idea ?
0
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 9637512
Did you fix the Error Suggested Above?
0
 

Author Comment

by:yougy
ID: 9638919
not yet.
But could you please tell me if the swf should be place on a first html page (or maybe an asp/php page) OR on your asp (php) page directly with the script suggested ?
0
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 9639246
Nope.
SWF Could be plcaed on any HTML Page , Important Thing is the Path within Flash.

in Flash Put this on your Main TimeLine

 > loadVariablesNum("pagina.php", 0, "POST");
This is Where you Define Path.

But Make sure Swf  HTML file and pagina.php file are within Same folder. Flash will Automaticaly Load the Variables within the ASP/PHP file.
Also Make sure Files are saved under Your Server's  Root Directory so you can run Server Side Scripts.
0
 

Author Comment

by:yougy
ID: 9648587
I tried your solution an it'working with php BUT not with asp. I think there is a problem with asp.
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9648623
>I tried your solution an it'working with php BUT not with asp. I think there is a problem with asp.

what problem?
0
 

Author Comment

by:yougy
ID: 9648944
It doesn't create a text file
0
 
LVL 27

Accepted Solution

by:
negatyve earned 500 total points
ID: 9648952
do you have write permission on that folder?
0
 

Author Comment

by:yougy
ID: 9649055
yes
0
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 9650692
Did u use this function

fpath = Server.Mappath("f.txt")
if fso.FileExists(fpath) then

' write to file

else

'Create Text file

end if

???
0
 

Author Comment

by:yougy
ID: 9652398
I had only this example :

<%
Dim objFSO, objTextFile

Set objFSO = CreateObject("Scripting.FileSystemObject")

'choose one
'Set objTextFile = objFSO.CreateTextFile("C:\Inetpub\wwwroot\text.txt")
Set objTextFile = objFSO.CreateTextFile(Server.MapPath("text.txt"))

'Scrivo la prima riga di codice
objTextFile.WriteLine request("text_var")

'Chiudo il file e i vari oggetti/istanze
objTextFile.Close
Set objTextFile = Nothing
Set objFSO = Nothing
%>
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question