|
-
Sound help
How do I make my money object Make a sound when I pick it up? I got the scoring and everything good, I just need my money to make a sound when I pick it up, How would I do this?
I am in flash 8 please help me.
-
Prid - Outing
What's the code for picking up money? If it's something like this:
Actionscript Code:
onClipEvent(enterFrame){ if(this.hitTest(_root.player)){ unloadMovie(this); } }
then import your sound file into Flash, in the Library, find it there (CTRL+L), right-click it, press Linkage, in the Identifier field, type in, coinSound, and press OK. Use this code after, unloadMovie(this); :
Actionscript Code:
sound = new Sound(); sound.attachSound("coinSound"); sound.start(0, 1);
making the whole code look something like this:
Actionscript Code:
onClipEvent(enterFrame){ if(this.hitTest(_root.player)){ unloadMovie(this); sound = new Sound(); sound.attachSound("coinSound"); sound.start(0, 1); } }
and btw, always include codes you use in your posts, otherwise people won't be able to help you, because there are multiple ways of coding one thing, and it varies from programmer to programmer
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
 Originally Posted by Nig 13
What's the code for picking up money? If it's something like this:
Actionscript Code:
onClipEvent(enterFrame){ if(this.hitTest(_root.player)){ unloadMovie(this); } }
then import your sound file into Flash, in the Library, find it there (CTRL+L), right-click it, press Linkage, in the Identifier field, type in, coinSound, and press OK. Use this code after, unloadMovie(this); :
Actionscript Code:
sound = new Sound(); sound.attachSound("coinSound"); sound.start(0, 1);
making the whole code look something like this:
Actionscript Code:
onClipEvent(enterFrame){ if(this.hitTest(_root.player)){ unloadMovie(this); sound = new Sound(); sound.attachSound("coinSound"); sound.start(0, 1); } }
and btw, always include codes you use in your posts, otherwise people won't be able to help you, because there are multiple ways of coding one thing, and it varies from programmer to programmer
my code for picking up money is
onClipEvent(enterFrame) {
if(_root.char.hitTest(this)) {
_root.money += 10;
unloadMovie(this);
}
}
-
 Originally Posted by nig 13
what's the code for picking up money? If it's something like this:
actionscript Code:
onclipevent(enterframe){ if(this.hittest(_root.player)){ unloadmovie(this); } }
then import your sound file into flash, in the library, find it there (ctrl+l), right-click it, press linkage, in the identifier field, type in, coinsound, and press ok. Use this code after, unloadmovie(this); :
actionscript Code:
sound = new sound(); sound.attachsound("coinsound"); sound.start(0, 1);
making the whole code look something like this:
actionscript Code:
onclipevent(enterframe){ if(this.hittest(_root.player)){ unloadmovie(this); sound = new sound(); sound.attachsound("coinsound"); sound.start(0, 1); } }
and btw, always include codes you use in your posts, otherwise people won't be able to help you, because there are multiple ways of coding one thing, and it varies from programmer to programmer
nig you helpful sunnova*****!!! :d
-
Prid - Outing
That's almost the same as the one I anticipated, so you should be able to modify it by yourself, but if not, then here you go:
Actionscript Code:
onClipEvent(enterFrame){ if(_root.char.hitTest(this)){ _root.money += 10; unloadMovie(this); sound = new Sound(); sound.attachSound("coinSound"); sound.start(0, 1); } }
then follow what I said in my previous post about linking a new sound from the Library
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|