| Ultrashock Forums
• [mini-tutorial] MovieClipLoader |
|||
![]() |
||||
| Search this Thread | Thread Tools | Display Modes |
| 12> | Page 1 of 2 |
|
|
|||||||||||||||||||||||||
![]() |
Ultrashock Member Comments:
|
2004-08-04
#2 |
||
|
One other thing to remember is you will not see any results in the Flash output window if you want to trace to test the loading. As odd as it sounds it just will not work. The workaround is to use a text area component and populate the variables to the text area. What I found that works best is to load a large image file to the web and load it from the flash file to test the preloader.
|
|
|
2004-08-04
#3 |
||
|
nice tutorial bluebox_d ! |
|
|
|
2004-08-05
#4 |
||
|
push
|
|
|
2004-08-05
#5 |
||
|
thx bluebox_d
|
|
|
|
2004-08-06
#6 |
||
|
nice. I've also written a class for sequentially loading files. It basically accomplishes the same thing as yours (though none of these files ever actually show, its just for preloading). It packages up the code and makes it easier to work with (pass it an array, and a free depth, and tell it to start). Anyway, you can check it out here: ListLoader Class BTW - Nice site Bluebox, I hadn't seen it yet! |
|
|
|
2004-08-06
#7 |
||
|
nice..just what i was looking for.
|
|
|
2004-08-06
#8 |
||
|
Nice, exactly what I came back here to learn. I can only get the first mc in the array to load. Could someone tell me what is wrong? The following is the only thing I have done. I haven't even made the preLoader.bar yet, so I am confused on how I am already making it complicated for myself. I used: ActionScript Code:
If I try: queCL.loadClip(ObjectsToLoadQue[1], targetsQue[1]); or: queCL.loadClip(ObjectsToLoadQue[2], targetsQue[2]); ...those mc's load fine and play (still only 1 MC though). So I know that the clips and containers are named right. Why won't all 3 load (or play)? thanks, rez |
|
|
2004-08-06
#9 |
||
|
did you forget... ObjectsToLoadQue = new Array(); targetsQue = new Array(); |
|
|
2004-08-06
#10 |
||
|
Last edited by djrez : 2004-08-06 at 18:09.
No, I didn't forget that. It still doesn't work. I have 3 empty clips on the stage named: menu_mc, logo_mc, and static_mc. Here is my frame 1. Do you see the problem? ActionScript Code:
rez |
|
|
|
2004-08-06
#11 |
||
|
that sucks i never learned 1.0... as 2.0 is tons easier
|
|
|
2004-08-06
#12 |
||
|
Rez... start doing some tracing to see what the value of objectsToLoadQue.length is. That's what should tell it to start looping through the que. Also, do you have your export options set to AS 2.0? |
|
|
2004-08-06
#13 |
||
|
thanks, appreciate that very much.
|
|
|
2004-08-07
#14 |
||
|
Busted! See what you get when you cut and paste someone else's code? Just what I deserved. ObjectsToLoadQue has caps in the "usage" suggestion above. ahhhh... don't you love pressing F12 and finally seeing what you expected over an hour ago? thanks for the preloader experience, rez |
|
|
2004-08-07
#15 |
||
|
Originally posted by djrez lol... I fixed it above, so if you want to copy and paste now it should work.
Busted! See what you get when you cut and paste someone else's code? Just what I deserved. ObjectsToLoadQue has caps in the "usage" suggestion above.
|
|
|
2004-08-07
#16 |
||
|
lol, its times like this that i feel like such a noob for not knowing you could do that.
|
|
|
|
2004-08-07
#17 |
||
|
MovieClipLoader doesn't work with flash 6.0 does it?
|
|
|
|
2004-08-10
#18 |
||
|
no way! at least specifications on help tell Flash Player 7 or above...
|
|
|
|
2004-08-13
#19 |
||
|
i dont use MovieClipLoader, Bokel has writen Loader Class http://www.helpqlodhelp.com/stuff/lo...rclass1.02.zip It runs fine too under FP6 and has many cool features |
|
2 Creative Assets
|
2004-08-15
#20 |
||
|
loadBar not moving
I finally got around to testing out this tutorial and it worked perfect on a new swf I created, but when I tried to build it into my featured work module of my v2 the preloader bar doesn't seem to be moving. I checked and double checked the path to the bar, so it couldn't be that. ActionScript Code:
|
|
|
|
2004-08-18
#21 |
||
|
Never, queCL.onLoadProgress = function(targetMC, loadedBytes, totalBytes) { myDiviser = Math.round(loadedBytes/targetMC.totalBytes*100); bar_mc._xscale = myDiviser; }; That shud work! |
|
|
2004-08-22
#22 |
||
|
Great Tutorial.
|
|
|
|
2004-08-24
#23 |
||
|
bluebox_d -- i noticed you didn't use a listener object with your MovieClipLoader. why not? flash/as help docs all use a listener object. or more specifically, is there anything that using a listener gives you that you can't get otherwise? |
|
|
2004-08-24
#24 |
||
|
since some =one asked about listener.. i want to add some question along the way.. my question, does listener uses the same CPU resource as onEnterFrame? Is it resource intensive/intrusive?? What does listener do anyway? how does it triggers?? |
|
|
|
2004-09-01
#25 |
||
|
bluebox_b this may sound funny as ***** but ..Where does the script go? im using the same idea of loading multiple movie clips thanks in advance |
|
|
|
2004-09-08
#26 |
||
|
good stuff
|
|
|
2004-09-13
#27 |
||
|
Thanks a lot dudes. I do know the MovieClipLoader class, but this tutorial was great. Great Going Guys.
|
|
|
2004-09-17
#28 |
||
|
Originally posted by jassh My understanding:since some =one asked about listener.. i want to add some question along the way.. my question, does listener uses the same CPU resource as onEnterFrame? Is it resource intensive/intrusive?? What does listener do anyway? how does it triggers?? onEnterFrame uses no resources. Moving an Object.onEnterFrame would use up resources. The playhead is always moving at a user-defined framerate. To define your question: Are listeners attached to setIntervals or onEnterFrames? SetIntervals are frame rate dependent. |
|
|
|
2004-09-26
#29 |
||
|
SetIntervals are frame rate dependent.
Since SetInterval works with milliseconds, how can it be that it`s frameDependend.Isn`t it true that the listener is frame dependend? |
|
2 Creative Assets
|
2004-09-29
#30 |
||
|
I'm back to preloading...again. One thing I don't understand is why you use movCL.getProgress(targetMC);. Aren't you suppose to use the name of your MovieClipLoader? Also I don't see where you define movCL, maybe I'm just missing it since it's late or something. ![]()
Method; returns the number of bytes loaded and total number of bytes for a file that is being loaded using MovieClipLoader.loadClip(); for compressed movies, it reflects the number of compressed bytes. This method lets you explicitly request this information, instead of (or in addition to) writing a MovieClipLoader.onLoadProgress listener function.
Cheers,-Neverrain |
|
|
2004-09-30
#31 |
||
|
Originally posted by Neverrain movCL is the name of the MovieClipLoader. The targetMC is the var being used in the function. When you call the funtion it will refer to the targetMC that you are calling.One thing I don't understand is why you use movCL.getProgress(targetMC);. Aren't you suppose to use the name of your MovieClipLoader?
Originally posted by Neverrain var queCL = new MovieClipLoader();Also I don't see where you define movCL, maybe I'm just missing it since it's late or something.
That's where the MovieClipLoader is being defined |
|
2 Creative Assets
|
2004-09-30
#32 |
||
|
var queCL = new MovieClipLoader(); That defines movCL? Why isn't it more like this then? var movCL = new MovieClipLoader(); |
|
|
|
2004-10-21
#33 |
||
|
Yeah, I am glad someone else got confused here. I have read the scripts for more than a dozen pre-loaders and they all have some random lack of declaration for the object to which the methods getProgress, etc. are applied. It's as though movCL in the above example is some "generic" or temporary variable that is never used other than to extract the results of the method. But still, why doesn't anyone discuss it? Thanks Neverrain for asking...I'm curious too.
|
|
|
|
2004-10-23
#34 |
||
|
Could someone post a fla file for this thread?
|
|
| Mime |
2004-11-02
#35 |
||
|
This might help some people who just want to load one swf at a time in an easy and simple manner with actionscript 2.0 (using the player 7). Paste this on keyframe 1 actions of your master.swf: (I will call this the mcl BLOCK between the mcl line comments for later reference.) // ------------<MCL>------------ \\ var myMCL:MovieClipLoader = new MovieClipLoader(); var myListener:Object = new Object(); 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 + " %"; _level50.preloadInfo2.text = Math.round(loadedBytes/1000) + " K / " + Math.round(totalBytes/1000) + "K"; } myListener.onLoadComplete = function(target_mc) { _level50._visible = false; } myMCL.addListener(myListener); // ------------</MCL>------------ \\ /* the next action below this comment loads in your actual preloader.swf onto level 50 or a higher number but must be a number above all other levels. The preloader is just a 100 keyframe animation of yours such as a growing line or image representing your loading progress made into an MC and given an instance name of preloader. The above script has two lines of code which mention preloadInfo1.text and preloadInfo2.text... you can have 2 dynamic text fields on your preloader animation to show the percent totals in numbers also if you like...just remember to give them instance names of preloadInfo1 and preloadInfo2. Make sure you have a stop(); action inside the preloader movie clip on the first keyframe so it doesn't animate until we tell it to)*/ myMCL.loadClip("preloader.swf", 50); //below is something that prompts an error if something fails // ------------<LoadVars>------------ \\ var myLV:LoadVars = new LoadVars(); myLV.onLoad = function (success) { if (success) { _level5.loadedInfo.htmlText = myLV.info; } else { _level5.loadedInfo.text = "There has been an error loading the content, please contact the webmaster to let him/her know. Thank you."; } } // ------------</LoadVars>------------ \\ //REMEMBER THIS COMMENT IN CAPITAL LETTERS FOR LATER. /*if in doubt just paste all this stuff ABOVE THIS COMMENT in keyframe 1 of the actions layer on your master main root swf.*/ __________________________________ Now to the Preloader.fla paste this in keyframe 1 of your actions layer on the front page of preloader.fla. (the page which has your closed preloader MC in the middle of the page). /*this tell the dynamic text fields to adjust if necessary for the size of the percent number increase.*/ this.preloadInfo1.autoSize = "left"; this.preloadInfo2.autoSize = "right"; /* don't forget to have a stop action inside the preloader movie clip animation on it's first keyframe as mentioned further up.*/ /* From now on all you have to do to load in swf's and have the preloader do it's thing is as follows: Where it says REMEMBER THIS COMMENT IN CAPITAL LETTERS FOR LATER further up you would type as below*/ myMCL.loadClip("menu.swf", 6); /*this loads in your main menu page - mine is called menu.swf and i chose level 6 to load it into. All of that stuff above now boils down to just saying myMCL.loadClip (blahblah.swf, layer number or movieclip name); each time you want to load something in using the preloader.*/ /* finally for each other page in your site that contains buttons with which you will load in content using this preloader you should paste the mcl BLOCK mentioned above into the same place on those pages. I hope this is of some use to people out there. I didn't write it myself, i just learn't it via Lynda.com Flash tutorials (which i recommend) and have found it very useful as are many of their training videos. |
|
|
|
2004-11-16
#36 |
||
|
Hi all, i have tried before to write a class like this, but always ran into problems with: a. Viewing the preload progress in the IDE (seems there are problems with onLoadProgress in the IDE) b. Trying to add 'load onto level' instead of creating a MC for every load. Are these problems both solvable? Until then i'll keep using the loaderclass mentioned above (which works great btw, but just isn't clear as2.0 unfortunately) |
|
|
|
2004-12-11
#37 |
||
|
onloadprogress only works in the browser. this is helping me... glad i found it.
|
|
|
|
2004-12-11
#38 |
||
|
anyone know how to play an SWF animation instead of text? i really need to find out. |
|
|
|
2004-12-11
#39 |
||
|
bluebox's PM INBOX IS FULL... no... i had a Q about how he made new ezra's transitions. |
|
|
|
2004-12-18
#40 |
||
|
guys, bluebox you use que as an MCL class, you don't even have a listener... thus making the code invalid.
|
|
| 12> | Page 1 of 2 |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|


72 comments
| 13021 views



ObjectsToLoadQue has caps in the "usage" suggestion above.
2 Creative Assets

Linear Mode