?
Solved

Reading from a text file every 5 minutes

Posted on 2003-03-07
15
Medium Priority
?
121 Views
Last Modified: 2010-04-03
I want to be able to read in a text file which contains 5 minutes worth of data to process. Once those 5 minutes are up, I want to do it again, and so on.

Currently, I am only able to keep getting the file every second or so which is going to cause a strain on the webserver.

I have to use Flash 5 for this. Is it possible and if so, could you provide a sample of the code I'd use for such a solution?

Newsgroups seem to avoid the issue altogether...

Thanks in advance

Graeme
0
Comment
Question by:GraemeScotland
[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
  • 5
  • 5
  • 4
  • +1
15 Comments
 
LVL 22

Accepted Solution

by:
rascalpants earned 2000 total points
ID: 8091383
A VERY easy way would be to have a looping movieclip load in the variables after the five minutes are up, then reset itself...


- if your frames per second is set to 12, then just make a movieclip with 13 frames

- in frame 1 put this:

n = 1;
stop();


- in frame 2 put this code:

if(n == 3612){
 loadVariablesNum("pagewithtext.txt", 0);
 n = 1;
} else {
n++;
}


- in the 13th frame put a gotoAndPlay(2);


this looping movieclip will add 1 to n every second, and then on the 3600th second, load the text in again...


this is a very easy way to do this...


let me know if you need more information...


rp



0
 
LVL 22

Expert Comment

by:rascalpants
ID: 8091394
I am sure there is a more "elegant" way to do this, but I try to provide answers that everyone can understand and learn from...

you can get into getTimer and stuff like that, but there is really no need, unless you need to get this down to the millisecond...


rp
0
 
LVL 5

Expert Comment

by:ocgstyles
ID: 8091401
too fast for me RP!!!!
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:ocgstyles
ID: 8091404
HAHAHAHAHA
0
 
LVL 22

Expert Comment

by:rascalpants
ID: 8091426
Big O,  do you have any other thoughts on this...  I can't think of an easier way, without some confusion...


rp
0
 
LVL 5

Expert Comment

by:ocgstyles
ID: 8091525
i was gonna use getTimer(), but yer first way is perfectly fine.  its must be helluva text file to take five mins to process!!
0
 

Author Comment

by:GraemeScotland
ID: 8091610
Thanks, it is a rather large text file which needs processed. There's 500 seconds worth of information on it, so I want each of the n counts to show a second's data from the file.

When all the data has been used, a new file should be ready to be read in with the next 5 minutes data.

I've been looking for some kind of time based mechanism like this for ages, thanks to all who contributed :-)
0
 
LVL 6

Expert Comment

by:henryww
ID: 8094654

@#$%*!%@%#@ ...  so fast ...
unbelievable ...

i shouldn't have gone to sleep... should wait for this one!!

oh man ... u've got that extra 2000 pts from the pdf question too ... hard to catch up ... ha ha ha ...

and ocgstyles took some of the little ones too !! hmmmmm

well, let's see how long it will take for me to get pass rp again ... LOL

well done.

cheers rp & O ...
0
 
LVL 6

Expert Comment

by:henryww
ID: 8094666
actually i have a better way to do this, but i am not gonna tell u ... since i don't get my 500pts no more ... LOL ...
0
 
LVL 22

Expert Comment

by:rascalpants
ID: 8103019
I have about 3500 in points to give out.... maybe I should give it all away, and give an A for the questions as well....

now how can I give it to myself... hmmmmmm?


:)


rp
0
 
LVL 6

Expert Comment

by:henryww
ID: 8103111
ha ha ha ha ....
0
 
LVL 5

Expert Comment

by:ocgstyles
ID: 8103278
hey rp....yer my best friend!!  ;-)  did i ever tell you that?!?

-O
0
 
LVL 22

Expert Comment

by:rascalpants
ID: 8103344
:)
0
 
LVL 6

Expert Comment

by:henryww
ID: 8103958
ha ha ha ... i have 2700+ pts to give away too ... anyone?

ha ha ha ...
0
 
LVL 5

Expert Comment

by:ocgstyles
ID: 8106206
i like points.  =)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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 …
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses

765 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