A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: i cant find the prob w/ this code

  1. #1
    I'm dope. Psytrix's Avatar
    Join Date
    Aug 2002
    Location
    Slidell, LA
    Posts
    309

    i cant find the prob w/ this code

    the loop is "beat1"...i cant find the problem w/ this code. when u hit the play button the 1st time, it works fine. once you have stopped it w/ the stop button once, the play button doesnt work anymore.

    the code for my play button is:

    Code:
    on (release) {
         song = new Sound();
         song.attachSound("beat1");
         song.start(0, 5);
    }
    the code for my stop button is:

    Code:
    on (release) {
         stopAllSounds();
    }
    thank you in advance

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    why not use:
    on (release) { song.stop(); }
    gparis

  3. #3
    I'm dope. Psytrix's Avatar
    Join Date
    Aug 2002
    Location
    Slidell, LA
    Posts
    309
    i put that in and the button no longer stops the loop.

    i forgot to add that im getting this output:

    **Warning** Symbol=audio, Layer=buttons, Frame=1: Line 2: Case-insensitive identifier 'sound' will obscure built-in object 'Sound'.
    sound=new Sound();

    what does that mean?

  4. #4
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,358
    'sound' is a keyword. You cant give variables names of keywords because the variables would act as the actual meaning of the keyword (i.e. the sound object) and not a variable.

  5. #5
    I'm dope. Psytrix's Avatar
    Join Date
    Aug 2002
    Location
    Slidell, LA
    Posts
    309
    ok im gonna try sum stuff, but what should i do?

  6. #6
    I'm dope. Psytrix's Avatar
    Join Date
    Aug 2002
    Location
    Slidell, LA
    Posts
    309
    thanks a million, i changed all the sounds to sound1 and i used gparis's code...and it worked.

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