dcsimg
A Flash Developer Resource Site

Page 1 of 3 123 LastLast
Results 1 to 20 of 57

Thread: Seperate parts of movie

  1. #1
    Senior Member Camme's Avatar
    Join Date
    Oct 2001
    Location
    Belgium
    Posts
    567

    Seperate parts of movie

    I got a main movie that shows a basic text.
    But I got a menu that consist of three parts, home, links and form.
    I made home, links and form on the same scene as the main movie and identified them with frame labels.
    Now what I want is that when U go to home, the movie preloads the part home, if u go to links, it has to preload links etc.
    How can I achieve this?

    And I was thinking that maybe I should make for each part a seperate MC and let it be preloaded when u go to it. Isn't that a better way then using frame labels? But I don't know for sure how I should define in actionscript then how I could let the preloader begin after u hitted the button.

    Can anybody help me with that?
    Penguins in the dessert

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    I dont get it.
    Do you load external swf files? If so put a preloader on those.
    If not why, a preloader on something that is loaded anyway.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Senior Member Camme's Avatar
    Join Date
    Oct 2001
    Location
    Belgium
    Posts
    567
    Yeah, I want to load external SWF
    Is that a good idea ?
    And how do I do it ?
    Penguins in the dessert

  4. #4
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    Firstly, it depends on how big your SWF file is ... if all three sections are 200Kb, then I would just use one preloader at the start and forget about loading them all individually.

    If each section is quite large, you might think about making a navigation SWF, and a separate SWF file for each section. The navigation SWF would be the main movie (loaded by default in LEVEL 0), and within this SWF you would have buttons with these actions:
    Code:
    // for the HOME section button:
    loadMovieNum("home.swf",1);
    
    // for the LINKS section button:
    loadMovieNum("links.swf",1);
    
    // for the FORM section button:
    loadMovieNum("form.swf",1);
    When you click a button, the relevant movie is loaded into LEVEL 1. When you click another button, the new movie replaces the movie in LEVEL 1.

    The only other thing you need to do to make it all run smoothly is to add this line of code in frame 1 of the navigation movie:
    Code:
    loadMovieNum("home.swf",1);
    That will start the home SWF loading as soon as you go to the site, rather than waiting until someone click the button for it to happen.

    I understand all this can be very confusing, so if you need to ask more questions feel free - I'll keep answering as many as I can.
    ----------
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT

  5. #5
    Senior Member Camme's Avatar
    Join Date
    Oct 2001
    Location
    Belgium
    Posts
    567
    Ok, but where is the swf then placed?
    Will it just be centered or what?
    Penguins in the dessert

  6. #6
    Senior Member Camme's Avatar
    Join Date
    Oct 2001
    Location
    Belgium
    Posts
    567
    PS can u do this for me ?

    Can U check wether the preloader works cus my connection is too fast so the preloader is skipped
    Cus I know I have to put a stop(); action somewhere but I forgot where.
    Maybe in the second frame where the whole

    totalFrames = _root.totalframes bull**** is
    or where the

    (if framesloaded == totalframes) crap is

    http://users.pandora.be/Incubusattax/Main_movie.html
    Penguins in the dessert

  7. #7
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    Yes - if the new SWF is the same size as the old one it will be placed centrally. What I suggest you do is make the navigation SWF with its content where you want it (presumably on the left side), then make the content SWFs so that when they are placed directly on to of the navigation SWF they don't overlap it.

    As for checking your preloaders, sorry - I have the same problem (if you could call it that!) here. Fast connection ...

    When you test your movie in Flash using the CTRL+RETURN keys, press CTRL+ENTER again when the SWF starts to play - that will emulate a 56k modem speed, and you should be able to tell if it's working or not.
    ----------
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT

  8. #8
    Senior Member Camme's Avatar
    Join Date
    Oct 2001
    Location
    Belgium
    Posts
    567
    Ok, I'm going to try that and work it out, and if i have another question, I'll just post it here.

    And thank you very much man !!

    P.S. : I'll give u a sneak preview later on
    Penguins in the dessert

  9. #9
    Senior Member Camme's Avatar
    Join Date
    Oct 2001
    Location
    Belgium
    Posts
    567
    Great, now the preloader doesn't work dammit.
    This is how I've done it.

    Code:
    Frame 1 = blank
    Frame 2 :
    
    framesLoaded = _level0.framesloaded;
    totalFrames = _level0.totalframes;
    percentLoaded = Math.round ((framesLoaded/totalFrames)*100);
    bar._xscale = percentloaded;
    
    Frame 3 :
    if (framesLoaded == totalFrames) {
    	gotoAndPlay ("start");
    } else {
    	gotoandPlay("preloaderloop")
    }
    Maybe u see whats wrong ...
    Penguins in the dessert

  10. #10
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    Code:
    Frame 1 = blank
    Frame 2 :
    
    framesLoaded = _level0._framesloaded;
    totalFrames = _level0._totalframes;
    percentLoaded = Math.round ((framesLoaded/totalFrames)*100);
    bar._xscale = percentloaded;
    
    Frame 3 :
    if (framesLoaded == totalFrames) {
    	gotoAndPlay ("start");
    } else {
    	gotoandPlay("preloaderloop")
    }
    Just missing a couple of underscores ... code above should work.
    ----------
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT

  11. #11
    Senior Member Camme's Avatar
    Join Date
    Oct 2001
    Location
    Belgium
    Posts
    567
    Thx, small mistakes make a huge impact
    But the problem of the preloader is still present.
    I get first a white screen and then after a certain time I get the site.
    Is it maybe that my preloader contains an image ?
    Last edited by Camme; 07-10-2003 at 08:21 AM.
    Penguins in the dessert

  12. #12
    Senior Member Camme's Avatar
    Join Date
    Oct 2001
    Location
    Belgium
    Posts
    567
    this is the file maybe u can take a look at it ...

    http://users.pandora.be/Incubusattax/Main_movie.zip
    Penguins in the dessert

  13. #13
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    I don't have Flash on this machine ... sorry!
    ----------
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT

  14. #14
    Senior Member Camme's Avatar
    Join Date
    Oct 2001
    Location
    Belgium
    Posts
    567
    DARN !!

    Well I'll try to explain what I did then :

    I made a bar and the filling I gave instancename bar.
    I putted the bar on x:0,y:0
    I left the first frame blank.
    The second frame has the bar and a small message loading.
    The code from the second frame is the one you have above here
    The third frame has the bar too and the loading message and the code from above. Plus the framelabel start.
    Oh yeah the second frame has label preloaderloop.

    The start is a fade out of the bar and then a goptoaction to the next scene
    Penguins in the dessert

  15. #15
    Senior Member Camme's Avatar
    Join Date
    Oct 2001
    Location
    Belgium
    Posts
    567
    Try it again :

    http://users.pandora.be/Incubusattax/Main_movie.html

    I added a 1.2 Mb bmp (trust me, it's a really nice pic )
    Penguins in the dessert

  16. #16
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    I looked at the FLA when I got home. I think your main problem arises from the fact that you are using framesLoaded, instead of bytesLoaded (this gives a much smoother and constant feedback). Also, because you had everything lumped in on top of each other, some of the bits weren't working.

    Look at the attached fixed file and see what you think.
    ----------
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT

  17. #17
    Senior Member Camme's Avatar
    Join Date
    Oct 2001
    Location
    Belgium
    Posts
    567
    thx man , it works, but what did I do wrong ?
    Penguins in the dessert

  18. #18
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    Like I said, you used framesLoaded instead of bytesLoaded (this gives a much smoother and constant feedback). Look at the code in the version I sent you, then look at the code in your original version - you will be able to see the differences.

    Also, I reset the xscale of the preloader bar physically as it sits on the stage (it's now set to 1% of its original size). This just means that you don't get a flicker at the start, when the bar is 100% of its size but BEFORE lash has had a chance to work out what size it should be.
    ----------
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT

  19. #19
    Senior Member Camme's Avatar
    Join Date
    Oct 2001
    Location
    Belgium
    Posts
    567
    ok, THANK YOU VERY MUCH MAN !!!
    Now I'm going to try some page transition effects for the site, maybe if u know a good one
    Penguins in the dessert

  20. #20
    Senior Member
    Join Date
    Apr 2000
    Location
    Northern Ireland
    Posts
    2,146
    Not a problem - make sure you send me a link to the finished site!
    ----------
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." TERRY PRATCHETT

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