-
FK's Giant
Preloading JPG's into _child._child._child....
I have searched with no luck
In my movie, I have the main timeline, a empty mc called "empty". Into empty, I am loading the various sections- contact, portfolio, gallery, etc.
Inside the 'gallery' external load, i have another mc "p_empty". Into 'p_empty' I am loading images. I am looking for a way to make a, preferably, percentage preloader for the images loaded into the 'p_empty'. I have screwed myself over with pathing, so could someone give me a hand?
Thanks a lot!
Steve
The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...
-
Have you gotten the loading of a picture to work?
If so, and loading it from the main movie, what path did you use?
Seems to me it would be something like...
loadMovie("your.jpg", "_root.empty.p_empty");
If so, how about...
_root.empty.p_empty.getBytesLoaded()
-
FK's Giant
Alright, so I need to be controlling it from the absolute _root, _level0? If so, it's a basic preloader code, yes? So far, I have found somethin like this:
Code:
stop();
p_empty.onEnterFrame = function() {
L = p_empty.getBytesLoaded()/1024;
T = p_empty.getBytesTotal()/1024;
P = L/T*100;
loaded.text = Math.round(P);
if (P == 100) {
loaded._visible = 0;
delete this.onEnterFrame;
}
};
But it doesn't work. No text in the box, no nothin. The paths for the images being loaded are correct, meaning they load offline. Online is another story
This is the code:
Code:
on(release){
_parent._parent.p_empty.loadMovie("horizontalImages/"+_parent._name+".jpg")
}
To get the images to load. I have fading movieclips, somethin like a lightbox if you will, and inside those is another MC, where the MC with this code lies. (I have a "onClipEvent(load){ onRelease() } so that it can use on() events).
The "_parent._name" is the name of the, well, parent MC. These are named as the images they are covering, and hence, supposed to load.
I hope I made sense, and I appreciate your reply, oldnewbie.
-Steve
The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...
-
Can you attach your .flas - the main one and the one of the .swf that gets loaded in "empty", holding "p_empty"... - zipped up and in MX only format? Or you can e-mail them to me, if you prefer not to publicly post them. PM me and I'll provide an address, if you want to go the e-mail route.
-
This is a useful little function:
code:
function is_loaded(mc, showpercent) {
var temp;
temp = mc.getBytesTotal();
temp = temp>0 ? mc.getBytesLoaded()/temp : 1;
return showpercent == true ? temp : temp == 1;
}
You would use it by using the target MC as the mc argument. If you set the showpercent argument as true, it will return the proportion of the file that is loaded, otherwise it just returns true or false.
You can use it in onEnterFrame for a loadMovie.
-
FK's Giant
I'll try it coffey.
old- I cannot post the fla's...wouldn't be much help. I guess the main question is where I need to put preloader code, and how. I assume it would be easiest to do it from the gallry swf, where the images are loaded into via loadMovie(). It's a bit hard to explain, I know, but the concept is easy.
A few questions I have about these preloaders. The majority of them are onClipEvent(enterFrame) directly on the MC where external movies are loaded in, right? But the only time I have used preloaders are in the first frame, using the onClipEvent. Then they are gone after frame one...
I see this as a CPU consumption problem because the MC is on the same frame that the movie stops at, so the container MC would be preloading nothing, see what I mean? Maybe you could see what I am after if you go to the site in my footer. There is a slight pause between the loading process, so that gap is the externals being loaded. I will make a mock .fla tonite for a bit better understanding.
Thanks
-Steve
The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...
-
Ever had a look at my generic preloader?
http://www.flashkit.com/board/showth...hreadid=456020
That one can preload from the main movie, any other external movie in container clips, on any other levels, in container clips nested in external movies themselves loaded in container clips or other levels of the main movie, or what have you. It's all in the correct pathing of what you want to preload. It uses an onEnterFrame function, but which is deleted, when the preloading's done.
You use your loadMovie action, then call upon the preloader to take it from there until the preloading is done.
-
FK's Giant
I shall download it at home. Thanks!
The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...
-
free-webmaster-resource.com
Originally posted by oldnewbie
Ever had a look at my generic preloader?
i love that preloader of yours Oldnewbie, its really great.
i use it all the time now
-
You use your loadMovie action, then call upon the preloader to take it from there until the preloading is done.
How would I callup the preloader ??
I know its a stupid question.
take it or leave it
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|