dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Sound Object help

  1. #1
    Junior Member
    Join Date
    Feb 2008
    Posts
    3

    Sound Object help

    hi, I have a problem regarding Sound Objects.

    this is my code on the first frame of the movie.

    var Theme:Sound = new Sound("GlobalSound");

    Theme.attachSound("heyBlondie");
    Theme.start(0,99);
    Theme.setVolume(25);

    later on, in a nested movie clip, I'm trying to perform the setVolume command on my Theme object, like so:

    _root.Theme.setVolume(0);

    and it doesnt mute the sound (I tried with and without the _root);

    if you know whats the problem with the code, please help.

    thank u.

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    try -
    _global.Theme = new Sound();
    Theme.attachSound("heyBlondie");
    Theme.start(0,99);
    Theme.setVolume(25);


    in the movieclip -
    Theme.setVolume(0);

  3. #3
    Junior Member
    Join Date
    Feb 2008
    Posts
    3
    thanks for your reply. it works. however, the object now controls all the sound in the swf rather than "heyBlondie" sound.

    what do I do to fix it ( so it control just "heyBlondie") ?

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    try -

    this.createEmptyMovieClip("s1",100);
    _global.Theme = new Sound(s1);
    Theme.attachSound("heyBlondie");
    Theme.start(0,99);
    Theme.setVolume(25);

  5. #5
    Junior Member
    Join Date
    Feb 2008
    Posts
    3
    thanks, it works perfect!

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