FORUMS: list search recent posts

_____Adding sound to MC as button by action script-------

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Peter Grawender
_____Adding sound to MC as button by action script-------
on Jan 10, 2006 at 12:33:41 pm

hello,

I have created button by action script out of a movie clip but now I have a problem to ad the sound to it when the mouse rolls over the button. I am a beginner in Flash so please, is someone help me to find the solution. Here is the action script I have so far:

//------------------------\

var myMCL:MovieClipLoader = new MovieClipLoader ();
var myListener:Object = new Object();

myMCL.addListener(myListener);

//------------------------\


//----------trigger the MCL to load this asset---------\

myMCL.loadClip("WebPageHOME.swf", 5);

//-----------------------------------\

//------------------------\

var myLV:LoadVars = new LoadVars();

myLV.onLoad = function(success) {
if (success) {
_level5.loadedInfo.htmlText = myLV.info;
} else {
_level5.loadedInfo.text = "There has been an error loading the requested information. Please contact the Webmaster to report the error.";
}
}

//------------------------\



//------------------------\

b1.onRollOver = over;
b1.onRollOut = out;
b1.buttText.buttonText.text = "H O M E";


b2.onRollOver = over;
b2.onRollOut = out;
b2.buttText.buttonText.text = "P H O T O G R A P H Y";

b3.onRollOver = over;
b3.onRollOut = out;
b3.buttText.buttonText.text = "C I N E M A";

b4.onRollOver = over;
b4.onRollOut = out;
b4.buttText.buttonText.text = "B I O G R A P H Y";

b5.onRollOver = over;
b5.onRollOut = out;
b5.buttText.buttonText.text = "C O N T A C T";

function over() {
this.gotoAndPlay(2);
}

function out() {
this.gotoAndPlay(9);
}

//-----------------------------------\

//-----------------------\
b1.onRelease=function() {
_level0.myMCL.loadClip("WebPageHOME.swf", 5);
}

b2.onRelease=function() {
_level0.myMCL.loadClip("WebPagePHOTOGRAPHY.swf", 5);
}

b3.onRelease=function() {
_level0.myMCL.loadClip("WebPageCINEMA.swf", 5);
}

b4.onRelease=function() {
_level0.myMCL.loadClip("WebPageBIO.swf", 5);
}

b5.onRelease=function() {
_level0.myMCL.loadClip("form.swf", 5);
}

//-----------------------------------\




Thank you for your help,

Peter Grawender


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]