dcsimg
A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: onLoadProgress not activated?

  1. #1
    ReMember gobbles's Avatar
    Join Date
    Nov 2002
    Location
    Denmark
    Posts
    983

    onLoadProgress not activated?

    Hi I have this code from a tutorial at gotoAndLearn.com (loading multiple swf's)

    The code looks like this and "works" ...

    Code:
    var mcl:MovieClipLoader = new MovieClipLoader();
    var mclL:Object = new Object();
    trace("before");
    mclL.onLoadProgress = function(target, loaded, total) {
    	trace("after");
    	loader.percent.text = Math.round((loaded/total)*100)+"%";
    };
    mclL.onLoadInit = function() {
    	loader._visible = false;
    	loader.percent.text = "";
    };
    mcl.addListener(mclL);
    mcl.loadClip("swf1.swf", holder);
    "Now the swf1.swf" loads fine into the "holder" and the "loader" MC is displayed when it is loading ... but:

    All the code under mclL.onLoadProgress is not run .. I get the "Before" but not the "after" and therefor there is no text in the loader.percent.text box.

    Why is onLoadProgress not "fired"?

    Thanks
    http://www.rickigregersen.com ...finally a blog!

    Your damned if you do...but your particually damned if you don´t

  2. #2
    I don't think that it will fire the onLoadProgress if you are running it locally. Have you tried uploading the file and testing it?

  3. #3
    Senior Member inder_s2010's Avatar
    Join Date
    Apr 2004
    Location
    don't no
    Posts
    198
    which flash version are you using??

    you can also try getProgress function
    inder

  4. #4
    ReMember gobbles's Avatar
    Join Date
    Nov 2002
    Location
    Denmark
    Posts
    983
    Hi Guys

    http://www.ors.dk/ricki .. I have tested it online, still the strange error..the orange box is my preloader and the white page with the components "thrown" in is my external swf's.

    Im using Flash MX 2004 prof. ver. 7.2

    I followed Lee's tutorial at gotoandlearn.com exactly..

    Other bits of info I can remember... I installed the data wizard connection plugin, the datagrid colum editor and Im on a mac...

    Thanks
    http://www.rickigregersen.com ...finally a blog!

    Your damned if you do...but your particually damned if you don´t

  5. #5
    ReMember gobbles's Avatar
    Join Date
    Nov 2002
    Location
    Denmark
    Posts
    983
    *inder_s2010* How would I use the getProgress instead of the onLoadProgress in my code?

    I looked in the help file but the example there is a bit confusing as they make all the mc's and textfields dynamically and involved a drag function..

    Could you help me "boild" it down..`?
    http://www.rickigregersen.com ...finally a blog!

    Your damned if you do...but your particually damned if you don´t

  6. #6
    Senior Member inder_s2010's Avatar
    Join Date
    Apr 2004
    Location
    don't no
    Posts
    198
    here it is
    mcLoader is objectMovieClipLoader that you are using, and some other parameters which i have passed into checkprogress function...
    Code:
    var intrvl:Object = new Object();
    intrvl.id = setInterval(checkProgress, 100, mcLoader, image, intrvl);
    
    function checkProgress(mcLoader:MovieClipLoader, image:MovieClip, intrvl:Object):Void {
        trace(">> checking progress now with : " + intrvl.id);
        var progress:Object = mcLoader.getProgress(image);
        trace("bytesLoaded: " + progress.bytesLoaded + " bytesTotal: " + progress.bytesTotal);
        if(progress.bytesLoaded == progress.bytesTotal) {
            clearInterval(intrvl.id);
        }
    }
    inder

  7. #7
    Senior Member inder_s2010's Avatar
    Join Date
    Apr 2004
    Location
    don't no
    Posts
    198
    its quite weird but i have tested that your online works fine on flash player 8. try it...
    inder

  8. #8
    Senior Member inder_s2010's Avatar
    Join Date
    Apr 2004
    Location
    don't no
    Posts
    198
    its quite weird but i have tested that your online file, it works fine on flash player 8. try it...
    inder

  9. #9
    ReMember gobbles's Avatar
    Join Date
    Nov 2002
    Location
    Denmark
    Posts
    983
    Hi inder..

    Yes I been doing som testing myself.. all documentation says that you need at least flashplayer 7 to use the onLoadProgress.. I then downloaded some different browsers and as I downloaded firefox it updated the flashplayer automatically .. and now the script worked.

    So it seems to be a "bug" in the documentation .. it needs flashplayer 8 instead of 7.

    Thanks for your example I liked the setInterval solution and maybe I will go with that as the application will be used by all sorts of people and not just those with "state of the art" flashplayers .

    Also it is quite dullsome to have to upload my file each time to test it.

    So we worked it out : ) thanks again.
    http://www.rickigregersen.com ...finally a blog!

    Your damned if you do...but your particually damned if you don´t

  10. #10
    Senior Member inder_s2010's Avatar
    Join Date
    Apr 2004
    Location
    don't no
    Posts
    198
    no problem gobbles
    inder

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