-
Preloanding but not all movie. Pls help me!
Hi,
I am new to action scripting and any help would be much appreciated.
I am building a preloader and things are ok if I preload the entire movie. But, when I try to make a preloader that preloads only a small part of my timeline, I just get myself lost.
I´ve tried this for the preloader that preloads all movie:
totalBytes = _root.getBytesTotal();
(and as I said, it works)
But... when I substitute the _root.(myMovieClip instance name)getBytesTotal();
It doesn´t work!
Anyone would be gentle enough to tell me what am I doing wrong?
Thank You!
-
Senior Member
You can not use getBytesLoaded to see if a movieClip is loaded, as Flash can only target things that are already loaded.
You can on the other hand preload frames and use....
if(_root._framesloaded > 12){
//Do something
}
...will check if frame number 12 is loaded ( where the target may be ).
-
Hi pellepiano,
Thank you for you repply.
Well, I guess I wasn't able to express myself so, I pasted here all the code I´ve wrote:
totalBytes = _root.getBytesTotal();
loadedBytes = _root.getBytesLoaded();
remainingBytes = totalBytes - loadedBytes
percentDone = int((loadedBytes/totalBytes)*100);
bar.gotoAndStop(percentDone);
ifFrameLoaded ("mermaids") {
gotoAndStop("intro");
}
This code works when I am loading all movie but, I need it works and displays percent done and etc, when my "mermaids" movie clip has loaded.
I still don´t know how to do it, pls help me!
thanks
-
Senior Member
Just make dynamic textfields with the variable names of the variables in the script to display the values.
...or I still dont get what you want?
Is some part of the code not working?
-
Hi, you are fast!
Thanks a lot for helping me.
But, it is not about displaying the values...
The part of the code that is not working is that I need this "preload display" to count the bytes until my specific movieclip has loaded.
I can get it working properly (when I use this code for preload all timeline) but I am not able to make the preload count the bytes loaded at this specific point.
I just don´t know how to write this. How to tell to flash that I need it to count the bytes, and display the values for this specific movie clip in my timeline.
I´ve tried to use a frame label, a frame number or my movie clip name instead of _root. But I still can´t get it working.
Thank you...
-
Senior Member
It is not possible to show the loading process for a movieclip, as I stated in the earlier post. You can just check when the frame its sitting on is loaded.
The closest you can get is to compare the number of frames loaded to the framenumber of the movieclip and do a percentage calculation of that.
-
Oh,
Thanks for your help pellepiano. Now I begin to understand what is going wrong with my code. I will make some changes in it.
Again, thanks a lot.
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
|