dcsimg
A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 22

Thread: Preloader bar works perfectly, but not if swf is externally loaded

  1. #1
    Member
    Join Date
    Apr 2007
    Posts
    62

    Preloader bar works perfectly, but not if swf is externally loaded

    Hi Guys, (using flash 8 professional)

    I am at my wits end with this one.
    I am no expert in flash but a year or so ago i managed to create a preloader bar which i pretty much use all the time now.

    For our companies latest site however i changed the navigation structure to use shell navigation. (basically i have a master index menu that loads in all the sub pages)

    Unfortunately the preloader bar no longer works but the percentage and data values update perfectly.

    Is there any way i can modify it to work properly.
    I have attached the fla file.
    The coding on bar is shown below

    To see the problem go to www.omega-completion.com (its the intro 3d tools spin round movie that has the problem)

    Alternatively open homeflashkit.fla as this is the file the movie loads into

    Thanks J

    loadedbytes = getBytesLoaded();
    totalbytes = getBytesTotal();
    loadedkbytes = Math.ceil(loadedbytes/1000);
    totalkbytes = Math.ceil(totalbytes/1000);
    if (loadedbytes == totalbytes) {
    nextScene();
    }

    frame = int(loadedbytes/(totalbytes/100));

    loader.gotoAndStop(_root.frame);
    Attached Files Attached Files
    Last edited by jamesaberdeen73; 05-24-2008 at 05:03 AM.

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    basically i have a master index menu that loads in all the sub pages
    Let's say you load swfs into an empty movieclip with instance name container. Writing this:

    PHP Code:
    loadedbytes container.getBytesLoaded();
    totalbytes container.getBytesTotal(); 
    will return the total and loaded bytes of that container. Which is, i assume, what you want.

    gparis

  3. #3
    Member
    Join Date
    Apr 2007
    Posts
    62
    is "container" the instance name i should give to the place holder movie clip?

    my homeflashkit.fla file has a placeholder movie in it called "loader_clean_out_valve".

    Its basically just an empty movie that is used to control the position of the empty movie.

    I would then add the following code to get the first external movie to load in automatically

    loader_clean_out_valve.loadMovie("flashkitexample. swf");

    and use the code below for a button to load in a news_003.swf for example.

    news_003_btn.onRelease = function (){
    loader_clean_out_valve.loadMovie ("news_003.swf");


    all the bytes loaded, percentage values etc update perfectly...its just that for some reason the progress bar doesnt work.

    To see this you really have to open up the Homeflashkit file and preview it with the ctrl+enter preview feature.

    Im really new to all this and have constructed most of the site with the help of the kind people on here

    Thanks for your help....sorry for being a bit dull

  4. #4
    Member
    Join Date
    Apr 2007
    Posts
    62
    I think the main problem is i need to find a different way of linking the preloader bar to the percentage value

  5. #5
    Member
    Join Date
    Mar 2007
    Posts
    37
    Hi,
    first check these files and let me know if these works according to your need or not

    Jor_homeflashkit_08.fla
    Jor_flashkitexample_08.fla

  6. #6
    Member
    Join Date
    Apr 2007
    Posts
    62
    Quote Originally Posted by jorawar
    Hi,
    first check these files and let me know if these works according to your need or not

    Jor_homeflashkit_08.fla
    Jor_flashkitexample_08.fla
    Hi there, unfortunantly I cant open the jor_homeflashkit_08.fla it says "unexpected file format"

    The other one opens ok

    Thanks for the help

  7. #7
    Member
    Join Date
    Mar 2007
    Posts
    37
    Hi try this,

    i have done just few changes on it
    Attached Files Attached Files

  8. #8
    Member
    Join Date
    Apr 2007
    Posts
    62
    Wow.......thats fantatsic....thankyou so much...your a genius....

    the only problem is now that the bar progress bar is only half way along by the time the percentage value gets to 100%

    Thanks for your help...its really appreciated

  9. #9
    Member
    Join Date
    Mar 2007
    Posts
    37
    Just follow the coding standards and use AS 2.0 instead of AS 1.0, enjoy

  10. #10
    Member
    Join Date
    Apr 2007
    Posts
    62
    Its ok...just multiplied frame by 3.8

    I think thats the correct way.

    Once again...thankyou so much

  11. #11
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    here is jorawar's version of jor_homeflashkit, saved in flash8 format so you can open it in flash8. it's good and it works. 1 thing thou, the preloader bar doesn't go all the way to the end of the track when it get's to 100% loaded, that can be fixed. other than that, jorawar fixed it perfectly. i tested it, using 56K simulated download to see the preloader and it's fine now.
    Last edited by EQFlash; 06-01-2008 at 11:35 AM.

  12. #12
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    oh ok i see you guys have it worked out, great.

  13. #13
    Member
    Join Date
    Apr 2007
    Posts
    62
    Thanks again guys........

    The people on this site are great.........

    I really need to learn some proper coding but it forms such a small part of my job i always try and just muddle through.

    Thanks again

    Regards

    James

  14. #14
    Member
    Join Date
    Apr 2007
    Posts
    62
    spoke too soon jorwar......unfortunatly the index page on my sit doesnt load the jor_homeflashkit_08.swf file

    it just flickers

    i will post in the forum

    thanks for the help
    Attached Files Attached Files

  15. #15
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    Quote Originally Posted by jamesaberdeen73
    spoke too soon jorwar......unfortunatly the index page on my sit doesnt load the jor_homeflashkit_08.swf file

    it just flickers

    i will post in the forum

    thanks for the help
    go into Jor_homeflashkit08.fla, and change this line in the actionscript on frame 1, from "_root.gotoAndStop(2)" to "gotoAndStop(2)". when you put _root in this fla, it targets the root timeline of the host movie, not it's own movie. you could also correct this by putting this line at the top of frame 1 actionscript. "this.lock_root = true" of course without the quotes. doing either of the above will solve this. your index.fla is fine as it is. hth

  16. #16
    Member
    Join Date
    Apr 2007
    Posts
    62
    hi there,

    that works fine :-)

    thanks again

  17. #17
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    no problem. glad we could help.

  18. #18
    Member
    Join Date
    Apr 2007
    Posts
    62
    Im struggling again......

    Is there any way of getting the same preloader into both the jor_homeflashkit.fla file and the index.file

    I modified the jor_flashkitexample_08.fla file to create a new index.

    ( i thought this would be an easy way of creating the preloader in the index file)...not so

    If i could just get this final issue sorted it would clear up everything.

    Maybe I have constructed the site in an overly complicated manner

  19. #19
    Member
    Join Date
    Apr 2007
    Posts
    62
    Im struggling again......

    Is there any way of getting the same preloader into both the jor_homeflashkit.fla file and the index.file

    I modified the jor_flashkitexample_08.fla file to create a new index.

    ( i thought this would be an easy way of creating the preloader in the index file)...not so

    If i could just get this final issue sorted it would clear up everything.

    Maybe I have constructed the site in an overly complicated manner

  20. #20
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    ok, you want the same preloader to be in both the host movie and the child movie? correct?

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