Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.txt file needs to load upon frame entry... 1

Status
Not open for further replies.

TulsaJeff

Programmer
Jan 29, 2001
870
US
I have a text box which loads various txt files. The text box is inside a movie clip. the movie clip is on frame 2 of the _root.

At this time I push a button to move the playhead to frame 2 and then push another button to load the txt file. I need it to load upon entry to the frame instead of having to push a button.

I have tried attaching my script to the button which takes the playhead to frame 2 and I have tried putting the script on the first frame of the movie clip. I have also tried putting the script onClipEvent(load) but still nothing happens.

It loads great by just pushing the button within the movie clip but will not load otherwise.

my text file=sampletext.txt
movie clip=textbox_in
my textboxbox within the movieclip on frame 1=text
text variable to load=loadedtext

actionscript on button:

Code:
on (release) {
    text = loadedtext;
}


actionscript on frame 1 of movie clip(textbox_in):

Code:
stop ();
loadVariables ("sampletext.txt", "");


Any words of wisdom... I have never gotten this to work and have always just used work-around methods...

help? Ya' Gotta Love It!
sleepyangelsBW.jpg
 
Dave would surely answer this question!
Maybe try onClipEvent(data) ?
It does take longer to load a long text on the web, and I believe I've seen an answer to this somewhere. Will research it... Sort of a preloader like thing, if I remember well, that makes sure text is loaded before going on to next frame!

But maybe the data thing would work!

Regards,
new.gif
 
I will give it a shot... thanks! Ya' Gotta Love It!
sleepyangelsBW.jpg
 
Old.... you are my newest hero! I tried data on the clip event istead of load and it works perfectly.

I owe you one! Thanks! Ya' Gotta Love It!
sleepyangelsBW.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top