A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: preloader doesnt work

  1. #1
    SeniorMember yet almost newbie deniel87's Avatar
    Join Date
    Oct 2001
    Posts
    202

    preloader doesnt work

    this script doesnt work, why?
    Code:
    onClipEvent (enterFrame) {
            loadedbytes = _root.getBytesLoaded();
            totalbytes = _root.getBytesTotal();
            if (totalbytes == loadedbytes) {
                    _root.nextScene();
            }
    }
    It is placed in a MC, inside a MC, in the first frame of the first scene. The frame has a stop action.
    Im pretty sure everything works except the "_root.nextScene" because I tried replacing it with another action and it worked.
    Code:
    onClipEvent (enterFrame) {
        loadedbytes = _root.getBytesLoaded();
        totalbytes = _root.getBytesTotal();
        if (totalbytes == loadedbytes) {
            setProperty(_root.MC1, _alpha, 50);
        }
    }
    Thanks for helping

  2. #2
    SeniorMember yet almost newbie deniel87's Avatar
    Join Date
    Oct 2001
    Posts
    202

    WHOA!

    hey, I tried this:
    Code:
    onClipEvent (enterFrame) {
        loadedbytes = getBytesLoaded();
        totalbytes = getBytesTotal();
        porc = 100/totalbytes*loadedbytes;
        if (porc == 100) {
            _root.gotoAndPlay(2);
        }
    }
    AND IT WORKED!!!
    I thought it would do nothing, bacause the scene has only one frame... but it went and played the next scene!
    Now Id like (if it is possible) to understand what happened
    Thanks for helping

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