# Actionscript woes

**URL:** <https://forum.kirupa.com/t/actionscript-woes/215578>\
**Category:** Uncategorized\
**Created:** [February 8, 2007, 11:34am UTC](https://forum.kirupa.com/t/actionscript-woes/215578 "2007-02-08T11:34:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![True\_Blue\_32](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@True\_Blue\_32](https://forum.kirupa.com/u/True_Blue_32)\
**Post date:** [February 8, 2007, 11:34am UTC](https://forum.kirupa.com/t/actionscript-woes/215578/1 "2007-02-08T11:34:41Z")

</div>

I’ve used a tutorial for some Movie Clip buttons, and the code used is below:-

[COLOR=blue]import mx.transitions.Tween;  
import mx.transitions.easing.\*;[/COLOR]  
[COLOR=blue]home\_mc.onRollOver = function () {  
home\_mc.swapDepths(this.getNextHighestDepth());  
new Tween (home\_mc,"\_xscale",Elastic.easeOut,home\_mc.\_xscale,130,1,true);  
new Tween (home\_mc,"\_yscale",Elastic.easeOut,home\_mc.\_yscale,130,1,true);  
}[/COLOR]  
[COLOR=blue]home\_mc.onRollOut = function () {  
new Tween (home\_mc,"\_xscale",Elastic.easeOut,home\_mc.\_xscale,100,1,true);  
new Tween (home\_mc,"\_yscale",Elastic.easeOut,home\_mc.\_yscale,100,1,true);  
}[/COLOR]  
[COLOR=#0000ff][/COLOR]  
[COLOR=black]The real problem i am having now, is assigning code to these so a sound is played onRelease. I’m stuck on which code i need to put where on these.[/COLOR]  
I tried the following:-

[COLOR=blue]home\_mc.onRelease = function () {  
Mysound = new Sound(this);  
Mysound.attachSound(“CLICK7.wav”);  
Mysound.start(0, 99);  
}[/COLOR]  
[COLOR=#0000ff][/COLOR]  
[COLOR=black]Although the syntax appears to be fine on this as it doesn’t create any errors, no sound actually plays.[/COLOR]

I guess, i’m missing something here, but i can’t find what it is, can anybody please help me out?

One final quicky, Although i am currently trying to get the sounds to play onRelease, would it be possible to have two functions happening say on the [COLOR=blue]onRollOver[/COLOR] command, for example could i have a sound play and the button expand at the same time?

Please help if you can.
