A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Trouble sleeping...(controlling sound in MC?)

  1. #1
    Bob (the singing sock)
    Join Date
    Aug 2000
    Location
    Århus, Denmark
    Posts
    472
    Hi there

    It's now 5.18 in the morning, I couldn't fall asleep becuz of the following problem

    I have a MC, "soundsgood", with 3 different sounds in different frames. After each sound there is the frameaction "stop".

    Whenever a condition i fullfilled I tell the target "soundsgood" to "play". This works fine but only the first time through. After that there is no sound?

    I've traced the frame number of "goodsound" and it is playing as it should. But for some reason the sounds are not played.

    if (_root.flip1._currentframe == 2 && this._y>330 && this._y<415) {
    _root.score = Number(_root.score+1);
    tellTarget ("_root.soundsgood") {
    play ();
    }

    Please help me get some sleep this morning
    Kris

    BTW: Isn't there a better syntax than this?
    tellTarget ("_root.soundsgood") {
    play ();
    }
    Have a look at it here...
    http://www.hawaii.person.dk/smackthefish.swf



    [Edited by podenphant on 11-02-2000 at 12:10 AM]

  2. #2
    Member
    Join Date
    Jul 2000
    Posts
    56
    Try embedding your sounds into different movieclips, I've experienced a problem like yours; in my case, I needed three differnt sounds to be played in three different events. Putting sounds in different movieclips somehow works...

    Isn't there a better syntax than this?
    tellTarget ("_root.soundsgood") {
    play ();
    }
    Yes there is:
    try this:

    _root.soundsgood.play();







  3. #3
    Bob (the singing sock)
    Join Date
    Aug 2000
    Location
    Århus, Denmark
    Posts
    472
    Hi selcuk,

    Thanks for your reply, however the sound is still only played 3 times.

    if (_root.flip1._currentframe == 2 && this._y>330 && this._y<415) {
    _root.score = Number(_root.score+1);
    _root.soundsgood.play();
    this.removeMovieClip();
    }

    Do you see any problems with the code above?
    It would be unbarable if the problem cannot be solved
    Any ideas?
    -K

  4. #4
    Member
    Join Date
    Oct 2000
    Posts
    35
    I'm no code master, but do you have some code in soundsgood that tells it to go back to frame 1 ?

    Maybe that's your prob...

    Josh

  5. #5
    Senior Member
    Join Date
    Oct 2000
    Posts
    144

    go to and play (1) or go to and stop

    go to and stop or go to and play (1)

  6. #6
    Bob (the singing sock)
    Join Date
    Aug 2000
    Location
    Århus, Denmark
    Posts
    472
    Hi guys,

    yup, I already have the code that tells soundsgood to go back to frame 1.
    That's not it

    Keep those ideas coming. I'm blowing steam out of my head!
    -K

  7. #7
    Member
    Join Date
    Jul 2000
    Posts
    56

    I dont see any problem in your code but what I meant was embedding sounds to three different movies:

    say sound1.wav to soundsgood1
    sound2.wav to soundsgood2 and
    sound3.wav to soundsgood3

    stop(); 'to the first frame of the each MC
    start sounds from the second frame

    I think you are using such an 'if' control:

    if (some event) {

    ...
    _root.soundsgood1.play();
    }

    to last frames of soundsgood1 and soundsgood2

    _root.soundsgood2.play(); 'first MC's last frame
    _root.soundsgood3.play(); 'second MC's last frame

    I know it's not time-saving, however it worked in my case...


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