Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




How To Preload An External Movie?



Hi!I want to load an external swf file in a empty MovieClip.I want to do this in the first frame.What is the best way to do that?How do I do it?Can you show me some code?Thank you



General Flash
Posted on: Fri Sep 22, 2006 1:15 am


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Preload External Movie
Hi,

Need preload script for my external swf,

In all the external swf, i created a preloader for each external swf , i want it goto preloader before playing in all my external movie. But seen like not working, everytime when i click, the movie play without running preloader in all my external swf, pls advice. Thanks.

My link http://deicidez.cjb.net

Amiwai

Preload External Movie
I am loading an external movie using the loadMovie script and need to preload that external movie while the current movie is playing. Any suggestions?

External Movie Preload
Hi need to preload an external movie in to a new movie clip. Pls help me

Can't Get To Preload External Jpg In A Movie
Hi guys, this is already 3rd day in a row when I'm trying to find some solution. I have a flash movie which loops all the time and shows different jpg images. It increments a number and according to that number it shows the image. However, the trick is that I have to overlap the previous image with a next image (all togehter 9 of them).

I need to preload next image. However, it preloads, but just the movie part...and doesn't look really preload image. The result is that the movie is going withough a proper picture or picture appears in the middle of the movie.

the other part is that it has to load the same picture on the lower layer, so that when it plays again, it shows the previous picture. Then a new picture can be laid over it. However, also there is a problem, where it just doens't stop the movie and doesn't wait until the loading is done.

It almost seems that the loading does not actually include the loadMovie. You can see two differnt ways I'm trying to solve it, but it just doensn't work.

Please, any help is really appreciated!!

to see example: http://www.lestrans.lv/test/inside.html
to see source: http://www.lestrans.lv/test/inside.fla

Preload An External Movie
what is the code for a preloader that sits in the main movie and is used to load up various other external movies?

Thank you

L

Preload External Movie
Hi can anyone hlp me out here ...

I need to load an external movieclip and i want to make a progress bar in the host clip

my code doesn't seem to work :

this code is set on the progress bar movieclip, the frame is stopped off course

onClipEvent (load){
total = _root.targetmovieforloadmovie.getBytesTotal();
}

onClipEvent (enterFrame){
progr = ((_root.targetmovieforloadmovie.getBytesLoaded()/total)*100);
this._xscale = progr;
if (progr > 99){
do whatever i say;
}
}

but it doesn't work for me, any suggestions ?

thanks

Preload External SWF's To Sync With Movie?
Hey guys and gals, I know this one has been asked many times, but I just can't get it to work for my particular situation. I have 3 seperate SWF's that I generated with FlashTyper and I am using loadmovie to have them play over a moving background in my main movie timeline. I also made 3 white fadeout movies to put on the layer above each SWF so that I can have the FlashTyper SWF's fade out.(if there is a better way to do that, please let me know!) The problem is that the SWF's start loading after the main timeline has begun and they don't sync up with it. Is there a way that I can make a preloader or something that will preload those external SWF's before playing the main movie?

I really am very new to actionscripting and I am stupid when it comes to javascript, so if you could please talk like I am a newbie when you reply, I would greatly appreciate it. This loadMovie action is the most advanced thing I have done so far, if that tells how much I know?

Thanks everyone,
Jason

Preload External Movie Who Are Loaded Into Mc's
Hello flashpeople,

In my recent project i first make a parent_mc. In this parent_mc i make 6 child_mc's. Each child_mc loads a external swf. This all happens onLoad.

code: _root.createEmptyMovieClip("preloader", 222);
_root.preloader.onEnterFrame = function(){
trace(_root.parent_mc.getBytesLoaded());
}

If i test this i get the totalbytes. But when i test it on 56k speed. I get undefined. If i trace _root.parent_mc i also get undefined when i test it on 56k speed.

Can someone help me please cause i'm getting crazy on this one.

mkantor my hero are you there somewhere?

:-)

Preload An External Movie Clip At The Beginning
i have 2 scenes. in the second scene i have a movieclip in which i load an external swf.

loadMovie("mymovie.swf", placeholder");

cool...that works fine of my hard drive, however, when on cd rom, the audio messes up because of the processing required to spin the cd and load the movie.

is it possible to somehow preload the external movieclip at the beginning of the main movie?....

please please help!!

thanks in advance

Help Need To Preload All 5 External Movies Before Playing Level_0 Movie
hi!

i already posted this yesterday.

i have 6 movies from level_0 to level_6
level 1-5 are external movies

level_0 is my main movie.
__________________________________________________ ___
in the second frame of the preloadscene (main movie, level_0)

is the following script

loadMovieNum ("kon.swf", 1);
loadMovieNum ("part.swf", 2);
loadMovieNum ("ref.swf", 3);
loadMovieNum ("ress.swf", 4);
loadMovieNum ("mail.swf", 5);

the 3rd frame actionscript:

loadedsize = _root.getBytesLoaded()+_level1.getBytesLoaded()+_l evel2.getBytesLoaded()+_level3.getBytesLoaded()+_l evel4.getBytesLoaded()+_level5.getBytesLoaded();
if (_level1.getBytesTotal()>0 && _level2.getBytesTotal()>0 && _level3.getBytesTotal()>0 && _level4.getBytesTotal()>0 && _level5.getBytesTotal()>0) {
totalsize = _root.getBytesTotal()+_level1.getBytesTotal()+_lev el2.getBytesTotal()+_level3.getBytesTotal()+_level 4.getBytesTotal()+_level5.getBytesTotal();
} else {
totalsize = 147000;
}
percentage = Math.round((loadedsize/totalsize)*100);
if (percentage>=100) {
percentage = 100;
nextScene ();
}


BUT THE PROBLEM IS THAT IT SHOWS THE PRELOADER, BUT AFTER 5% it dissapears and nothing happens!


can anybody show me an easier way to run the mainmovie only then if the six external movies are loaded?
the link:

http://www.pixelconnection.de/net

pass: net5nology

it´s urgent!!

Preloader To Also Preload External F4v Files In Main Movie?
n00b alert... I did search the forum (and several others online), but either the code got too complicated for me to even attempt to adjust it, or I didn't find a relevant answer.
So I really hope someone here can help me out.

I've found a preloader code online that works like a charm. I don't really know what half of it actually means/does, but it preloads and then plays the mainfile.swf . Me happy.

But the "mainfile.swf" calls external f4v files, and the problem is that they do not get preloaded. (And that kinda was why I needed a preloader in the first place...)

I gave all the f4v files instance names within the mainfile (assume: video01.f4v, video02.f4v etc), and the f4v files themselves are in the same folder as the mainfile.swf.

What do I need to add to the code to get it to preload everything?
Thanks in advance!!


ActionScript Code of my preloader is attached.







Attach Code

var l:Loader = new Loader(); l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop); l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
l.load(new URLRequest("mainfile.swf"));

function loop(e:ProgressEvent):void
{
var perc:Number = e.bytesLoaded / e.bytesTotal;
percent.text = Math.ceil(perc*100).toString() + "%";
}

function done(e:Event):void
{
removeChildAt(0);
percent = null;
addChild(l);
}

Can I Preload A Swf And Also Preload An External Linked Swf With The Same Preloader?
Can i preload a swf and also preload an external linked swf with the same preloader?

i have one swf which is a site!

and one that is the music!!

but i want them both loaded together so they run at the same time??

this possible??

Preload External Swf Movies In One Preload ?
So, I take it there is no way to preload external swf movies in one initial preload?

does anybody have a clue or suggestion?

thanks.

Preload Madness - Preload Movies Clip In A Movie?
hey people... a brought up this subject here a while back but it didn't really go anywhere... now that this sections seems to be a bit more lively perhaps some of you flashers can help me out... I am going to break this down very simple... I haven’t even storyboarded this so this is an extremely rough draft of the idea



I am building a photo gallery



this gallery has eight images which range from 30k-75k (roughly) so I don't want the user to wait for a full load of 240k-600k



I want to first load the thumbnails for the images... and then begin to preload the first image directly after that... then display it



and then from that point when the user clicks a thumbnail the corresponding full image will preload and then display


basicially this is about preloading a movieclip in a movie... I jsut can't wrap my head this... so I will ask for help before I get too deep.... any input on the basics of this idea would be appreciated

thanx!

How To Preload An External Swf?
how to preload an external swf???

I need to load an external movie with load movie action,
but before i need to be loading hide in the main movie.

yes I can also load a swf into a MC and this movie can have a preloader itself. but is there a way to preload a movie.

thanks nicolas

How To Preload External Swf's?
I have made a movie for my small Gardening company. It exists of a menu and several movieclips (with contains the info about my company, services etc.) and some examples of gardens (pictures). These are 4 external swf's which the user/visitor can load through a loadmovie action.

This is what I like to happen:

1. The visitor get's a short preloader which loads the main things of the movie. Then DURING the time he/she is reading about my interesting stuff I want to PRELOAD the 4 external swf's so that by the time he/she would like to see the pictures the waiting time for loading the external swf's is minimal.

2. I want to load an external swf with a large soundfile for background/ambient. It contains birds, bee's and all kind of natural sounds. But I want the imported info loaded first! So the background sound may play when all other info is loaded. Should the sound in the movie be an event sound or streaming?

Question: how do I manage this? Once the timeline hits my first STOP (actionscript) the other movies are not loaded right?

Can someone help me?

Thanx very much!!

G.

Preload External Swf
Lost the cd with the fla, and im not gonna redo the file, it will take to long. Is there a way to load it through another main swf and once the external swf is loaded then later on i can call the loaded file in later on?

Preload External Swf Into MC
could anybody tell me how I can preload external
swf's into a MC (movieHolder or container) with loaderBar.... You could save me from going mental!

Preload External Swf Into MC
sombody must know how to do this...
help me OB1 your my only hope''

How do you pre load external swf's with loader bar
into a movie clip or movieHolder...

Preload External Swf
is it possible to preload an external swf?

i have a seperate swf file for music which the user can choose to have on or not, initially it is off. but i would like it to start preloading the music after the main swf has loaded so the user is not waiting too long, is this possible?

Preload External Swf
this is my preloading script:

onClipEvent (load) {
total = Math.round(_root.getBytesTotal()) + " bytes";
}
onClipEvent (enterFrame) {
download = Math.round(_root.getBytesLoaded()) + " bytes";
bytesleft = Math.round(_root.getBytesTotal()-_root.getBytesLoaded())+" bytes";
percent = Math.round(_root.getBytesLoaded()/_root.getBytesTotal()*100)+"% Loaded"
if (_root.getBytesTotal() == _root.getBytesLoaded()) {
_root.gotoAndPlay( "Scene 1", 1 );
}
}

I want to add an external swf. I currently call (in frame 1, scene 1): loadMovieNum("flash2.swf", 1);

How can I get the contents of this swf preloaded with the _root swf? Any help out there?

How Can I Preload An External .swf
I've been using Flash for a while now.. but Im Fairly new to Action Scripts. Heres what I wanna do. I want my main swf to preload the external .swf. The reason is that i want the main movie to wait until the external movie is loaded to continue playing.

Ive tryed different stuff but IM STUCK!!!!!

Please Help!!

Preload External .swf's?
Does anyone have the code to preload (with a loader bar) an external .swf...

External Preload
Could someone get me pointed in the correct path to create preloading like the external loading going on on http://www.twinphotographie.com/

I want to have buttons that appear when the material they will show is preloaded.

Thanks

Preload External Swf
In my main swf file I want to load a external swf by pushing a button.How load the file using an empty mc as a target.How preload the file.how remove the file when hitting another button.

Big thx in advance.

Preload External Swf
greetings

i have a site with a preloader which works fine.

upon clicking a button i need to run an external SWF, this works fine. The problem is i have attached a preloader onto the external swf, but it dosn't seem to be preloading. This is the code i have at present in my external swf.

frame 1

btload = _root.getBytesLoaded();
totbt = _root.getBytesTotal();
sclbar = btload*100/totbt;
sclbar = Math.round(sclbar);
setProperty (_root.orangebar, _xscale, sclbar);
barwid = getProperty(_root.orangebar, _width)
barwid = barwid + getProperty(_root.orangebar, _x)
setProperty (_root.ldper, _x, barwid);

frame 2

if (btload>=totbt) {
gotoAndPlay (3);
//trace ("loading complete");
} else {
gotoAndPlay (1);
}

This is the same code i used for my main preloader,

spider

Preload An External Swf
Can I load an external swf into a target movie clip that doesn't appear till a later frame than the one on which the action is called?
In other words, if I use the loadMovie command on frame one but the target is on frame ten, will that work?
I have contents that would like to load externally but not play right away.

External Swf Preload
I have several SWF's, each containing music and a preloader for an audio player that I'm building in another movie. When I select a SWF to load into the parent movie, that SWF doesn't appear in the parent movie until the whole SWF downloads. The idea is to stream the audio and use the preloader to buffer the music in that's in the loaded SWF. Is this not possible??? I've tried a million different approaches and nothing works. PLEASE HELP!!!

I'm using Flash 5...

External Swf Preload
What's up?
Have a slight problem. My external swf files preload fine, but I can't get it to show what percentage of the external file has loaded. Of course it works fine if you access the file directly, but it won't show if it's loaded through the main clip. This has been driving me nuts for several days now. I need HELP!!!!
Here is the breakdown of what I have:
View File at www.gomediapost.com/staffMovie.htm
Main Movie = staffMovie.swf
(This movie has seven buttons that load external movies in the target clip named mc.)
Target Movie Clip = mc
External Clip = staffDamon.swf
(This is the testing clip for cable users. All other buttons work fine for dial-up users.)

Script used:
Main Movie - Frame 11:
loadMovie("staffIntro_new.swf", "mc");
(mc is the target movie clip)

staffDamon.swf and all other external clips:
Frame 1:
Actions Layer: stop();

Movie Clip named "load" on Frame 1 has this action attached to it:
onClipEvent (enterFrame) {
var bt = _parent.getBytesTotal();
var bl = _parent.getBytesLoaded();
percent = Math.floor(bl/bt *100);
if (percent == 100) {
_parent.gotoAndPlay("begin");
} else {
_parent.gotoAndStop(1);
this.DVtxt = percent + "% loaded";
}
}

Please let me know where I went wrong.
whitefox70 out.

Preload Without External Swf
I'm sure this has been covered before, but i can't find a decent answer anywhere so i'll ask it again.

Using a bunch of tutorials i've found on the net, i've created a music-controller swf (swf A), which i want to pass mp3s to play.

Ideally, i'd put this swf on my website, the pass it mp3 paths using <param>. Ie,

<param name="myfile" value="/music/reet.mp3">

Can i preload this mp3 in the swf i pass it to?

All the other explinations of this that i've found, have said to put the mp3 into a swf of its own (swf B), and put a preloader in that swf. Then, by loading swf B into swf A, it will appear to preload it.

This is simply ridiculous though...i want to dynamically pass my controller any mp3 file that i choose, without having to create swf files for every mp3 i own!

Is this possible? if so, how?

How To Preload External SWF
Hi there !

Can anyone help me in how i can (in a simple way) preload an external
swf file using a different swf file.

I checked some of the posts regarding this on the Board but they all make use of complex preloaders.(perscentages etc, etc.)

I just want the preloader to be something simple like a short looping animation

so I basically need to load my main Movie(intro2.swf) using another seperate SWF file called "preloader.swf" and then the loaded file needs to start playing.

Any help ???

Thanks

meister777

Preload External Swf -help Please
I have looked at a lot of preloaders from this site and other sites, but I cannot seem to find the correct solution for my problem.

I want to preload and external swf file into my movie. I have since lost the original fla files for these movies and only retain the swf files. Therefore, I cannot go back into them and add a preloader file to them.

How, then, do I create a preloader with actionscript in my new movie such that it will load, fully, the external movies before it begins to play them?

Like I said, I have been attempting this with all sorts of preloaders and I have gotten close...but when I test these movies with the streaming function on (or even testing them on the web), the movie does indeed seem to be preloading, but the load goes far too fast and when it comes up the movie is still, actually downloading....the movie is not totally ready to go, which is not what I want.

Does anyone have a solution for this? if so, can you post an example.

Preload External Swf
This is my problem: i've 4 external.swf that load into the main movie into 4 empty MC. Each external.swf has a main label with a frame that contains the MC.
What kind of method must I use?
- the preload into the 1st frame on the main label of each external swf?
or
- pur the preload into the 1st frame of the MC into each swf?
At the moment I use this standard preload code just for other animations.
onClipEvent (load) {
if (_root.getBytesTotal()<1000) {
unit = "bytes";
total = Math.floor(_root.getBytesTotal()) + unit;
} else if (_root.getBytesTotal()>1000000) {
unit = "mb";
total = Math.floor(_root.getBytesTotal() /1000000) + unit;
} else {
unit = "kb";
total = Math.floor(_root.getBytesTotal() /1000) + unit;
}
}
onClipEvent (enterFrame) {
percentuale = Math.floor( _root.getBytesLoaded()/_root.getBytesTotal()*100)+"%";
if (unit =="bytes") {
progress_fleche.parte = Math.floor(_root.getBytesLoaded()) + "bytes";
} else if (unit =="mb") {
risultati = _root.getBytesLoaded() /1000000;
risultati = Math.round(risultati*100);
risultati = risultati/100;
progress_fleche.parte = risultati + "mb";
} else {
progress_fleche.parte = Math.floor(_root.getBytesLoaded() /1000) + "kb";
}
}
onClipEvent (enterFrame) {
if (percentuale=="100%") {
_root.gotoAndPlay(3);
}
}

Preload External Swf
hi, im trying to use a preloader to preload for a main movie, and also for other SWFs that i load into an empty movieclip in the main movie.
It works fine for the main movie, but having trouble getting it going for the other externally loaded SWFs...

here is the actionscript im using:
loadPercent and loadBytes refer to dynamic txt boxs


***
loadPercent.text = (Math.floor (_parent.getBytesLoaded() / _parent.getBytesTotal() * 100) + "%");
loadBytes.text = (Math.round((_parent.getBytesLoaded() / 1024) * 1000) / 1000 +" Kb of " + Math.round((_parent.getBytesTotal() / 1024) * 1000) / 1000 + " Kb total Loaded.");

if (_parent.getBytesLoaded() == _parent.getBytesTotal()){
loadPercent.text = "100%";
loadBytes.text = (Math.round((_parent.getBytesLoaded() / 1024) * 1000) / 1000 + " Kb of " + Math.round((_parent.getBytesTotal() / 1024) * 1000) / 1000 + " Kb total Loaded.");
_parent.gotoAndPlay("start");
}
***

in the main movie, i have _root in place of _parent.
actually the preloader seems to be working, except that i cant see the text in the dynamic text boxes, though i see no reason why it shouldnt work in another externally loaded SWF since all the variables to do with textboxes are local.

any ideas?
thanks

Preload External Swf.....
Does anyone know, if possible, can I have multiple swf's(and they do not have there own preload themselve) loaded into one host file, under one preload. And if you do, do you have sample code?

Preload External Swf
How do I go about preloading an external swf which is my main movie??

I've never done it before so some detailed help would be appreciated.

Thanks

Preload External Swf
how can i preload a external *.swf file?
look @ www.domroese-diesel.de
the startpage wants to be a preloader for the following flash site. i hope anyone can help me.

cheers

Preload External Swf
i have checked out an old existing post with the similar subject, but it didn't really help. I was hoping someone could help me out with my situation. I have a website and it contains a preloader. When the preloader is done, a button appears and it loads a separate external swf file. Is there a way to get the preloader to preload the external swf file.

Thanks,
strytus
strytus.com
check out my website, for better reference.

External Swf Preload
ok, i am calm.....

i have searched for this topic and have gone through alot of precious posts but cannot seem to get it, i have tried so many different things that I cant remember what code is for what....

simple thing...

I have external swf I want to preload when a button on the _root.menuclip is released

I am wanting to put the preloader at the beginning of each swf, I want a nice smooth bar that scrolls in smoothly with some text that fades in and out underneath it ..."STANDBY..." and then when loaded, I want the prelaoder to fade out and the in transisiton to begin for the swf.

I cant figure this out...its killing me

Preload External .swf... HELP Please
Hello everyone!

I am new here at the forums, but, i have been downloading movies and checking out tutorials for a while.

WELL HERE IS MY QUESTION...
Flash version: FLASH MX (not 2004)

I am having trouble loading external .swf files... well , they load, but, the loading progress(loading bar) does not show for a while... it shows when its around 45%. (THIS IS ON A DIAL-UP MODEM - got to be safe, lol)

In result, this will make users leave the site thinking nothing is happening.

Sucks right?

THIS IS THE CODE on the timeline for the preloader:

total_bytes = _root.getBytesTotal();
loaded_bytes = _root.getBytesLoaded();
remaining_bytes = total_bytes-loaded_bytes;
percent_done = int((loaded_bytes/total_bytes)*100);
bar.gotoAndStop(percent_done);
ifFrameLoaded ("end") {
gotoAndPlay("start");
}

NOTE:This goes at the beginning of each external .swf file.

Can someone please help me with this.

Thanks in advance for any help

Preload An External SWF
I use Flash 5, but I will gladly take ideas for any version. Right now, I use internal preloaders for all my SWF movies (like before the movie it shows a progress bar and percentage). Well, I'm trying to use getTimer() in my latest SWF and preloading screws up the time for it (it starts at the beginning of the movie, aka the preloader, rather than the beginning of the actual movie like I want).

So, I think one of the only ways to get around this would be to use a preloader SWF movie that will load the movie seperately (a different file; external) and then start playing the movie after it is loaded.

All attempts I've tried haven't worked, so I am wondering if anyone here knows how to make a preloader SWF movie that will load an external SWF movie. Thanks for any help!

[edit] Or if anyone knows how to display the time the movie's been running since the beginning (not including the preloader), with or without using getTimer(), that'd work too!

HELP Preload External SWF No FLA
I've read about a million posts and tutorials about preloaders and I have Math functions and goTos coming out of my ears....(and other places!!)

Now, I know how to make preloaders - I've done them many many times successfully. However, I have made swf files from movie clips using sorenson squeeze. I do not have fla files for them so I can't put a preloader in each external swf. But I want to preload them into my main movie so the user knows something is downloading. I have tried loading my external movie into a movieclip and using declarations like loadPercent = Math.floor((_root.MC.getBytesLoaded())/(_root.MC.getBytesTotal())*100)+"%"; in my code (substituting that kind of syntax where necessary in my normal preloading code); however, it doesn't seem to work.

The main movie skips over the preloading frames and right to the end as if the whole external clip had played, when in reality, the clip wasn't done loading. Any ideas as to what I'm doing wrong, or if what I am trying to do is even possible?

Any help would be reaaallllly appreciated as I've already spent my last 24 hours (in a row...awake....slowly going blind from reading posts and staring at this screen) trying to figure this out on my own. I'm giving in...please, help me!! lol I'm way past deadline as it is and I'm starting to freak out.

To be somewhat helpful I have attached the fla file I am working on as my main movie. But I have tried so many things, i don't even know if what I'm trying to do will make sense if you look at that file. Ignore the preloader bar - It needs to be adjusted. It's the code I'm worried about right now.

Thanks so much!!

Help With External Preload
Hi there ... Ive got this preloader end it works fine

BUT how can i play a movie that is placed in
_level0.menu.play(2);
when the external swf is finish loaded in the container


-------------------------------------- script -------------------------


MovieClip.prototype.fadeIn = function() {
this.onEnterFrame = function() {
if (this._alpha<100) {
this._alpha += 10;
} else {
delete this.onEnterFrame;
}
};
};
bar._visible = false;
border._visible = false;
var empty = this.createEmptyMovieClip("container", "100");
empty._x = 0;
empty._y = 0;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
container._alpha = 0;
bar._visible = true;
border._visible = true;
pText._visible = true;
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
bar._width = (lBytes/tBytes)*100;
pText.text = "% "+Math.round((lBytes/tBytes)*100);
};
preload.onLoadComplete = function(targetMC) {
container.fadeIn();
border._visible = false;
bar._visible = false;
dText._visible = false;
trace(targetMC+" finished");
};
//default image
my_mc.loadClip("images/main1.swf", "container");






-----------------------------------------------------------------------

hope for some help
Have a nice day

Preload External Swf
Hi

My first two frames are a preloader for the website. My third frame loads an external swf which is the background (bg.swf).

The site is small so loads very quick, how can i preload the external swf? I do not have the .fla for the background else i would have put it all into one file (sorting out someone elses mess )

thanks

spider

Preload External Jpg
Hi...
i need an help about how structuring an as.

I have to:

1. load a random external jpg, make a "fade in" with it
2. when it's loaded i have to play an mc.
3. I have to let the jpg on the stage for 10 seconds
4. load another jpg (n+1) with "fade in".


i used:


Code:
createEmptyMovieClip ("mc", 99);
mc._x = 0;
mc._y = 0;
mc._alpha = 0;
thumbs.swapDepths (110);
chnworld.swapDepths (111);
function loadFinished () {
mc.onEnterFrame = function () {
////// FADE IN
if (this._alpha < 100) {
this._alpha += 5;
} else {
delete this.onEnterFrame;
}
};
thumbs.play();
//////
trace ("load first image complete");
thumbs.play ();
}
function preload (clip, loadBar, loadText, callBack) {
var totalBytes = clip.getBytesTotal ();
var loadedBytes = clip.getBytesLoaded ();
var percentLoaded = Math.floor ((loadedBytes / totalBytes) * 100);
loadBar._xscale = percentLoaded;
loadText.text = percentLoaded + "%";
if (totalBytes > 30 && totalBytes == loadedBytes) {
clearInterval (preload_interval);
callBack ();
}
}
rand = random (4) + 1;
rand2 = rand;
trace (rand + "random");
trace (rand2 + "random");
mc.loadMovie (rand + ".jpg");
preload_interval = setInterval (preload, 100, mc, loadBar_mc, loadText_txt, loadFinished);


setInterval(function () {
mc.swapDepths (101);
mc._name = "old";
old._x = 0;
old._y = 0;
createEmptyMovieClip ("mc", 100);
mc._alpha = 0;
rand2++;
trace (rand2 + "random2");
if (rand2 eq 5) {
rand2 = 1;
function preload (clip, loadBar, loadText, callBack) {
var totalBytes = clip.getBytesTotal ();
var loadedBytes = clip.getBytesLoaded ();
var percentLoaded = Math.floor ((loadedBytes / totalBytes) * 100);
loadBar._xscale = percentLoaded;
loadText.text = percentLoaded + "%";
if (totalBytes > 30 && totalBytes == loadedBytes) {
clearInterval (preload_interval);
callBack ();
}
}
mc.loadMovie (rand2 + ".jpg");
mc.swapDepths (old);
/////////////// FADE!!!!!! ////////////
old.onEnterFrame = function () {
if (old._alpha > 0) {
old._alpha += 5;
} else {
delete this.onEnterFrame;
}


};

//////////////////////
preload_interval = setInterval (preload, 100, mc, loadBar_mc, loadText_txt, loadFinished);
} else {
function preload (clip, loadBar, loadText, callBack) {
var totalBytes = clip.getBytesTotal ();
var loadedBytes = clip.getBytesLoaded ();
var percentLoaded = Math.floor ((loadedBytes / totalBytes) * 100);
loadBar._xscale = percentLoaded;
loadText.text = percentLoaded + "%";
if (totalBytes > 30 && totalBytes == loadedBytes) {
clearInterval (preload_interval);
callBack ();
}
}
mc.loadMovie (rand2 + ".jpg");

preload_interval = setInterval (preload, 100, mc, loadBar_mc, loadText_txt, loadFinished);
mc.swapDepths (old);
/////////////// FADE!!!!!! ////////////
old.onEnterFrame = function () {
if (old._alpha > 0) {
old._alpha += 5;
} else {
delete this.onEnterFrame;
}


};
//////////////////////
}
},45000);
stop ();

setInterval(function () {
thumbs.play();// mc to play


},45500);
but it's not really what i want. I wrote 45 seconds in order to permit 56 kbps user to load the jpg....but i know it's not the orthodox way, 'cause DSL user will see the picture for 40 seconds and 56kbps user for 6 seconds!

Help me please!

[F8] Preload External SWF
I need to preload an external SWF ("aboutME.swf") when the movie reaches frame 6. What I need to know is how to do so with a user created progress bar, not the component progress bar. I would greatly appreciate any help.

neil

Preload External Jpg From Xml
Pretty sure it's kinda simple ... but i guess i don't get it right now.
First of all i'm loading a first image.(i wish to preload it)
And then when i click one of my thumbs .. it will load it (with a preload)

Still i've manage to do almost everything .. except the darn preload thing!

any ideas ?

/////here's the script /////

loader.loadMovie("cuisine/images/image01.jpg","clip1");

myPhoto = new XML();

myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success)
{
numimages = this.firstChild.childNodes.length;
spacing = 90;
for (i=0; i<numimages; i++) {
this.picHolder = this.firstChild.childNodes[i];
this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
this.thumbHolder._y = i*spacing;
this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_i mage", 0);
this.thumbLoader.loadMovie(this.picHolder.attribut es.thmb);
this.thumbHolder.title = this.picHolder.attributes.title;
this.thumbHolder.main = this.picHolder.attributes.main;
//var T:Array = new Array(this.thumbHolder.main);
//trace (T);
this.thumbHolder.onRelease = function() {

conteneur.unloadMovie(this.clip1);
loader.loadMovie(this.main);


};
}
};
myPhoto.load("cuisine/xmlphoto.xml");
stop();

Preload External .swf Again
I'm trying to place a simple percentage preloader in an externally loaded (via target not level) swf. Either in the loaded .swf or in the main .swf. oldnewbie, you were helping me on flashkit with the same question, but it's not letting me reply. I've been working with the following code;

this.onEnterFrame = function() {
percent = (_root.loader.getBytesLoaded()/_root.loader.getBytesTotal())*100;
if (!isNan(percent)) {
if (percent == 0) {
percent_display = "";
} else {
percent_display = Math.ceil(percent)+"% LOADED.";
}
this.ldbar._visible = true;
if (percent>1) {
this.reelmc._visible = true;
ldbar.gotoAndStop(percent);
}

_root.loader.stop();
}
if (percent == 100) {
this.gotoAndStop(1);
delete this.onEnterFrame;
this.reelmc._visible = false;
percent_display = "";
this.ldbar._visible = false;
_root.loader.play();
}
};
stop();

I've lost touch... I'm not sure where I'm going wrong, "loader" is the empty MC I'm loading all .swf into. Any help would be appreciated. Thanks in advance.

LTD

Preload External Swf Mp3
Hi, I've try reading all about this issue posted in this forum but nothing solve mine so I decided to register and perhaps get some help. Thanks in advanced for any replies.

I created my external swf(mp3) like this:

First frame:
stop();

Second frame:

firstSound = new Sound();
firstSound.attachSound("moz");
firstSound.start();
stop();

so thats about it for my external swf.

And on my main movie, I have a dynamic input text field and this action on frame 1:


PHP Code:



_root.createEmptyMovieClip("container", 1);
loadMovie("mysong.swf", "container");
    
preloader.onEnterFrame = function( )
{
     this.dynamic.text = container.getBytesLoaded();
        
     framesLoaded = (Math.ceil (( container.getBytesLoaded() /container.getBytesTotal()) * 100));
    
    //make sure the movie has at least started loading
   if( container.getBytesLoaded( ) > 4 )
  {
    this.gotoAndStop(framesLoaded);
    this.dynamic.text = framesLoaded + "% completed";
    
    if( framesLoaded >= 100 )
    {
        container.gotoAndPlay(2);
        delete this.onEnterFrame
    }
    }





As above, i tried to debug using

this.dynamic.text = container.getBytesLoaded();

to see if I can get the external swf bytes but nothing, and the song is not playing as well.

Copyright © 2005-08 www.BigResource.com, All rights reserved