A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: How to preload holder MC

  1. #1
    Senior Member vucjak's Avatar
    Join Date
    Mar 2002
    Location
    BanjaLuka, RS, Bosnia
    Posts
    306

    How to preload holder MC

    HI, I`m trying to use this code to preload holder MC which is loading external SWF, but it looks like I`m not doing all the things right.

    byteload = _root.holder.getBytesLoaded();
    bytetotal = _root.holder.getBytesTotal();


    ready = Math.round((byteload/bytetotal)*100)+ "%";
    ready1 = Math.round((byteload/bytetotal)*100);
    kilobytes = Math.round(bytetotal/1000);
    bar._xscale = ready;
    if (ready1 == 100) {
    this.gotoAndStop (3);
    _root.play();
    }else{
    gotoAndPlay (1);
    }

    please help

  2. #2
    Member
    Join Date
    Apr 2006
    Posts
    51
    So you have an external movieclip( in a swf file) that you wish to load into a container movieclip named Holder.
    first of all you must start load the .swf(in my example holder.swf) file in the holder MC

    holder.loadMovie(holder.swf);

    bytetotal = holder.getBytesTotal();
    byteload = holder.getBytesLoaded();

    If it doesn't work post the fla file, maybe it's something else unrelated to the code you have written.

  3. #3
    Senior Member vucjak's Avatar
    Join Date
    Mar 2002
    Location
    BanjaLuka, RS, Bosnia
    Posts
    306
    Thanks dark soul, I allready did that part. In attachment you can see my fla. Please check it out.
    Attached Files Attached Files

  4. #4
    Junior Member
    Join Date
    Jan 2007
    Posts
    2
    He man, something brought my attention. Revise the following line in your script:
    code:
     ready = Math.round((byteload/bytetotal)*100)+ "%"; 


    the ready variable should be strictly a number so you can use it in the _xscale command.
    Osama Jamal
    Profession: Industrial Engineer
    Interests:
    AS and Flash
    German Language (Deutsch)
    Lightwave 3D
    A Member of Seeds of Peace
    Machine Design
    Simulation and Operations Research



    Amman/Jordan
    University of Jordan

  5. #5
    Senior Member vucjak's Avatar
    Join Date
    Mar 2002
    Location
    BanjaLuka, RS, Bosnia
    Posts
    306
    yes, but that is not the point.... _xscale I do not use there. It`s left from my scale preloader, so I do not belleve that chould be the problem.
    Last edited by vucjak; 01-03-2007 at 08:49 PM.

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