A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: loaded clip's sound

  1. #1
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389

    loaded clip's sound

    Hi,

    I'm loading a clip which has some loaded sounds with the movieClip Object, but no sound is heard.

    The sound is attached and started in the clip and sounds on its own.

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi Cap,

    You might need to provide us with a small sample file here.
    Are the sounds on the timeline, how are you loading the external clips?

    If so, are you using MovieClipLoader to load the swf's ?

    Just need a bit more

  3. #3
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389
    yes, I'm using the cliploader.

    this is what I have in my chat :

    Code:
    oLoader.loadClip("jungla.swf", BGHolder);
    and the sound is loaded in the jungla.swf:

    Code:
    var jungleRoom:Sound = new Sound();
    jungleRoom.attachSound("rainforest");
    
    jungleRoom.start();
    
    jungleRoom.setVolume(30);
    
    var rCut:Number = Math.floor(Math.random()* 3) + 1;
    jungleRoom.start(rCut, 1000);

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi Cap,

    You need to put the sound in the main swf/fla

    or you could load the sound externally from the loaded swf, stream the sound basically, and when the sound completes

    Sound.onSoundComplete = Sound.start; or something like that
    Last edited by fruitbeard; 02-20-2015 at 12:15 PM.

  5. #5
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389
    How do you load it externally?

    I will still try to place the sound in the source file and try, but sometimes I've noticed it doesn't load them, that's why I do it in the swf like I did as clips attached from the source library.

  6. #6
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi,

    It should always work if the path is correct,

    PHP Code:
    var music:Sound = new Sound(this);
    music.loadSound("sounds/jungleSound.mp3",true);
    music.onSoundComplete = function()
    {
        
    trace("music looping");
        
    this.start(0);
    }; 

  7. #7
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi Cap,

    I know you are trying to load each clip for a different room in your chat.
    You should load each clip with its image and then use the stream sound code above to play the associated music for each clip.
    Streaming the sound not only makes your file sizes much much smaller and the stream only takes about 2-3 seconds to start playing.

  8. #8
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389
    I see,

    just tried it. Perfect.


    thanks,

  9. #9
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,785
    Hi Cap,

    Remember to delete the old sounds from your libraries x

  10. #10
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389
    sure,

    sounds and images...

    thanks

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