Flash .attachSound(); help.
- Started
- Last post
- 15 Responses
- Ctrl_Z
please answer my new.b question.
I am trying to load a sound off the library into a mouse event but having troubling doing so.
on (rollOver) {
stopAllSounds();
sound.start.attachSound();
}
where am I going wrong?thanks.
- neeko0
never done it that way, but why wouldnt you just place the sound in the over state of the button?
- Ctrl_Z0
sorry,
sound.attachSound();
sound.start();
- Ctrl_Z0
I was planning to do this for reuse of the buttons.
- Ctrl_Z0
bump
- neeko0
I'm not exactly sure i see where yur comin from, and im tired and trying not to think too much, but i would ditch the script and put the sound in an invisible button, in a second layer on the over state... whats the reasoning for avoiding that technique?
- Ctrl_Z0
I have buttons on various locations, on mouse over they would play a sound clip with a description. the button and mouse over ani stay the same. So I figure I could just .attachSound for the description I need of each button in their event.
looks like I will have to make a button per description.
thanks for your help neeko.
if you have any suggestions, it would be sooper dooper.
- neeko0
i see, same mouseover, different sound... ?
well, cant say why youre setup isnt working for you...
unless youre facing a deadline, i wouldnt go and individually enter the sound... no fun in that. it would be like admitting defeat.
- Ctrl_Z0
heh turns out I'm having troubles with my player.
I'm not getting sound from swfs.
I am battered and bruised, but not beaten. I WILL figure this out, even if it kicks my ass. :)
- unknown0
Ctrl_Z,
you should declare you var name to be a sound object.
MySoundObject=new Sound();
//declaring new sound objectMySoundObject.attachSound("LinkI...
/* when you attach the sound from the library you need to set the linkage parameters. When you right click the sound in the library there is a linkage option. You should click Export for Actionscript and Export in frame 1. Also give that sound a name in the identifier field (LinkID as I used it in the code above.
*/MySound.start();
Hope this helps.
Cheers.
- Ctrl_Z0
Boz you rock!
yes been linking to action script
thanks!
Boz = ||D || ||V|| ||D
- Ctrl_Z0
:(
still no dice but I will keep at it.
- unknown0
Come on Ctrl, let me understand this. You have a button and you want to attach a sound when rollover happens. right?
- unknown0
I don't what is wrong with your Flash but this is what I did and it worked right away:
1. Created the circle shape
2. Made a movie clip out of it
It works fine with button instance too3. Imported the sound into the library
4. Linked the sound with Linkage options (Export for AS + Export in First Frame) and gave the name "testsnd"
5. Opened actions on the circle mc
6. typed following code:on (rollOver) {
r = new Sound();
r.attachSound("testsnd");
r.start();
}on(rollOut) {
r.stop();
}7. everything worked mate
- unknown0
Ctrl_Z did you solve your problem?
- Ctrl_Z0
Boz thanks a ton of the help.
I think I am on the right path with the gems you gave me.
I just been working on other things, while tonight I will get back to finishing the ellusive .attachSound. I am confident from your prev post that it will be all the help I need.
Boz = Top Dog.
thanks again.