A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: loadmovie preloader

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    7

    loadmovie preloader

    hi .

    i tried to load an image into my stage. with clicking a button

    so i put actionscript for the button as such :

    on (release) {

    loadMovie("folderir.jpg", _root.loader.photo);
    l = this.getBytesLoaded();
    t = this.getBytesTotal();
    load_text.text = Math.floor((l/t)*100);
    load_text.text = percentage ;
    load_text.text;
    if (percentage >= 100) {


    _root.loader._x = 11;
    _root.loader._y = 15;
    load_text.text = "";
    }


    but the loader is not working the % which has to count to 100 then show the picture
    doesnt work and the picture appears with out loading..

    could u help me with that ?

    p.s : i have load_text under property of dynamic text with its instance name.

  2. #2
    Junior Member
    Join Date
    Nov 2009
    Posts
    7

    Wink loadmovie preloader

    hi .

    i tried to load an image into my stage. with clicking a button

    so i put actionscript for the button as such :

    on (release) {

    loadMovie("folderir.jpg", _root.loader.photo);
    l = this.getBytesLoaded();
    t = this.getBytesTotal();
    load_text.text = Math.floor((l/t)*100);
    load_text.text = percentage ;
    load_text.text;
    if (percentage >= 100) {


    _root.loader._x = 11;
    _root.loader._y = 15;
    load_text.text = "";
    }


    but the loader is not working the % which has to count to 100 then show the picture
    doesn't work and the picture appears with out loading..

    could u help me with that ?

    p.s : i have load_text under property of dynamic text with its instance name.

  3. #3
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    The part after the loadmovie needs to be in a loop. For example:

    PHP Code:
    this.onEnterFrame = function() {
    this.getBytesLoaded();
    //etc.

    Also, delete the loop when it's done:

    PHP Code:
    if (percentage >= 100) {
    delete this.onEnterFrame;
    //etc.

    gparis

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Wrong forum, moved to Actionscript.
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    Junior Member
    Join Date
    Nov 2009
    Posts
    7
    yea i added that part u said . and well .. the picture loads without any problem but the loader doesnt count the percentage. my new updated code is this :




    on (release) {
    this.onEnterFrame = function() {
    loadMovie("folderir.jpg", _root.loader.photo);
    l = this.loader.getBytesLoaded();
    t = this.loader.getBytesTotal();
    load_text.text = Math.floor((l/t)*100);
    load_text.text = percentage ;
    load_text.text;
    if (percentage >= 100) {

    delete this.onEnterFrame;
    _root.loader._x = 11;
    _root.loader._y = 15;
    load_text.text = "";
    }



    removeMovieClip(click);
    _root.attachMovie("click", "click", _root.getNextHighestDepth());
    click.gotoAndPlay(1);

    _root.click._x = -120;
    _root.click._y = 170;


    }
    }

  6. #6
    Junior Member
    Join Date
    Nov 2009
    Posts
    7
    the loader works now locally but when i upload it .. in firefox the loader doesnt work but in IE 7 it does work

    check this out

    http://www.tropco.com/portfolio.swf
    try it with 2 diffrent browers in the 1st button from the top right

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