A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: problem loading external swf file

  1. #1
    i am using flash 5 and i have a intro for my website that i added sound to. before i added sound it worked fine without problem but, now it gets to 319/320 kb and stops
    obviously loading the external file is causing this. In the folder wher i publish my flash movies the intro.html works fine and plays with the sound no problem but on my site it doesn't work? what can be wrong? do i need a pre loader for my sound file aswell? if so how do i do this? also the file size hasn't gone (still 320 after the sound file added) up so i am guessing that the sound file hasn't loaded plz help - barry

  2. #2

  3. #3
    Registered User Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    I'm curious, did you use a LoadMovie for the sound file?

    If the sound file is an external file, your intro size is not supposed to go up. On the other hand, you have to load the sound file, as a movie swf, by the way, to the server. If it's loading to 319K and stopping, and 319K is the size of the intro, the sound file is not available. Use load movie.

  4. #4
    loadMovieNum ("ck_sound.swf", 10);

    thats the command i used, so i need a preloader for my sound movie aswell?

  5. #5
    Registered User Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Technically, you don't need to use a preloader for anything, as the movie will load anyway. Preloaders just give the audience something to look at while the site loads.

    To use LoadMovie, first you need to make the sound file into it's own movie, name it sound1.swf. It has to have a name, and it has to be a symbol, with a name. It also needs a label name in frame 1. Save this as an swf, in the same folder your main movie is in. When that is done, open up your preloader. Make a new layer and call it 'Loadsound'. In the first frame of the Loadsound layer, add this action:

    Code:
    loadMovieNum("sound1.swf", 0);
    Maybe the problem with yours is you loaded it to the wrong level, unless your preloader is on level 10. And your sound movie should not be a part of your main movie. It has to be outside the main movie to target it right. Also, you don't want it to load as part of the movie.

    The sound will loop unless you make the sound timeline, say 50 frames long, and add a stop action to the last frame of the sopund1.swf movie.

    The beauty of loadMovie is, you don't add the weight of the soundfile to your intro. You could also call that sound file up anywhere else in the movie you care to, and it won't add any weight to the movie. Set it to stream, and it should work fine on any reasonably fast computer and hookup.
    [Edited by iaskwhy on 09-08-2002 at 04:01 PM]

  6. #6
    ok i got it to work

    i take it this command loads the movie first and then the external file after once it has finished, this is causing me the problem that the user can start the movie before the music has loaded how can i fix this? idealy i would like another loadbar to show saying "music loading" or something is this poss?

  7. #7
    Senior Member
    Join Date
    Apr 2001
    Posts
    207

    Smile you could always....

    Xcuse my english.

    if your sound is too large you have two options:

    STREAMING:

    you create an instance of a sound object, in which you load the sound. This instance is what YOU will use to change the properties of the sound (volume for instance).

    Here again, you can load dynamically sounds under a certain format, which happens to be MP3.

    mySound = new Sound();
    mySound.loadSound("music.mp3",true);

    mySound = new Sound();
    You create a new Sound object.

    mySound.loadSound("music.mp3",true);
    You load music.mp3 into mySound. The second parameter is call isStreaming. If it's set to true, the sound will play while loading, whereas it will wait until it's fully loaded before playing if isStreaming is set to false.




    ANOTHER WAY IS PRELOADING IT:

    Make an .SWF with a preloader in SCENE1 and put your sound SCENE2. And then just load that .SWF into your main movie.

    NOTE: When you preview your movie and load the .SWF, you won´t see the preolader. you will see it after you upload it to your server and access by internet.



    NOTE2: i like it better this way than the first one.



  8. #8
    Registered User Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    >>this is causing me the problem that the user can start the movie before the music has loaded

    When you make your sound swf, set the properties to stream. That should start the sound as soon as the preloader is done. If the files are too fat in your intro, your going to have trouble with your sound, no matter what. You might try setting a label at the far end of the intro and have the preloader only start the intro when that is loaded fully.

    Leanord may have the better way, using action script. I just don't know enough about it yet to help that way.

  9. #9
    ok so i think i want to put a pre loader onto my sound.swf

    this is my situation -

    my movie is called ck_intro.swf in the first scene of this movie i have a preloader which loads the other three scenes included.

    loadMovieNum ("ck_sound.swf", 10);

    At the beginning of the second scene i have the above command in the first frame.

    is it possible to insert a scene in between these 2 scenes that will be the preloader for my sound file (ck_intro.swf) basically can i make a preloader that loads an external movie? if so how can i do it?

    for my original movie i used the preloader located here
    http://www.flashkit.com/tutorials/Ac...89/more2.shtml
    what modifications could i make to this code to enable it to load an external file?

    i know this probably dont make too much sense but... after all i am just a nOOb
    [Edited by garrybibson on 09-09-2002 at 04:19 PM]

  10. #10

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