Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 20th, 2002, 03:02 PM
ericisshort ericisshort is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Posts: 27 ericisshort User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
loading text from a .txt file

I would like my flash movie to load text from a .txt file so that when I want to add more text all I have to do is update the .txt file and can leave the flash movie alone. If anyone can walk me through this or direct me to a specific tutorial (not a website with tutorials) that covers this issue, please reply to this or email me. Thank you.
Eric

Reply With Quote
  #2  
Old February 20th, 2002, 03:06 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,966 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 52 m 24 sec
Reputation Power: 189
you can use getNetText and netResult (look in the flash manual, there are examples.) if you load it from a server.

if it is local, sorry, i donīt know.

Reply With Quote
  #3  
Old February 20th, 2002, 04:14 PM
ericisshort ericisshort is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Posts: 27 ericisshort User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
sorry but I think you missunderstood what I was trying to explain. I know how to work and edit the text file. I'm just not familiar with how to have the flash movie load text. I dont have a flash manual because I'm one of the millions out there that didn't get mine in a box I know this can be done, I just dont know how to do it.

Reply With Quote
  #4  
Old February 20th, 2002, 04:19 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,966 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 52 m 24 sec
Reputation Power: 189
Quote:
sorry but I think you missunderstood what I was trying to explain. I know how to work and edit the text file.

with notepad or from flash?
i didn think you were talking about EDITING a text file. just loading and make something like dynamic or localized menus.


from your first post:
Quote:
I would like my flash movie to load text from a .txt file so that when I want to add more text all I have to do is update the .txt file and can leave the flash movie alone.

exactly this can be done using the functions i told you. if you donīt have the manual, just reply, i will try and find a sample for you...

Reply With Quote
  #5  
Old February 20th, 2002, 04:46 PM
ericisshort ericisshort is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Posts: 27 ericisshort User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Sorry that I missunderstood what you said. And reading back over my post, it may have come off as rude. I appologize if it did. But anywho.

Yeah, no manual. I'm a cheapo. A sample would be great. Thanks for your help.

Reply With Quote
  #6  
Old February 20th, 2002, 04:54 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,966 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 52 m 24 sec
Reputation Power: 189
nothing found i consider rude...

anyway, i try to make it up from my head since i only use flash at work:

netID=getNetText("http://www.myhost.com/myscript.php");
while (!netDone(netID)) {
(stay in this frame)
}
myText=netTextResult(netID);
_root.myTextObject.text=myText

sorry, this is not correct, i know. but from the html-help you should be able to make it work. if not, reply, i am sure someone is online that can do this. its an easy task after you made it work once...

Reply With Quote
  #7  
Old March 1st, 2002, 12:14 AM
midntrdr midntrdr is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Posts: 45 midntrdr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 12
Do you still need help with this?

Reply With Quote
  #8  
Old March 1st, 2002, 01:51 AM
ericisshort ericisshort is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Posts: 27 ericisshort User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
nah, I got it figured out. Thanks

Reply With Quote
  #9  
Old March 28th, 2002, 10:05 AM
StuffBoy StuffBoy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Posts: 2 StuffBoy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation ASP CODE > UPDATING TEXT FILE ON THE FLY

Hi Eric,

You will need ASP Hosting for this solution

URL > have free hosting

I work on ecomerce/Database Driven Sites site done in Flash without using Macromedia Generator or other similar tools it is all done by hand in actionscript

I Currently only know ASP (Active Server Pages) and this is how to solve your problem

Firstly Copy the code below all code below between and including the "<%" + "%>" save this file as
"WriteTextFile.asp"

Then edit it in notepad and change the following lines

VariableContents = Request("FlashVariableContents")

The text between the quotes is name of the flash variable which is going to be sent ( This page excepts both GET and POST to send Variables)


The other line is as follows

TextFileName= "FlashVariables.txt"

The text between the quotes is name of text file and it relitive position from the flash movie at the moment it is in the same palace as the flash move


The Final line that needs to be changed is as follows


TextToWrite = "&VariableName=" & VariableContents


The text between the quotes is name of the variable in flash, The "&" Sign must be before the variableName then Follow Directly by the "=" Sign as shown below DO NOT Change any else on this line!

"&VariableName="

Contents of "WriteTextFile.asp"

<%

Const fsoForAppend = 8

Dim FileSystemObject
Dim FileSystemObject
Dim VariableContents
Dim TextToWrite
Dim TextFileName
Dim PathOfTextFile

TextFileName= "FlashVariables.txt"
PathOfTextFile = Server.MapPath(TextFileName")
VariableContents = Request("FlashVariableContents")
TextToWrite = "&VariableName=" & VariableContents

Set FileSystemObject = Server.CreateObject("Scripting.FileSystemObject")
Set objTextStream = FileSystemObject.OpenTextFile(, fsoForAppend)

objTextStream.Write TextToWrite


objTextStream.Close
Set objTextStream = Nothing
Set FileSystemObject = Nothing

%>


This will write the following to the text file

&VariableName=Testing123


If you have any problems Email Me StuffBoy

Reply With Quote
  #10  
Old April 16th, 2002, 09:36 PM
ddeo ddeo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 3 ddeo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
External text file

I know you figured this out already but I thought I would add a solution that doesn't require any server side scripting. You can just edit the text file by hand, upload it to the server and flash reads it in...

In Flash:
- create a text field and name it 'stuff'
- create a button and add this script

on (press) {
loadVariablesNum ("textfile.txt", o);
}

In the textfile.txt, write:

stuff=This+is+the+text+you+want+displayed&otherVar=this+is+another+variable+named+otherVar+that+will+load+too

There are no quotes around any text. The end of a variable (and beginning of the next) is indicated by the '&' character. Spaces are not used. In a text string, a '+' character is used in place of a space.

NOTE: If you use special characters they will also be transferred. For example, if you use a return (character) in the file it will be transferred as part of the variable.

Reply With Quote
  #11  
Old April 18th, 2002, 02:48 PM
ericisshort ericisshort is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Posts: 27 ericisshort User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
adding on to this question.

okay so I got this stuff working a good time ago, but on a related note, does anyone know how to make it so that I can edit the text from the flash movie so that it saves it to the text file. That way the news or whatever can be updated from the movie itself.
any ideas?

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > loading text from a .txt file

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap