A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Preloading question

  1. #1
    Senior Member TheLostGuru's Avatar
    Join Date
    Aug 2004
    Location
    I live on this webpage...
    Posts
    784

    Preloading question

    Ok, I have 3 songs for my game, but I don't want the player to have to wait for all 3 songs to download before he plays the game. How do I make it so only one song is loaded, and then when the player starts playing, the other two loops start loading in the background so they are ready to be linked from the library?

    Also, I'm not sure if this has to do with Flash, but how do I cut a 3 minute loop down to like 30 seconds? Can I do this directly in Flash.
    Last edited by TheLostGuru; 05-02-2007 at 08:25 PM.
    "If I have seen further it is by standing on the shoulders of giants." Isaac Newton
    ------------------------------------------------------------------------------

  2. #2
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,377
    I'm not sure about your first question, but I would imagine you could just use a progressive preloader and start after X sounds have loaded, but keep loading the rest. For your second question, yes its absolutely possible, check the link below.

    www.highsocietygames.com/soundTest.html
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

  3. #3
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    Just load the first tune in with your game ( Either as part of it, which would be easier, or as soon as the game is loaded but before it starts ).

    Then just pull in the other two sounds ( Shove them in their own swfs, and have a bit of attach code in them, eg

    var song2:Sound=new Sound(this);
    song2.attachSound("song2LinkageID");

    and then to play them you can just use loadedSong2Container.song2.start(); )

    One thing to be careful of is that you shouldn't assume that song2 has loaded and start playing it without a check ( So don't think that just cause it's not needed til level 2, and it'll take the player a minute to complete level 1 that it'll be loaded. Always check ).

    Squize.

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