This content has been marked as final. Show 10 replies
do you only want the button to be visible when a particular movieclip's _currentframe is within that range or do you want the button to be visible all the time and only execute certain script when your particular movieclip's _currentframe is within that range?
I was thinking about not having the button visable at all just put it off the stage and make the keypress the only way to activate the button. So I guess it never really needs to be visible it only needs to exist to handle the keypress.
then you're either going to need a loop that will repeatedly check the _currentframe of your particular movieclip or you'll need to place code on each of the designated frames where the playhead can enter that range.
Ok that gives me a better idea of where I need to start I kinda figured I was going to need to loop the information since everything else is a loop the movie is completly dynamic so all the elements are called into life by the loop that reads the XML I think I will start there and see if I can attach it to the loop that is calling the clips in the first place.
Wish me luck
ok this is sorta working but as I have said before I am still kinda new at ActionScript but I am a quick study.
The problem I have now is that it plays both sounds at the same time, so I know I missed something, but at least it is playing the sounds. here is the code for the button that I am trying to make work.
i'm surprised that plays any sound, at all. you should check to see if there's something else in your fla that's causing a sound to play.
to create a sound instance you use:
If I create the clips as you suggest can I just reference them with
on my button action?
I think I am more confused than I was. I usually just attach one sound to a button at time this is something new for me.
And no there was nothing else making the sound play I guess if it is more correct to use the (); after the new Sound than that's an easy thing I overlooked but now I have no sound playing.
OK after fighting with this this morning I gave it a rest came back and decided to create a simple movie to see if there was anything else causeing the problem
I created a blank stage
placed a movie clip on it in
Imported 2 sound wav files (1 buzz and 1 blip)
Linked the sounds in the properties panel
and made the movie clip appear in two places for 50 frames in each location
then I added the code in the code box to an actions layer
It still however plays both sounds when the circle is on the left side _x<275
and plays no sound at all when it moves to the other side _x>275
So My thought is that maybe I can't do it this way any ideas? Anyone.