PDA

View Full Version : loadMovie too slow


sreebar
04-14-2002, 03:36 PM
Hi,
I'm sure that there is an easy way to do this, but I don't know it. I have my main movie, and I have some buttons which should superimpose little blocks of text when pressed. Each block of text should stay visible until the next button is pressed. I have made different .swf's of each block of text and used the loadmovie command to access them, but there is a disturbing lag time between the pressing of the button and the appearance of text.
There must be a command to allow me to load each block of text on the initial loading, and just call them up when I need them, and have them on a different levels so that they show over top of the main movie. (Is Loadmovie the only command which allows placing things on different levels?)

This one is driving me crazy, so I'd appreciate any response.

Thanks,
sreebar

Billy T
04-14-2002, 03:42 PM
put all your load movies in the first frame and set visibility of each text level to false

eg

_level5._visible=false;

then when a button is pressed set the visibility of the appropriate layer to true

cheers

farafiro
04-14-2002, 03:43 PM
Post the code u r using

sreebar
04-14-2002, 06:14 PM
Billy T,

I tried what you suggested, but now all the layers are visible all the time (each layer of text shows on top of each other). The following is the first-frame Frame Action:

loadMovieNum ("page1.swf", 1);
_level1_visible=false;

etc. for each level and page number.

And on each button is the script (changing layer # for each button):

on (press) {
_level1_visible=true;
}

Where have I gone wrong?
sreebar

tg
04-14-2002, 06:17 PM
may just be a typo in your post, but there should be a "." between _level1 and _visible like this
_level1._visible=true;

sreebar
04-14-2002, 06:17 PM
Originally posted by farafiro
Post the code u r using

Farafiro,

The code I was using before was simply attached to each button:

on (press) {
loadMovieNum ("page1.swf", 1);
}

sreebar
04-14-2002, 06:28 PM
Originally posted by tg
may just be a typo in your post, but there should be a "." between _level1 and _visible like this
_level1._visible=true;

Tg,

I corrected the script as per your suggestion, but my problem remains the same.

sreebar

tg
04-14-2002, 07:04 PM
post your fla. i'll take a look.
or try this:
//based on 4 text boxes

//frame1
for(var i=1;i<5;i++){
loadMovieNum("page"+i+".swf",i);
this["_level"+i]._visible=false;
}
//when you click a button
on(release){
//set levels to not visible
for(var i=1;i<5;i++){
this["_level"+i]._visible=false;
}
//make one of the levels visible depending on which button was pushed... in this case '2'
_level2._visible=true;
}

its a bit of a hack... the code could be cleaned up alot... but i'm out of here for now.

pixelwit
04-14-2002, 10:13 PM
Unless you need your text pre-formatted you could probably use loadVariables(). That way you wouldn't have to worry about levels, lag-time or creating seperate SWF's.

Save each block of text as a seperate variable within a single text file and load that file at the beginning of the movie. On button press load a different variable into a single dynamic text box.

This might also help keep file sizes down since you will only need the font outlines embeded in one dynamic text box rather than including them in each SWF.

Maybe it'll help,

-PiXELWiT
http://www.pixelwit.com

Billy T
04-14-2002, 10:15 PM
yeah every time you click a button you need to the _visible of all the text to false and then just one of them to true

cheers

sreebar
04-15-2002, 06:09 PM
Originally posted by tg
post your fla. i'll take a look.
or try this:
//based on 4 text boxes

//frame1
for(var i=1;i<5;i++){
loadMovieNum("page"+i+".swf",i);
this["_level"+i]._visible=false;
}
//when you click a button
on(release){
//set levels to not visible
for(var i=1;i<5;i++){
this["_level"+i]._visible=false;
}
//make one of the levels visible depending on which button was pushed... in this case '2'
_level2._visible=true;
}

its a bit of a hack... the code could be cleaned up alot... but i'm out of here for now.

I tried the above but couldn't make it work. I'm now posting 2 files, the first with the loadMovie command that I was initially using, but which was slow...the second file is the non-working one which tried to use the visible/true/false. TG or anyone, I would truly appreciate it if someone would help me make this work, as I'm under quite a deadline and my brain is mush.

Thanks

Billy T
04-16-2002, 07:44 AM
Originally posted by sreebar


I'm now posting 2 files

where did you post them to?

sreebar
04-16-2002, 08:54 AM
Originally posted by Billy T


where did you post them to?

I attached a .zip to my reply. I am attaching it again to this post.

farafiro
04-16-2002, 10:20 AM
worked very fine here

sreebar
04-25-2002, 04:33 PM
Originally posted by pixelwit
Unless you need your text pre-formatted you could probably use loadVariables(). That way you wouldn't have to worry about levels, lag-time or creating seperate SWF's.

Save each block of text as a seperate variable within a single text file and load that file at the beginning of the movie. On button press load a different variable into a single dynamic text box.

This might also help keep file sizes down since you will only need the font outlines embeded in one dynamic text box rather than including them in each SWF.

Maybe it'll help,

-PiXELWiT
http://www.pixelwit.com

Thankyou so much to everyone who responded to my question. I could never get the visible true/false thing working properly with levels. I ended up using variables with a single dynamic text box, and it works very well. I have one more question that I think requires a yes or no answer. Is the following correct:

If I use dynamic text, and embed the font (pixel font), does my text look exactly the same when viewed over the web by anyone as it does in my swf? Meaning, is the formatting the same, etc.

Thanks,
Sreebar

pixelwit
04-25-2002, 04:46 PM
It seems I was right??? Well, that doesn't happen every day.

Yes, your text should look the same as long as you embed the font.

-PiXELWiT
http://www.pixelwit.com