Hi, guys... I have this script for buttons: btn.onPress = function() { MC_Ball.play(); }; for (var i = 1; i<=5; i++) { btn = _root["btn"+i]; btn.ivar = i; prevMC = null; btn.onPress = function() { trace(this.ivar); clearInterval(reverseI); reverseI = setInterval(reverseF, 20, this.ivar); }; } for (var i = 1; i<=5; i++) { btn = _root["btn"+i]; btn.ivar = i; prevMC = null; btn.onPress = function() { trace(this.ivar); MC_Ball.play(); clearInterval(reverseI); reverseI = setInterval(reverseF, 20, this.ivar); }; } ...etc ... I would like to add a sound to it... I've tried different ways like adding the script below, before the script above... but its not working btn.onRollover = function() { MC_Sound.play(); }; Please help
Thank you Equan... I've tried that way too but still not workin'
if the sound you want to play is in the library. you must first load the sound. mc_sound = new Sound(); mc_sound.attachSound("idname");//name given as the linkage name. btn.onRollOver = function(){ mc_sound.start(0, 0); } To assign your sound an idname, open the library and right-click on the sound. click on "Linkage" check the box that says "Export for ActionScript" and take note of the idname it gives Use this idname in the code above. Normally the idname will be the same name as the file in the library.
Don't see what you're looking for? Try a search.
|