A Flash Developer Resource Site

Results 1 to 15 of 15

Thread: MovieClipLoader help/question

  1. #1
    Up and Comer DMB Lover 41's Avatar
    Join Date
    Apr 2002
    Location
    Chicago, IL
    Posts
    506

    MovieClipLoader help/question

    i apologize if this topic has been beaten to death, but i've searched all over, and while i've found a lot of great resources and examples, i couldn't quite find exactly what i needed...

    basically i want to load movie clips sequentially for an image gallery, and hide them until i want to use them. this way the viewer can see ones that are loaded, and while they're looking it can load others so they're ready later instead of loading them individually. i've seen some great examples using MovieClipLoader that make it really easy to load jpg's and control their properties after they've loading using the onLoadComplete.

    but what i can't find out how to do is how i can control other movie clips on the stage using the onLoadComplete, except for one time only, usually after the first jpg is loaded. in simplest terms, i have some boxes on the stage i want to use as buttons to load the jpgs, and at the beginning i have their alpha levels set to 50%. So, when the MovieClipLoader completes loading a jpg, I want the appropriate thumbnail box alpha to tween up to 100% to let the user know it has been loaded. Hopefully that makes sense.

    Does anyone have any ideas on how to do this?

    Thanks very much!!!
    it's all in the details
    conrad-design.com

  2. #2
    Member
    Join Date
    Apr 2004
    Posts
    78
    I've been searching for this very same load queue holy grail, so let me bring this topic back to the top.

    I'm looking for the Action Script 7 equivalent of bokel's com.qlod.LoaderClass.as (http://www.helpqlodhelp.com/blog/index_org.htm).

    I've been going through that class, trying to figure out how to do the same type of load queue.

    Does anyone have the answers?!

    TIA

    Len

  3. #3
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  4. #4
    Up and Comer DMB Lover 41's Avatar
    Join Date
    Apr 2002
    Location
    Chicago, IL
    Posts
    506
    thanks for the link silentweed. i actually reviewed that thread before when i was trying to figure this out. it looks like exactly what i need as far as loading things sequentially. i assume that it will work with jpg's as long as the extension is changed from the ".swf" it's currently set at?

    so to the part that has stumped me. is there any way to control other movie clips on stage on completion of each swf loading? maybe a way to check if, for example, level_4 is empty or not and if it has had a clip loaded into it, to trigger an action.

    any ideas would be great!
    it's all in the details
    conrad-design.com

  5. #5
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    yep you can just change the .swf to .jpg to load images instead.. regarding doing something whens it loaded you need to concentrate on the following part

    Code:
    loadListener.onLoadInit = function() {
           
           //an asset has loaded now so do what you want here
    
         //and then after everything is done the following code will load the next asset
    
    if (count<aQueue.length) {
    		my_mcl.loadClip(aQueue[count].source, aQueue[count].level);
    	}
    	if (count == aQueue.length) {
    		count = 0;
    		aQueue.length = 0; //everything has loaded so now empty array so its ready for another queue push
    	}
    
    
    };
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  6. #6
    Up and Comer DMB Lover 41's Avatar
    Join Date
    Apr 2002
    Location
    Chicago, IL
    Posts
    506
    thanks for your time silentweed...

    i tried playing around with the onLoadInit and i was able to control clips on stage like i wanted, but everything i put in the onLoadInit is called after the first jpg was loaded in. ideally i'd like to be able to call a certain function after jpg1 has loaded, then call a different function after jpg2 has loaded, and so on. is there any way to do this? maybe (hopefully) i missing something in your code?
    it's all in the details
    conrad-design.com

  7. #7
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    show me an example of the function you wanna call after jpg1 has loaded, and function after jpg2 has loaded etc..ill ge a better idea of wot ur trying to do then
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  8. #8
    Up and Comer DMB Lover 41's Avatar
    Join Date
    Apr 2002
    Location
    Chicago, IL
    Posts
    506
    nothing too complicated...basically i have boxes on the stage that are the buttons to click to view the jpg's. i have the boxes animating in at 50% scale, so after the jpg has loaded, the corresponding box scales up to 100% to let the viewer know the image has loaded.

    so after jpg7 loads let's say, i'd like it to call a function (using tweening prototypes) along the lines of

    _root.box7.scaleTo(100, 1, etc.);

    thanks again for your help!
    it's all in the details
    conrad-design.com

  9. #9
    Up and Comer DMB Lover 41's Avatar
    Join Date
    Apr 2002
    Location
    Chicago, IL
    Posts
    506
    anybody able to come up with anything?

    i've been messing around with it and couldn't get anything to work. the only thing i was thinking as a last resort was to use the queue loader with swf's instead of jpg's like my original plan, and put the actions i want to happen after the swf loads in the swf. i think i could do that without a hassle, but ideally want to be able to code it all from the main swf and make it easier to update and not have to manage individual swf's.

    still looking for that magic solution!

    thanks for the help.
    it's all in the details
    conrad-design.com

  10. #10
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    So u want an image to load, scale up to 100%, and THEN the next image is told to be loaded?
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  11. #11
    Up and Comer DMB Lover 41's Avatar
    Join Date
    Apr 2002
    Location
    Chicago, IL
    Posts
    506
    i want the jpg or swf to load into the background (invisible) so that when the corresponding button is pressed, you can view the image right away. the buttons are boxes on stage that i have animated in at 50% scale. when the jpg or swf is done loading, i want the button that goes with it to scale up to 100% so the viewer knows that the image has loaded and they can view it.

    does that make sense?
    it's all in the details
    conrad-design.com

  12. #12
    Up and Comer DMB Lover 41's Avatar
    Join Date
    Apr 2002
    Location
    Chicago, IL
    Posts
    506
    silentweed..sorry to keep bugging you, but i've got a quick question on an error message i'm getting with just the queue loader (just the straight code from you, no additions/changes). publish settings are for flash 8, actionscript 2.0.

    here's the error...

    frame=1:Line 26: ';' expected
    for(var i:Number = 1 ; i <=30 i++){

    let me know what you think or how i might be able to resolve this!

    thank you very much!
    it's all in the details
    conrad-design.com

  13. #13
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    Hi dude ..a semi colon is missing after 30

    for(var i:Number = 1 ; i <=30; i++){}

    regarding your other query it may be just easier to upload your FLA so i can have a look
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  14. #14
    Up and Comer DMB Lover 41's Avatar
    Join Date
    Apr 2002
    Location
    Chicago, IL
    Posts
    506
    so after taking a little time away from this project i finally figured out what i needed to do to control individual movie clips on the stage on the completion of individual jpgs loading. adding something like on the onLoadInit this did the trick...

    Code:
    if (count == 5){
    		_root.allworkbuttons.f6.alphaTo(100, .4);
    	}
    so thank you silentweed for some great code that finally allowed me to do what i wanted!

    BUT i do have one more problem i'm running into, maybe you could help! The goal of loading the jpgs sequentially is so that the viewer could view images that have loaded while the other ones load in the background, saving load time. the jpgs are loaded into different levels, so i have all the levels _visible set to false (written in the onLoadInit), then i make them visible when the viewer clicks on the buttons. Currently the only images there are the 1-9 on the bottom row next to FINE ART. The problem i'm having with that and also viewing other images is that say the first 4 out the 9 are loading and I click to view image 3, it loads fine, but when jpg 5 finishes loading, the image I was viewing disappears. The images are all on different levels so it's not like they're replacing each other, and they all should be invisible until I call on them. If all of the images have loading everything functions fine. Can you help me???

    Here's the link to what I'm working on...

    http://www.conrad-design.com/jjtest/main.swf
    it's all in the details
    conrad-design.com

  15. #15
    Up and Comer DMB Lover 41's Avatar
    Join Date
    Apr 2002
    Location
    Chicago, IL
    Posts
    506
    nevermind my last question, i was being stupid...all the levels were set to invisible on the onLoadInit, so every time one completed loading it set them all back to invisible...stupid mistake.

    so silentweed, one (hopefully last) quick question...the way your loader is set up the jpgs or swfs must be located in the root folder of the main swf file. if i wanted to place all the images in there own folder, how do i change the source in the code? i tried it a couple ways but was getting syntax errors so i thought i'd just go to the source!

    thanks!
    it's all in the details
    conrad-design.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center