A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Why doesn't my external preloader work in MX 2004 (look at code0???¿¿¿

  1. #1
    Senior Member
    Join Date
    Mar 2003
    Location
    san francisco
    Posts
    106

    Why doesn't my external preloader work in MX 2004 (look at code0???¿¿¿

    -----------This code is on the empty MC container.

    onClipEvent (load) {
    loading = true;
    }
    onClipEvent (enterFrame) {
    if (loading) {
    if (this.getBytesTotal()>_root.baseSize) {
    percent = this.getBytesLoaded()/this.getBytesTotal()*100;
    trace (percent);
    _root.loadingBar.bar._xscale = percent;
    if (percent == 100) {
    loading = false;
    _root.loadingBar._visible = false;
    this.nextFrame();
    }
    }
    }
    }


    --------------this is the code on the button

    on (press) {
    container.loadMovie("flash.swf");
    _root.loadingBar.bar._xscale = 0;
    _root.loadingBar._visible = true;
    }

    ------------this is the code on the load bar

    onClipEvent (load) {
    this._xscale = 0;
    }

    -----------------------------------------------

    here is a link to my file

    link

    Thanks, Montara

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    if (this.getBytesTotal()>_root.baseSize) {//etc..

    _root.baseSize being also Total, what about getBytesLoaded() ?

    gparis

  3. #3
    Senior Member
    Join Date
    Mar 2003
    Location
    san francisco
    Posts
    106
    I don't know what you mean. What about getBytesLoaded()?

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    You have on _root:
    baseSize = container.getBytesTotal();

    Then on 'container':
    if (this.getBytesTotal()>_root.baseSize) {//etc..

    So your conditional on 'container' is basically saying:
    if (this.getBytesTotal()>this.getBytesTotal()) {//etc..

    see now?

    gparis

  5. #5
    Senior Member
    Join Date
    Mar 2003
    Location
    san francisco
    Posts
    106
    I see! not good. So why did this script work in Flash 5?

    I'm lost? I don't know how to make this work for me. I don't see why this doesn't work! It would be great to know how to make this preloader work but I seem to be missing something is it because I haven't used flash since flash 5 and I just bought MX 2004?
    Last edited by montara1; 02-18-2005 at 08:41 AM.

  6. #6
    Senior Member
    Join Date
    Mar 2003
    Location
    san francisco
    Posts
    106
    any suggestion would be great.

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