Preloading movies

Hi y’all

I’ve got a problem with making a preloader. The thing is I want to preload a swf movie (child) from my main swf movie (parent). I can handle the loadMovie event, however my preloader stinks! Is it possible to do something like getBytesTotal() from my ‘parent’ to get the data from the ‘child’?

Greetz

Is anybody here? I really need some assistance!

why dont you just put the preloader inside the child swf… when loadMovie calls it the preloader will appear and load up the swf.
Hope this helps

Peace

I tried to put the preloader inside the child swf, and when I run it alone it works perfectly, but when I do a loadMovie from another swf file the preloader refuses to show.

I really dont know what to do since according to what people write in this forum it should work.

Does anyone have any idea what I am doing wrong?

gratefull for any help…

Can you post the fla? Or is it too big.

It looks like u trying to load the child and check if it’s been loaded in the same Frame (r u loading it into a container?) and Flash ‘hasn’t got the time’(as it were) to do it.

Try loading it in one frame and checking if it’s been loaded three or four frames later.

U can trace(container.getBytesTotal()) in the same frame in wich u rusing the loadMovie command to see if it has started to load
(usually if u trace it in the same frame it tells u a very small number - just the size of the container-. Let play head move a few frames and trace it again, u should get the size of the movie that’s being loaded).

Give it time… (“sin prisa pero sin pausa”).

Cheers

SHO

hi,

thanks for the tips. The thing I try to do though is to load a child swf into a parent(main) swf with the preloader situated in the child swf. I have read in this forum and in tutorials on the net that the preloader should be in the child swf. The problem is that when I run the parent(main) swf it doesnt display the preloader situated the child swf. Actually there is not any delay (or loading time) at all when running the parent swf. When running the child swf the preloader works fine and there is a loading time. And I do press ctrl enter twice to simulate an 56k modem so it is not because of the files being on my harddrive(I think).

The main movie contains a container(empty movie clip) and a loadMovie(“child.swf”, “containername”); statement.

the preloader (copied right from kirupa) for the child looks like this:

onClipEvent (enterFrame) {
var bytes = _root.getBytesTotal();
var bytes_loaded = _root.getBytesLoaded();
if (bytes_loaded == bytes) {
this.kirupatxt = “movie loaded”;
_root.gotoAndPlay(2);
this.kirupatxt = “movie loaded”;
} else {
_root.gotoAndStop(1);
this.kirupatxt = “loading (” + bytes_loaded + “/” + bytes +")";

}

}

The child contains only a large picture(to get the size up) on the second frame.

Right now I feel like a retard since everybody else can make this work. If any still has the time to help me I would be very thankfull!!! thanks

the thing is that you have to merge the movieclip hierarchies like… if the child is loaded like this:


**_root.main.child.**loadmovie(...);
[FONT=arial]OR like this:[/FONT] 
loadMovie("child", **_root.main.child**);

and for example if you execute an action “_root.gotoAndStop(1)” then you have to put it like this: “**_root.main.child.**gotoAndStop(1)”
but I don’t know if you have to change them “_root.getBytesTotal” thingies…
all I know is that your preloader is not “_root.preloader” anymore but “_root.main.child.preloader”
I hope you got the idea =)

thanks syko,

Im sorry to be a pain in the a** to this forum but it still doesnt work. Actually the thing u suggested was my orginal code. Now Im working on a simplefied child swf but my original child swf did have some variables and stuff so I did have to consider the hierarchy. For example I did have to use this statement to get a movie clip in my child movie to work:

“this._x = _root.contents.bottomPics.bottom._xmouse;”

where “contents” is the name of the empty movie (the target) clip in the main movie and the other names are movie clips within the child movie. That does work!

I did try again to write (in the child movie):

“_root.contents.gotoAndPlay(2);”

where “contents” again is the empty movie clip. Didnt change anything. Actually it is kind of funny because I could write (in the child movie):

“_root.contents.this.doesnt.work.for.me.gotoAndPlay(2):”

and it would still do the same thing, even if I run the child movie alone (when running it standalone it does work)

This is my last posting on this issue since Im starting to become embarassed. If anyone have any suggestions, I would appriciate it. Maybe Im a hopeless case (hard to believe I will have a Master in Computer Science in a month, isnt it)