Solved

get a variable from a text file

Posted on 2004-08-30
6
147 Views
Last Modified: 2010-04-03
Ok I have a news thiing on one of my websites.  And it uses shared objects to tell if the user has been to the site before if not it adds a date the date the news was updated to the persons computer and plays a animation.  Then if you refresh it will not play it again untill the date changes in flash file.  But I Have the text being pulled from a text file and I would like to have the date pulled from there also so that way All I have to do is update the text file or have someone else do so that way they don't have to have flash.  The question I have is how to send a variable to flash from the text file. I am useing loadVariblesNum("some.txt",0);  the way I have it set up now is newDate = "8/16/04";  I would like something like newDate = date;  but it seems not to work.  Maybe I am doing something wrong So any help would be great.

Fixitben
0
Comment
Question by:fixitben
  • 4
6 Comments
 
LVL 7

Author Comment

by:fixitben
ID: 11931384
here is the website. it is the news thing on the left.

http://theyac.org/indexhigh.html

fixitben
0
 
LVL 7

Author Comment

by:fixitben
ID: 11931391
Right Sorry
0
 
LVL 10

Accepted Solution

by:
muso120999 earned 500 total points
ID: 11931978
What have you got in your text file?

I think it would need to be something like:

&date=8/16/04&info=this+is+a+test+news+entry
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

 

Expert Comment

by:I_Know_God
ID: 11935789
in a flash doc I use this tect to load a external text or html doc.
myText is a new var crated at the start text_txt is the dynamic text box the file is loading into and main is  the initial varable that is loaded from the "data.txt" into the text_txt

myText = new LoadVars();
myText.load("data.txt");
myText.onLoad = function(success) {
      text_txt.html = true;
      text_txt.htmlText = myText.main;
//      trace(myText.main);
      text_txt.selectable = true;
};

the data.txt doc is formated like so
main=information
&variable2=more information

the first word in the doc is the first varaiable every one after that is followed by a & sign and then plain text. if you want it formated correctly I sugest changeing the txt doc to a html file then loading it
0
 
LVL 7

Author Comment

by:fixitben
ID: 11938457
ok here are the files I did a trace and it says undefined which means it isn't getting loaded so take a look and see what you think.  

http://theyac.org/news.zip

Fixitben
0
 
LVL 7

Author Comment

by:fixitben
ID: 11970543
I tried your code before and it didn't work, but then I tried it again because I knew that is what it was and it worked the second time go figure.

Thanks
fixitben
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Pushing Adobe Flash Player Fails with Error %%2 1 490
Embedded Video Download (Flash) 3 1,163
PDF: Display my cards game? 8 126
Text Transformation using ActionScript 3 5 155
This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

821 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