LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




ReplyREPLY THREAD
 
Thread Tools Display Modes
  #1  
Old 04-09-2006, 12:07 PM
thh022's Avatar
thh022 thh022 is offline
Registered User
 
Join Date: Mar 2006
Posts: 125
Rep Power: 8
thh022 is on a distinguished road
can't get soundclip to play when i click on a button (movieclip)

i can't get a soundclip to play when the mouse is OVER an button (not a normal button, but a movieclip!)

satan = instance name of the button (MC)
CLAVE.WAV = name of the soundclip

Code:
satan.onRelease = function(){ // this one works fine!!!
gotoAndStop("meny");
}

onClipEvent(load){ // here i get the error "clip events are permitted only for movie clip instances"
lyd = new Sound();
lyd = attachSound("CLAVE.WAV");
}

satan.onRollOver = function(){ // play the sound "lyd" when mouse is over, works fine!!
lyd.start();
}
Reply With Quote
  #2  
Old 04-09-2006, 01:06 PM
itsreallyme itsreallyme is offline
Registered User
 
Join Date: Dec 2005
Location: Yorkshire, UK
Posts: 34
Rep Power: 0
itsreallyme is on a distinguished road
Hi thh022.

I assume you are writing your code on the main timeline as the onClipEvent method only works when the code is attached to a movieclip.


try something like this. i tested it and it works fine for me.

Code:
var lyd:Sound = new Sound(satan);
lyd.attachSound("CLAVE.WAV");

satan.onRollOver = function(){ // play the sound "lyd" when mouse is over, works fine!!
clSound.start();
}
Hope this helps
Reply With Quote


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
movieclip button... how to define a smaller hit area?? dpcdpc11 ActionScript 3.0 1 11-04-2008 05:35 PM
button to play slideshow movieclip sammie Newbies 6 10-29-2006 11:03 PM
Preloader w/play button tutorial? Adding play button to preloader on swf file. oicdn Flash 8 1 10-23-2006 06:10 AM
Detecting Movie Parameters \ Sound Play Button Problem MathieuGPL Flash MX ActionScript 2 07-26-2005 06:09 PM
play all button Captain Kirk Flash MX ActionScript 0 07-17-2005 01:41 AM




All times are GMT. The time now is 02:10 AM.