stop a sound from looping

Ask a Question related to Macromedia Flash Actionscript, Design and Development.

  1. #1

    Default stop a sound from looping

    Can someone tell me how to stop a sound from looping.
    this is my script :



    onEnterFrame = function () {
    bus_mc._x += 20;

    wave_sound = new Sound();
    wave_sound.attachSound("bob");
    };

    if (bus_mc._x>=200) {
    wave_sound.start(0, 1);

    }

    if (bus_mc._x>=850) {
    bus_mc._x = 0;
    getURL("http://www.cube.be", "_self");
    }
    };

    cubicus Guest

  2. Similar Questions and Discussions

    1. Stop a Looping .SWF
      hi there, you can stop the flash movie from looping by adding the following param <param name="loop" value="false">
    2. SWF movies- stop looping
      Hi I have a SWF file and it I have it playing in a html page. I DO NOT want it to loop as after its done you go to a diffrent page. I have managed...
    3. How to stop looping
      I am trying to create a banner to a web page. I have the flash movie created, but I cannot figure out how to get the animation to play once and then...
    4. MX Prof 2004 - Unable to stop movie from looping
      Hello, My Flash document is a product demo and many subsequent scenes include AVI movie clips. My problem is that the AVIs keep looping and I...
    5. How can I get my Flash video to stop looping and...
      How can I get my Flash video to stop looping and play the same on all computers. What I have is 4 introduction videos playing in different...
  3. #2

    Default Re: stop a sound from looping

    well, what you have there is how to play a sound once (ie without looping):
    wave_sound.start(0, 1);

    The problem is that it's in an onEnterFrame handler - once your 'if'
    condition is true, i would expect the sound to be started over and over
    again, each time the enterframe handler is executed, and maybe this is why
    it appears to be looping. You need to set a flag saying the sound has
    already been started:

    if (bus_mc._x>=200) {
    if (!this.bSoundDone){
    this.bSoundDone = true;
    wave_sound.start(0, 1);
    }
    }


    hth

    }`¬P

    --
    ---------------------------------------
    [url]http://www.phageinteractive.com[/url]
    PhageInteractive Ltd.
    remove mm_ to mail
    ---------------------------------------
    'I wish we lived in a world where it was possible to be religious and think
    at the same time.' - Jonh Graves



    Peter Blumenthal Guest

  4. #3

    Default Re: stop a sound from looping

    that did the trick, many thanks...

    greetz,
    cubicus Guest

  5. #4

    Default Re: stop a sound from looping

    cool...

    }`¬P

    --
    ---------------------------------------
    [url]http://www.phageinteractive.com[/url]
    PhageInteractive Ltd.
    remove mm_ to mail
    ---------------------------------------
    'I wish we lived in a world where it was possible to be religious and think
    at the same time.' - Jonh Graves


    "cubicus" <webforumsuser@macromedia.com> wrote in message
    news:c24mcd$42a$1@forums.macromedia.com...
    > that did the trick, many thanks...
    >
    > greetz,

    Peter Blumenthal Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139