Preloader Loads Too Early
Hi all,I created both a master.swf and preloader.swf to load my main.swf. When I simulate download, for some reason the preloader.swf appears when it is 30% loaded. Then, I can hear my main.swf load underneath when the preloader is 90% loaded. Once the preloader finishes at 100%, the preloader disappears (as I wanted); however, the main.swf had already started. Does this make sense? I am confused.Here is the AS for my master.swf:stop();var myMCL:MovieClipLoader = new MovieClipLoader();var myListener:Object = new Object();myMCL.addListener(myListener);myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {_level50._visible = true;var preloadPercent:Number = Math.round((loadedBytes/totalBytes) * 100);_level50.preloader.gotoAndStop(preloadPercent);_level50.preloadInfo.text = preloadPercent + " % loaded";}myListener.onLoadComplete = function(target_mc:MovieClip) {_level50._visible = false;}myMCL.loadClip("main.swf", 5);myMCL.loadClip("preloader.swf", 50);
Actionscript 2.0
Posted on: Tue Apr 24, 2007 5:55 pm
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Preloader W External Swf Loads Movie Too Early
Hi all,
I've been tearing my eyes out trying to figure this one out. I have a game in a swf file, and I have another swf file which only contains my preloader. The preloader file has only 1 frame and 3 layers wich controls progess bar etc. My problem is that the movie is played before the actual movie has loaded 100%. Instead, when my loader reaches around 50% it disappears and the game swf is played which isn't good since every game component hasnt been loaded yet. Any ideas on why this is happening?
I'm using the tutorial
http://www.lukamaras.com/tutorials/p...preloader.html
Code:
siteLoader.loadMovie("game.swf");
loadingBar._xscale = 1;
loadingBar.onEnterFrame = function() {
kBytesLoaded = this._parent.siteLoader.getBytesLoaded() / 1024;
kBytesTotal = this._parent.siteLoader.getBytesTotal() / 1024;
percentage = Math.round(kBytesLoaded / kBytesTotal * 100);
this._xscale = percentage;
if (percentage == 99) {
delete this.onEnterFrame;
}
}
I have also tried using loadMovieClip but I get the same effect. Why is my preloader exiting before the entire swf is loaded? Any help would be greatly appreciated.
External SWF Loads Too Early With .loadClip And Starts Playing Before .onLoadInit
Hi
I am trying to load an external SWF file using the MovieClipLoader. I have had success before in the future but i have never tried loading an external animation, just a static, on frame SWF. Here is my problem. When i load the swf using .loadClip("swf", target) my preloader pops up and starts preloading this movie. Before the preloader stops loading, the external swf animation starts playing in its target and by the time the preloader is finished and faded out the swf is a few seconds in. The preloader works fine (i think) because it loads static swf's fine and fades in and out at the right times etc. This has been puzzling me for a while now. i tried putting
stop();
_root.onEnterFrame = function() {
if (_root.getBytesLoaded() >= _root.getBytesTotal()) {
play();
}
}
in the external swf in question and this still causes the same problem, so for some reason the preloader thinks its still loading, it it isnt. I thought it might have been because the movie plays before it stops loading and "streams" what it has loaded so far but obviously not.
Any help with this will be fantastic, thanks
Wasim
Attach Code
var movieLoader:MovieClipLoader = new MovieClipLoader();
var loadListener:Object = new Object();
movieLoader.addListener(loadListener);
var preloader = preloader_mc;
var loaderbar = preloader_mc.loaderbar_mc;
var percenttxt = preloader_mc.percent_txt;
preloader._alpha = 0;
function loadPage(page:String) {
if (page != currentPage) {
loaderbar._xscale = 0;
percenttxt.text = "0%";
var fadeIn:Tween = new Tween(preloader, "_alpha", Strong.easeOut, 0, 100, 1, true);
var fadeOutEMC:Tween = new Tween(placeholder_mc, "_alpha", Strong.easeOut, 100, 0, 1, true);
fadeIn.onMotionFinished = function() {
currentPage = page;
movieLoader.loadClip(page + ".swf", placeholder_mc);
loadListener.onLoadProgress = function(target:MovieClip, loaded:Number, total:Number) {
percent = (loaded/total) * 100;
loaderbar._xscale = percent;
percenttxt.text = Math.round(percent) + "%";
}
loadListener.onLoadInit = function() {
var fadeOut:Tween = new Tween(preloader, "_alpha", Strong.easeOut, 100, 0, 1, true);
var fadeInEMC:Tween = new Tween(placeholder_mc, "_alpha", Strong.easeOut, 0, 100, 1, true);
}
}
}
}
home.onRelease = function() {
loadPage("intro");
}
Edited: 04/13/2008 at 06:21:48 AM by Woz Records
Preloader Jumpin' Too Early
having probs with my pre-loader, it seems to goto the next scene before loading the whole movie. It seems to be getting to 13% or 14% and then attempts to play the movie.
I can't seem to see the problem. Could someone have a look at it?
Here's the code: (frame 1)
bytesTotal = (_level0.getBytesTotal());
KbytesTotal = (int(_level0.getBytesTotal()/1024) add "KB");
percentSetup = ((bytesLoaded/bytesTotal)*100);
percentage = int(percentSetup) add "%";setProperty ("_root.DropIn.LoaderBar", _xscale, percentSetup);
if (bytesLoaded == bytesTotal) {
_root.gotoAndPlay(scene1);
}
(And in frame 2)
if (bytesLoaded<bytesTotal) {
_root.DropIn.gotoAndPlay(scene1);
}
Thanks in advance, chook
My Site's Preloader Takes Me In Too Early
This one's bugging me because I'm sure the answer is sitting right here in front of my face. The site I've created is quite big: the flash portion comes out to 1.3 megabytes, so a preloader is a necessity.
The preloader sits on the first frame and is set to take the viewer in when the last frame (frame 39) is downloaded. The problem is that it works for only a few frames and then takes the viewer in. Navigation is unpredictable until the whole site downloads.
Here is the code I have as a frame action:
if(_framesloaded==39) {
gotoAndPlay (2);
} else {
gotoAndPlay (1);
}
Anyone have any ideas? I appreciate any help.
Willi Waizenegger
Preloader Making Me Lose My Hair Early
Can anyone take a look at the attached fla and tell me what I'm doing wrong. I started out on one scene with the preloader and if loadedframes is greater or equal to totalframes it is supposed to go to the next scene and play from frame one. Doesn't work and don't know why. Just a beginner at this stuff so don't laugh.
As always any help is greatly appreciated.
Thanks in advance,
flashywhiteink
Preloader Complete Event Firing Too Early
Hello guys,
I am currently building a preloader for my movie and have the following code:
ActionScript Code:
var websiteLoader:LoaderInfo = this.loaderInfo;websiteLoader.addEventListener(ProgressEvent.PROGRESS, loaderProgressHandler);websiteLoader.addEventListener(Event.COMPLETE, onLoaderComplete);function loaderProgressHandler(event:ProgressEvent):void{ //When loading var loaderBar:MovieClip = loaderbar_mc; var loaderMask:MovieClip = loadermask_mc; var loadedPercentage:int = (Math.ceil(event.bytesLoaded / event.bytesTotal)); loaderBar.x = (loadedPercentage*loaderMask.width) + loaderMask.x; } function onLoaderComplete():void{ trace("completed"); //When loading completes websiteloader_mc.play(); websiteLoader.removeEventListener(ProgressEvent.PROGRESS, loaderProgressHandler); websiteLoader.removeEventListener(Event.COMPLETE, onLoaderComplete);}
On the first frame, I have the preloader assets. On the second frame, assets that are exported for actionscript but set to not export at first frame. On the third frame, I have the actual website.
Now the issue is this, people testing it over internet connections and me testing it flash with simulate download will see the following issue:
The movie will load, COMPLETE will fire causing the movie to play. But the movie hasn't fully loaded yet, so it will play frame 2 when it should play frame 3. Various testing has shown that the movie has not fully loaded yet, but tracing bytesLoaded will show that it is equal to bytesTotal.
Any ideas appreciated
Preloader Says NaN%, Then Loads Okay Why?
Okay,
I have a site which has 5 .swf files. In my preloader I want it to display how much of each .swf file has loaded, one at a time.
To do this I've used 6 seperate frames (the first is to load the actual preloader, very small).
My problem is that my percentage loader is coming up with NotANumber (NaN) below 20%. After that it loads fine.
For example, the 3rd .swf file to load is called in level 3 (specified earlier in the programme)
output = Math.floor((_level5.getBytesLoaded()/_level5.getBytesTotal())*100)
Where output is simply a dynamic text box.
Why would this display NaN and then after 20% start to display the percentage?
Thanks for any help.
Preloader Loads To Much
Need help, my main movie is fairly small, it calls other movies that are fairly big. In scence1 the preloader loads the main movie and its movies linked to it!!(hope your still with me) this is the code on the preloader clip
onClipEvent (enterFrame) {
ifFrameLoaded (2) {
_root.gotoAndPlay(2);
}
}
how can I load the main movie without the linked movies?? or should I go about this another way....
http://members.home.net/pascalyotis
(it does work, just takes forever, and preloader is basically useless, piece of shyt, jarbig)heelp
Preloader Loads Everything But Itself
Please have a look-see at:
http://www.perryballard.com/nhh/html...rmishmash.html
This is a very large movie, so I set up a preloader. Everything works great except for the fact that the preloader screen doesn't appear until the movie is over 80 percent loaded. I thought it was a "top-down", "bottom-up" issue (which you checked when you export a movie), but I couldn't tell a difference between the two. ....
Any ideas anyone?
Thanks!
Preloader Only Loads Once..
Hi all
I'm having a bit of a strange problem with my preloader today. I've made a preloader wich works as any other regular preloader (just a 100 frame loading animation, but with some extra's after those frames) and which is controlled by AS on the main timeline using two EventListeners attached to the loaderInfo.
(Link here, but you'd better read first )
The first one calculates the percentage and tells the preloader to gotoAndPlay that number.
The second one catches the complete event and tells the pop-up text (which I forgot to mention; it's just a MC which start playing when the frame is entered) to continue to play (bounce down again).
At the end of the pop-up text timeline, there's this code:
Code:
MovieClip(parent).pl.play();
which tells the preloader to start playing again (remember the extra frames I mentioned above). At the end of that there's this code:
Code:
MovieClip(parent).play();
which obviously makes the main timeline running again.
PROBLEM: When I upload the swf, the loader works, but when I refresh the window, it shows the full preloader, but then refuses to do anything :s
If anyone needs more code or something, let me know, and thanks for reading my way too long explanation
Preloader Loads More Than 100%
I have a bar preloader that is growing more than 100% when the movie loads. This looks weird because there is an outline around the bar and the bar goes beyond the outline. The code is below. Can someone help me?
ActionScript Code:
this.onEnterFrame = function() {
// trace the percentage of the movie that has loaded
percent = (_root.containerMC.getBytesLoaded()/_root.containerMC.getBytesTotal())*100;
if (!isNan(percent)) {
// The following only concern the preloader's displays...
if (percent == 0) {
percent_display = "";
} else {
percent_display = Math.ceil(percent)+"% loaded.";
}
this.loadbar._visible = true;
this.outline._visible = true;
this.loadbar._xscale = percent;
if (percent>1) {
}
// End of preloader's displays...
_root.containerMC.stop();
}
if (percent == 100) {
// this sends this preloader clip back to frame 1
// where it awaits the next call to it...
this.gotoAndStop(1);
// this deletes this onEnterFrame event...
// so that the movie clip stops looping...
delete this.onEnterFrame;
// preloader's displays handling...
percent_display = "";
this.loadbar._visible = false;
// end of preloader's displays handling...
_root.containerMC.play();
}
};
Preloader Loads At 20%
hi,
i have a problem with one of my mc, the problem is that when the loading text shows, it starts from 20% and not 1%. I attached the file, can you please check what is the problem?
thnaks
Preloader Loads Other Stuff Before Itself DUH...
My stinkin' preloader loads other stuff even before itself!!!
Here's the smack:
I'm working on a series of tutorials for the software that my company makes, made with Flash 5.
We start with our basic percentage bar preloader screen (first scene in order), and then it launches into the movie (next scene). The actionscript for the preloader is of the standard percent=bytesloaded/bytestotal variety.
Embedded into the main movie is a sound file, the soundtrack to the tutorial (composed by yours truly). It is not attached to the timeline of the "music" movie clip, but loaded as a sound object so that the user can shut off the music at will.
The problem is that the preloader decides to load the sound object first, even BEFORE the graphics that make up the preloader! This means that the user is staring at a blank white window for thirty seconds or so, and suddenly the preloader appears with 65% or so loaded already on the bar.
Watching the movie in "show streaming" mode confirms that everything is loading properly, and the loader bar is accurate.
SO......
How do I tell the preloader to load its own graphics BEFORE it loads the sound so the user isn't looking at a blank window?
I humbly appeal my case to all you FlashGods out there to smile upon me from on high and assist a humble and lowly newbie.
Preloader That Loads All Scenes
hey,
is there a way i can make a preloader that loads all the scenes before it plays the first scene? and does anyone know how to do it? it would be really helpful.
thanks for your time.
Preloader That Loads All SWFs
My post got lost somewhere out there. I'm trying to write a preloader that will load all the swf files you need before it starts playing the first one. I really don't care to show kb or percentage progress, just to wait while it loads all of them. All the tutorials are about loading 1 swf in a fancy way, I am looking for all. If anyone can point me in the write direction I'll appreciate. thanks.
16kb Loads Before Preloader Does...
I have a small animation - that loads a radio commercial for playing. The preloader works fine, however, doesn not begin til about 20 kb has been loaded! I am not sure why this is, is it common?
Cheers,
Nick
White Bg Loads Before Preloader?
does anyone know how to get rid of the white bg that flashes before you swf preloads?? to see what i mean... please click here
http://avidgraphics.net/CCDesignStudio.html
on slower connections, a white bg flashes before the swf loads. i tried setting the swf to transparent bg and nothing happens. there is NO white bg set in my swf....
anyone have any ideas how to get rid of this?
thanks Tracy
Preloader: Loads Everytime
First off let me say I've searched theses forums for the last hour for an answer....it doesnt help when people have craptastic subject lines like "HELP! DOESNT WORK!" So i figured mine was a smart one
Anyways. Have a preloader, it shows the loading process everytime, so its not actually working.
FRAME 1
Code:
percent_loaded = 1;
total_frames = 212;
value = 13;
LOADED_FRAME = 3;
FRAME 2
Code:
if (Number(percent_loaded)>=100) {
gotoAndPlay(15);
}
FRAME 3
Code:
ifFrameLoaded (LOADED_FRAME) {
percent_loaded = int((LOADED_FRAME*100)/total_frames);
LOADED_FRAME = Number(LOADED_FRAME)+1;
setProperty("/BAR", _xscale, percent_loaded*value);
}
FRAME 4
Code:
gotoAndPlay(2);
Movie Loads Before Preloader Is Done
Have a site which has been working fine until about 5 minutes ago. All I did was add some content to the page that is loaded in and publish to the web.
Now the main preloader loads up fine like it always has but when it reaches about 90% the movie starts playing. It is only loading in one main file.
Any ideas on how it can start playing the swf before its done loading it. I have used the same code for the preloader on several sites and they are all working fine.
How can I make sure that the movie doens't play until it is fully loaded...
Preloader Loads Up Late
Hi everyone, Im almost done with a site that Im doing for a client, but i just realized that the Preloader that I have been using all along isn't loading up right away. I know more then 1 person has had this question, i have read alot of those peoples post but just cant seem to figure out the answer. The script that im using is this.
stop();
myInterval = setInterval(preloader, 10);
function preloader() {
if (getBytesLoaded()>=getBytesTotal()) {
play();
clearInterval(myInterval);
}
bar._xscale = (getBytesLoaded()/getBytesTotal())*100;
myTextField.text = Math.round(getBytesLoaded()/getBytesTotal()*100)+"%";
loaded.text = getBytesLoaded()+" Bytes Downloaded";
total.text = getBytesTotal()+" Total Bytes ";
}
I have my preloader on the 1st frame in scene 1, scene 2 is where the rest of the site is. Is anyone able to help me out and look at that script and tell me why its not working, I would really really appreciate the help.
Thanks
Frank
Preloader Loads Only First Frame...
Hi all,
in the main movie I have a preloader, which loads external swf files.
But preloader always loads the first frame of the loading swf. Does anybody know how can I do it to load all the frames in the loading swf?
Thanks for every idea.
Problem With Preloader That Loads Another SWF
I'd really appreciate any advice on this.
I have made a Flash website that needs a preloader. The ActionScript on _root frame 1 sets up a load of functions and variables, then it does goToAndPlay(51) where the content of the website all starts appearing. It's got a lot of nested movieclips in it all with bits of ActionScript, with various functions and variables written in this style:
Code:
_root.movieclip_mc.another_mc.someVar
When I go on it in a web browser, I just get a white box for quite a few seconds, then when it's fully loaded it starts playing. I obviously need something to say "Loading" and a percentage.
I've seen some advice about starting another SWF and using loadMovie to load the other one into it with a preloader. But if I do that, will things like "_root.movieclip_mc.another_mc.someVar" stop working, because their paths relative to _root have changed?
Is there any way to dynamically load and then switch to the new SWF, so it's not running as a movieclip instance in the _root of the pre-loader SWF, but as the main movie? Or will the nested AS paths starting from "_root" still work as if it was running as the main SWF? Or should I just do it all in one SWF, with some AS on the first frame?
If anyone knows of a good example/tutorial on doing this, that would be great. It would be good if I could find some code I can use to show some text saying how much is loaded, and then gotoAndPlay the appropriate frame when it's complete.
Problem With Preloader That Loads Another SWF
I'd really appreciate any advice on this.
I have made a Flash website that needs a preloader. The ActionScript on _root frame 1 sets up a load of functions and variables, then it does goToAndPlay(51) where the content of the website all starts appearing. It's got a lot of nested movieclips in it all with bits of ActionScript, with various functions and variables written in this style:
Code:
_root.movieclip_mc.another_mc.someVar
When I go on it in a web browser, I just get a white box for quite a few seconds, then when it's fully loaded it starts playing. I obviously need something to say "Loading" and a percentage.
I've seen some advice about starting another SWF and using loadMovie to load the other one into it with a preloader. But if I do that, will things like "_root.movieclip_mc.another_mc.someVar" stop working, because their paths relative to _root have changed?
Is there any way to dynamically load and then switch to the new SWF, so it's not running as a movieclip instance in the _root of the pre-loader SWF, but as the main movie? Or will the nested AS paths starting from "_root" still work as if it was running as the main SWF? Or should I just do it all in one SWF, with some AS on the first frame?
If anyone knows of a good example/tutorial on doing this, that would be great. It would be good if I could find some code I can use to show some text saying how much is loaded, and then gotoAndPlay the appropriate frame when it's complete.
Preloader Loads External Swf
Hi!
My problem is that I want my 200x200 px preloader to be centered on the page and then load a flash movie which is 1200x900 px.
I can do it by centering the preloader on a page, and then using navigateToUrl to the main movie, but this obviously isn't very seamless.
so any ideas? Would I use JavaScript to alter the dimensions?
thanks!
Preloader That Loads A Different Movie
is there a preloader or code for preloader that can load a movie from within a different movie. ex: preloader for "movie2" on the last frame of "movie1"
Preloader That Loads 50% Then Plays
I want to make a preloader that begins my flash movie once it has 25% or 50% of the swf loaded. This is what I have on my first frame of my preloader right now:
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
loadBar_mc._height = getPercent*179;
this.loadText = Math.round(getPercent*100);
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}
This works fine and dandy.
I've tried:
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal()/2);
getPercent = bytes_loaded/bytes_total;
loadBar_mc._height = getPercent*179;
this.loadText = Math.round(getPercent*100);
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}
and I'm getting errors.
Can anyone help??
Preloader That Loads Only One Frame?
How to do preloader that loads only one frame, not the whole 6 megabyte flash site?
frame 1 has loader that loads frame 2 and in there you click button which loads frame 3 that has loader that loads frame 4 and so on. Can any one help me to do this please?
Preloader Loads Only First Frame...
Hi all,
in the main movie I have a preloader, which loads external swf files.
But preloader always loads the first frame of the loading swf. Does anybody know how can I do it to load all the frames in the loading swf?
Thanks for every idea.
Preloader That Loads MC In Segments
Hi, I have a MC named "preloader". Inside this MC got 10 frames and each of it represents a pencil. Frame 1 had 1 pencil, frame 2 had 2 pencils... and so on until frame 10(10 pencils ofcoz)
After that I adding 3 frames on my root. Frame 1 is Actionscript as follow:
Code:
totalBytes = Math.round(getBytesTotal()/1024);
loadedBytes = Math.round(getBytesLoaded()/1024);
percentDone = Math.round((loadedBytes/totalBytes)*100);
if (percentDone==20)
{
_root.preloader.gotoAndStop(2);
}
if (percentDone==30)
{
_root.preloader.gotoAndStop(3);
}
if (percentDone==40)
{
_root.preloader.gotoAndStop(4);
}
if (percentDone==50)
{
_root.preloader.gotoAndStop(5);
}
if (percentDone==60)
{
_root.preloader.gotoAndStop(6);
}
if (percentDone==70)
{
_root.preloader.gotoAndStop(7);
}
if (percentDone==80)
{
_root.preloader.gotoAndStop(8);
}
if (percentDone==90)
{
_root.preloader.gotoAndStop(9);
}
if (_root._framesloaded>=_root._totalframes) {
gotoAndPlay("start");
}
Frame 2 also AS(to perform the loop) as follow:
Code:
gotoAndPlay(1)
Frame 3 got the pen MC and I named this frame "start".
This flash running without any errors.
My question is, is there a more pro way to make this code become shorter by using any loop/array? Coz I just good in if...else statement. Maybe u guys can help me out Im still in learning process....
Thanks a lot.
Eric
Delay Before Preloader Loads?
I have a 5 MB project with a simple frame based preloader. I've imported the swf and simulated various download speeds. The preloader is working fine, but before the preloader comes on the screen there are ten-or-so seconds of just the black background (and that's on a T1 setting). The preloader is very, very simple at present with only text and a simple button that kicks in once the main movie has loaded. Anyone know?
Preloader That Loads 50% Then Plays
I want to make a preloader that begins my flash movie once it has 25% or 50% of the swf loaded. This is what I have on my first frame of my preloader right now:
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
loadBar_mc._height = getPercent*179;
this.loadText = Math.round(getPercent*100);
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}
This works fine and dandy.
I've tried:
bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal()/2);
getPercent = bytes_loaded/bytes_total;
loadBar_mc._height = getPercent*179;
this.loadText = Math.round(getPercent*100);
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}
and I'm getting errors.
Can anyone help??
Preloader That Loads Only One Frame?
How to do preloader that loads only one frame, not the whole 6 megabyte flash site?
frame 1 has loader that loads frame 2 and in there you click button which loads frame 3 that has loader that loads frame 4 and so on. Can any one help me to do this please?
Preloader, That Only Loads Certian Frames
hi ya,
i think this one is farily easy. I have made a preloder, that currently loads in all the frames, then starts the movie. How do i tell flash just to load, to say frame 27?
here is my current script:
onClipEvent (enterFrame) {
percent = int((_root._framesloaded/_root._totalframes())*100);
loaded = percent+"% loaded";
if (percent == 100) {
_root.gotoAndStop(3);
}
}
any help v.appreicated
cheers
danny
Movie Loads Before Preloader Shows Up
hey guys,
i'm getting really frustrated because i just can't seem to get this preloader to work! the preloader pops up on screen when the movie is 91% loaded. i have the publish settings set for top down loading and my script & preloader are on the top levels, first frame.
why doesn't flash show the preloader first?!?!
please help!
Preloader Loads After Macromedia Components
Im preloader doesnt load up till its finished loading the UIscrollbar bits and bobs. does anyone know a way to get around this? Is the only way to make a seperate preloader movie rather than use the first frame of my movie?
Preloader For Movie That Loads 3 Swfs
I have created one flash movie that loads 3 swf movies at the same time (a common menu bar, common background and page specific content)
It was built like this to make it easy to update any one component.
The problem I am having is that when I add a preloader to the swf that loads these three movies it does not know exactly when all 3 have loaded and it then runs the movies out of sync the first time around. So once one part has loaded it starts playing it right away.
I need to have the preloader run exclusively until all 3 movies have loaded and then have them all start at the same time.
The main movie .fla is attaced here and all files can be found here:
http://www.valencienne.com/test/
To see the current movie go to:
http://www.valencienne.com/test/hometest.swf
Thanks for your help!
Scene Loads Dynamically, Need Preloader
Hi.
I have a Flash movie that loads scenes dynamically into an empty movieclip using the loadMovie function. The only problem i have is my preloaders wont work. I have tried placing a preloader in the first frames on the .swf being loaded but it skips it every time. What and where do i need to put the preloader code and images?
Thanks in advance.
Site Loads While Preloader Is Still Running
I am having a tough time with my preloader. It loads fine but then 1/4 way through the loading process the site begins to animate underneath it. I think the problem is in my code in my master file. How do I tell my site to wait until the preloader is done to start the main site animation? Here is the code for my master.fla file:
stop();
//---------------<MCL>-----------------\
//create the new MCL and Listener objects
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
// attach the Listener, myListener, to the MCL
myMCL.addListener(myListener);
myListener.onLoadProgress = function(target_mc, loadedBytes, totalBytes) {
_level50._visible = true;
var preloadPercent:Number = Math.round((loadedBytes / totalBytes) * 100);
_level50.preloader.gotoAndStop(preloadPercent);
_level50.preloadInfo1.text = preloadPercent + " % loaded";
_level50.preloadInfo2.text = Math.round(loadedBytes/1000) + " k loaded / " + Math.round(totalBytes/1000) + " k total";
}
myListener.onLoadComplete = function (target_mc) {
_level50._visible = false;
}
//-------------</MCL>--------------------\
// trigger the MCL to load these assets
myMCL.loadClip("trigger.swf", 5);
myMCL.loadClip("preloader.swf", 50);
//---------------<LoadVars>----------------\
var myLV:LoadVars = new LoadVars();
myLV.onLoad = function (success) {
if (success) {
_level5.loadedInfo.htmlText = myLV.info;
} else {
_level5.loadedInfo.text = "There has been a error loading the requested information. Please contact the Webmaster ahendrix@eliteracing.com and report your error.";
}
}
//---------------</LoadVars>----------------\
Movie Loads Before Preloader Is Finished
here's what i have in my master.fla on frame 1.
//-------------------------preloaderscript------------------\
myMCL.addListener(myListener);
myListener.onLoadProgress = function (target_mc, loadedBytes, totalBytes) {
_level10._visible = true;
var preloadPercent:Number = Math.round((loadedBytes / totalBytes) *100);
_level10.preloader.gotoAndStop(preloadPercent);
}
myListener.onLoadComplete = function (target_mc) {
_level10._visible = false;
}
myMCL.loadClip("preloader.swf", 10);
//--------------------------------------------------\
here what's on frame 2.
//---------------------------------------------------\
stop();
if (percent == 100){
gotoAndPlay(1);
}else{
myMCL.loadClip("splash.swf", 5);
}
//--------------------/preloaderscript-----------------\
It used to work just fine until I added more content to the splash.fla, which you would think would make it take longer. Check it out so you can see what I'm talking about. Thanks.
http://dev.villaparadisonevis.com/
Preloader Loads Movie In The Middle
Preloader works, although my music from the loading SWF file begins playing right away during the preloading phase. But when the movie does begin playing, it starts in the middle somewhere. (almost as if it is trying to catch up to where the music is at?) Sound event is set at Start and to Loop in frame 11 of the movie. http://welcome.wisnet.com/strukel/www/senior_gallery.iml
You'll only see it happen the first time, after that the file is cached and it will play from the beginning like it's supposed to. Any suggestions? thanks, Julie
A Preloader That Loads Multiple Files All At Once
I have a website that starts out with an index.swf
and all the links are sepperate swf files. How do I have them preload all of the files at once at the beginning of the index.swf, and show the progress of all the files preloading?
How To Make A Preloader That Loads By Bytes Not Frames.
I am aware of how to make your standard flash pre-loader using the "if frame loaded" command.
Unfortunately, that type of loader will not work with the movie I am making. I need to make a loader that basically says "If 200k of the movie is loaded, start at Scene 1 Frame 1"
Any ideas on how to do this?
Thanks in advance.
Joe
Preloader Loads But Next Scene Doesn't Work Right
Ok, I'm puttin a preloader on this flash file right. Well it seems to work right and loads the next scene, but when the next scene plays none of the motion tweening works. The music plays, the movie clips animate, but they don't do any motion from the places they are supposed to come from (if that makes any sense.) Most the to stuff starts at 0 alpha and slowly comes to 100% and slides into the screen. But once the preloader goes to the next scene, everything is already up on the screen at 100%????
I used one of the preloader Tutorials on this site and it all seems to work...
loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
loadedkbytes = Math.ceil(loadedbytes/1000);
totalkbytes = Math.ceil(totalbytes/1000);
if (loadedbytes == totalbytes) {
nextScene ();
}
frame = int(loadedbytes/(totalbytes/100));
tellTarget (_root.loader) {
gotoAndStop (_root.frame);
}
But like i said before, when the next scene comes up it doesn't show correctly, no motion in it. Am i missing something obvious? I've even changed the if statement to gotoandplay frame 1 of preloader scene and it still does the same effect.
HELP! I'm clueless.
Preloader Mc That Loads A Seperate Main Swf Movie
Thanks to C4_Tom for the tip. However, I'm still having trouble with this. I'm trying to use a dummy movie clip in a bare bones swf to preload and open another, complete seperate swf file.
In my bare bones swf I have a one frame dummy movie clip with no art. It just has a loadMovie action that loads the main swf.
I have a preloader in the bare bones movie that uses movieLoader.getBytesLoaded to preload the clip.
It opens the main swf fine and looks good. However, I'm not convinced that it is actually downloading the main swf before it jumps to it. When I look at the streaming profile it looks like it's loading just the 2 KB of the dummy movie, then jumps to the main swf. The main swf is 157 KB and should take at least 18 seconds for the 56.6 modem setting that I'm testing it at. So, why is it just jumping there? When I trace the movieLoader.getBytesLoaded it tells me 0 bytes of 0 KBytes loaded then jumps to the main swf. So I'm convienced that it's not really downloading the swf before it opens it. I need it to be completely loaded before it opens the main swf. What am I doing wrong?
Preloader For Master.swf Which Loads All External Swf Files.
Hi all-
I'm having a bit of a problem. I have a flash site that I'm making (my first one) and I want to have a preloader load my master.swf file. My master.swf file loads all other external .swf and .jpg files with a nice progress bar etc. However, when I first vist master.swf in my browser I have to put a not so nice "LOADING PLEASE WAIT" ugh. All my code is below for you to take a look at.
Is there any way to load my master.swf file with a nice preloader like I want or should I go about doing this a totally different way?
I have export frame for classes set to 1.
trigger.swf - my shared library and probably the largest file size since it has all the fonts I use in it.
preloader.swf - the preloader the master.swf file uses when loading external .swf and .jpg files.
mainmenu.swf - my navigation for my site.
splash.swf - the splash page for my site.
music_player_fin.swf - my little juke box that I made.
To see the swf in action visit http://spazio.dvdfuture.com/flash/master.html
master.swf
Frame 1
Code:
stop();
// ------------------ MCL ------------------ \
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myListener.onLoadProgress = function(target_mc, loadedBytes, totalBytes) {
_level50._visible = true;
var preloaderPercent:Number = Math.round((loadedBytes/totalBytes) * 100);
_level50.preloader.gotoAndStop(preloaderPercent);
}
myListener.onLoadComplete = function (target_mc) {
_level50._visible = false;
}
myMCL.addListener(myListener);
// ------------------ /MCL ------------------ \
myMCL.loadClip("trigger.swf", 5);
myMCL.loadClip("preloader.swf", 50);
Frame 2:
Code:
stop();
myMCL.loadClip("splash.swf", 5);
myMCL.loadClip("mainmenu.swf", 20);
myMCL.loadClip("music_player_fin.swf", 10);
Below is the code in my mainmenu.swf
Frame 1:
Code:
stop();
//----------------<changeOptionColor options>-----------------\
var overFrame:Number = 2;
var outFrame:Number = 1;
MM_Button1._alpha = 20;
MM_Button2._alpha =20;
function changeOptionColor (myOption:MovieClip, myFrame:Number) {
myOption.gotoAndStop(myFrame);
}
//----------------</changeOptionColor options>-----------------\
//----------------<re-enable menu options>-----------------\
function reActivateBtns() {
MM_Button1.enabled = true;
MM_Button2.enabled = true;
MM_Button1._alpha = 20;
MM_Button2._alpha =20;
changeOptionColor(MM_Button1, outFrame);
changeOptionColor(MM_Button2, outFrame);
};
//----------------</re-enable menu options>-----------------\
//----------------<Button1 option>-----------------\
MM_Button1.onRollOver = function () {
this._alpha = 100;
changeOptionColor(this, overFrame);
};
MM_Button1.onRollOut = function () {
this._alpha = 20;
changeOptionColor(this, outFrame);
};
MM_Button1.onRelease = function () {
reActivateBtns();
this._alpha = 100;
this.enabled = false;
changeOptionColor(this, overFrame);
_level0.myMCL.loadClip("button1.swf", 5);
};
//----------------</Button1 option>-----------------\
//----------------<Button2 option>-----------------\
MM_Button2.onRollOver = function () {
this._alpha = 100;
changeOptionColor(this, overFrame);
};
MM_Button2.onRollOut = function () {
this._alpha = 20;
changeOptionColor(this, outFrame);
};
MM_Button2.onRelease = function () {
reActivateBtns();
this._alpha = 100;
this.enabled = false;
changeOptionColor(this, overFrame);
_level0.myMCL.loadClip("button2.swf", 5);
};
//----------------</Button2 option>-----------------\
|