Forum Moderators: open

Message Too Old, No Replies

event sound on button refuses to play once movie has run for 15 sec.

is this a weird Flash sound bug? What is going on here?

         

Benek

4:11 pm on Jun 3, 2005 (gmt 0)

10+ Year Member



Please see the page at:
<SNIP>

The problem is this:
On the knob that changes channels, there are invisible buttons (+ and -), and each of these buttons has an event sound on it's down state (sounds like clunk of knob turning). This event sound plays normaly when the buttons are pressed during the first approx. 15 seconds. Then, mysteriously, the sounds refuses to play, when either button is pressed. Other sounds in the movie continut to work, but this one sound doesn't.

It is very odd and I don't even know where to start to fix it. I did do one thing for troubleshooting. I put the movie clip with the buttons by itself in a new movie, and it worked fine. Then when I put it back in the original movie it had the same problem again.

Has anyone experienced a problem like this before. Any ideas would be greatly appreciated!

[edited by: BlobFisk at 4:15 pm (utc) on June 3, 2005]
[edit reason] No URLs please! See TOS [webmasterworld.com] [/edit]

Richard_N

5:42 pm on Jun 3, 2005 (gmt 0)



is the actionscript on the button or in the main timeline?

I always place all the code now within the main timelne where possible, makes problems easier to diagnose.

Benek

7:31 pm on Jun 3, 2005 (gmt 0)

10+ Year Member



There is no actionscript relating specifically to the sound for the buttons. The sound is simply placed on the over state of the buttons.

How would I write actionscript on the main timeline that tells a sound to play on press of a button?

Richard_N

9:09 pm on Jun 3, 2005 (gmt 0)



Ok sorry reas it quickly, in answer to your question you can set up a listener to monitor an onPress event and then react accordingly ie trigger a sound event.

I presume the parent movie is running a timeline as you stated the first 15 seconds, is there anything on the timeline which is interfering, or are the buttons being overwriten or changed at some further keyframe?

You may need to remove/disable each item in turn to debug the problem

Benek

10:09 pm on Jun 3, 2005 (gmt 0)

10+ Year Member



No, that's the weird part about it. The main timeline is very short, only a few frames. It ends in about 1 second and then the button and other clips are just left there. So, nothing is changing on the main timeline that could be affecting the buttons, and there is no chance they are getting overriden or anything.

Since my link was removed to the page I wanted to add a bit more description. I tested it some more and realized that the sound does seem to stop at about 15 seconds after the movie loads. If I push the button over and over again right from the start, it will make the sound every press, and then 15 seconds later suddenly I press and no sound. Also, If I just let it sit there, not pressing the buttons, then after 15 seconds press it once, no sound.

*** To see the swf I'm having trouble with here please go to my profile and click on my homepage. Once there find Helios Project in the Design section. It is that page that I'm referring to.

The main timeline, and every other timeline in the movie for that matter, end before 15 seconds, so I can't see how anything else in the movie could be changing after 15 seconds and affecting the button's sound in this way.

I will try the idea with listeners and see if I can get that working. Perhaps removing the sound from the button entirely and putting it on the main timeline will somehow solve the problem. I'm just worried about one thing with this: Will this result in the sound being played just as instantly as it does when placed on the hit state of the button? Timing here is very important, and if there is even a fraction of a second delay it will not sound right.

If anyone else has more ideas please keep shooting. This is a weird issue and I need all the minds I can get to help please.

Benek

4:21 pm on Jun 4, 2005 (gmt 0)

10+ Year Member



This is driving me crazy!

I'm not an Actionscript pro and I couldn't figure out how to do the listener thing, but I found a way to trigger playing of the sound from the main timeline that has the same effect. Needless to say it didn't solve the problem. It did trigger the sound each time, but like before stopped working after about 15 second. Here's the code I used on the main timeline:

stop();

this.onEnterFrame = function(){
if (_root.knobturn) {
knobSound = new Sound(this);
knobSound.attachSound("knobturn");
knobSound.start();
_root.knobturn = false;
}
else {
}
}

and then this on the button:

on (press) {
_root.knobturn = true;

This created a slight delay in the playing of the sound (miliseconds) but it was noticeable. I could live with the delay if this had solved the problem, but it doesn't.

Any ideas here?! No matter where or how I trigger this sound, it refuses to play after the movie has been loaded for 15 seconds!

Benek

2:49 pm on Jun 7, 2005 (gmt 0)

10+ Year Member



Any ideas?!

Benek

5:46 pm on Jun 15, 2005 (gmt 0)

10+ Year Member



Problem solved, thanks to a little help from Richard