Greets. I've created a menu in Flash 8 AS2 which gives a list of 11 options. Click 1-11 and it opens a MC which contains buttons. The MC is then ._visible and .enable = true When another option is clicked, or the same option is clicked, the current MC is closed ._visible and .enable = false and the new one is opened. It works great in FF, however, in IE 7, it's hiding the MC, but not disabling them. Below is the AS I'm using. btn# is the primary button clicked which then opens btnMenu# (side note, I know I can do something else with the individual btn#.onRelease I just haven't gotten that far yet
Thank you!
Thank you!
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var startX:Number = btnMenu1._x;
var i = 0;
//Currently the tweens are not functioning on closemenu. Reason is hidemenu is disabling/visibling false
//before the tween can finish, making them disappear. This could be fixed at a later time.
closemenu = function (param, onoff) {
temp= eval("btnMenu"+param);
new Tween(this["btnMenu"+param],"_alpha",Regular.easeOut,100,0,12,false);
new Tween(this["btnMenu"+param],"_x",Regular.easeOut,temp._x,temp._x-10,12,false);
hidemenu(param)
return 0;
}
//This function disables the MC that holds the buttons and makes them invisible. This turns off the clicking
//of the buttons as well as keeps the buttons from interfearing with other buttons. ie overlapping.
hidemenu = function (param) {
temp = eval("btnMenu"+param);
temp.enabled = false;
temp._visible = false;
trace (param)
}
//Call the hidemenu function to keep the buttons from appearing initially.
onLoad = function (){
for (y=1;y<12;y++){
try{
hidemenu(y);
}
catch (e:Error){
}
}
}
openmenu = function(param)
{
temp = eval("btnMenu"+param);
new Tween(temp,"_alpha",Reglar.easeOut,0,100,12,false);
new Tween(temp,"_x",Regular.easeOut,temp._x,temp._x+10,12,false);
temp.enabled = true;
temp._visible = true;
return param;
}
btn1.onRelease= function ()
{
if (i != 0) closemenu(i,false);
if (i != 1) i = openmenu(1);
else i = 0;
}
btn2.onRelease = function ()
{
if (i != 0) closemenu(i,false);
if (i != 2) i = openmenu(2);
else i = 0;
}
btn3.onRelease = function ()
{
if (i != 0) closemenu(i,false);
if (i != 3) i = openmenu(3);
else i = 0;
}
btn4.onRelease = function ()
{
if (i != 0) closemenu(i,false);
if (i != 4) i = openmenu(4);
else i = 0;
}
btn5.onRelease = function ()
{
if (i != 0) closemenu(i,false);
if (i != 5) i = openmenu(5);
else i = 0;
}
btn6.onRelease = function ()
{
if (i != 0) closemenu(i,false);
if (i != 6) i = openmenu(6);
else i = 0;
}
btn7.onRelease = function ()
{
if (i != 0) closemenu(i,false);
if (i != 7) i = openmenu(7);
else i = 0;
}
btn8.onRelease = function ()
{
if (i != 0) closemenu(i,false);
if (i != 8) i = openmenu(8);
else i = 0;
}
btn9.onRelease = function ()
{
if (i != 0) closemenu(i,false);
if (i != 9) i = openmenu(9);
else i = 0;
}
btn10.onRelease = function ()
{
if (i != 0) closemenu(i,false);
if (i != 10) i = openmenu(10);
else i = 0;
}
btn11.onRelease = function ()
{
if (i != 0) closemenu(i,false);
if (i != 11) i = openmenu(11);
else i = 0;
}