Question : Button Script not loading swf

have created a drop down menu but the problem is that the buttons won't work i.e. lthey don't oad the external swfs into my contentmc. The menu drop down menu is a movie on the timeline which has another movie inside of it acting as the buttons.The script is placed on the main timeline.


Code Snippet:
1:
2:
3:
4:
5:
6:
menu_mc.btn1.onRelease=function(){
loadMovie("Goals.swf",content_mc);
}
menu_mc.btn2.onRelease=function(){
loadMovie("Saves.swf",content_mc);
}
Open in New Window Select All

Answer : Button Script not loading swf

I think the trouble probably is that menu_mc has an onRelease (or other mouse event) function() attached to it. This will block all mouse Events attached to menu_mc's children (btn1 and btn2);
To overcome this you have to delete the function attached to menu_mc as soon as it gets called and reinitiate it when the mouse rolls off...

Code below is a workaround the issue (which is a common problem in AS2 btw !)

I've used the _alpha feature to make a visual of what's happening...

Hope this does the trick...

dreamMonkey
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
menu_mc._alpha = 50;
 
menu_mc.btn1._alpha = 50;
menu_mc.btn2._alpha = 50;
 
var b:Object = menu_mc.getBounds(_root);
trace(b);
trace(b.yMin);
 
menu_mc.onEnterFrame = function() {
 
	if (_xmouse < b.xMin || _xmouse > b.xMax || _ymouse < b.yMin || _ymouse > b.yMax) {
		trace("outside");
		menu_mc.onRollOver = mcOver;
		menu_mc._alpha = 50;
	}
	function mcOver() {
		delete this.onRollOver;
		this._alpha = 100;
 
		menu_mc.btn2.onRelease = function() {
			this._alpha = 100;
 
		};
	}
};
Open in New Window Select All
Random Solutions  
 
programming4us programming4us