hey,
i have been pulling m hair out here trying to work out how to toggle on and off states on my buttons. Once a user clicked one it fades and disables ok as I want but i also want it to enable and fade back up again when they select another button. Below is my code:
function GenerateShapes(shape_xml) {
_global.shape_images = shape_xml.firstChild.childNodes;
_global.disableShapeButtons = new Array();
//_global.lastButtonClicked;
for (var i = 0; i<shape_images.length; i++) {
var currentShape = shape_images*;
_global.current_shape_mc = shape_menu.createEmptyMovieClip("shape_object"+i, i);
current_shape_mc._y = i*shape_space;
current_shape_mc.createEmptyMovieClip("thumb_shape_container",0);
current_shape_mc.thumb_shape_container.loadMovie(currentShape.attributes.thumb);
current_shape_mc.title = currentShape.attributes.title;
current_shape_mc.image = currentShape.attributes.object;
current_shape_mc.cost = currentShape.attributes.cost;
_global.pushedShapeButtons = disableShapeButtons.push("_level0.shape_menu.shape_object"+i);
if(curFrame != "shape"){
current_shape_mc.enabled = false;
}
current_shape_mc.onRelease = function() {
_global.lastButtonClicked = this;
trace(_global.lastButtonClicked);
Twease.tween({target:this, time:0.5, _alpha:30});
this.enabled = false;
_global.shapecost = Number(this.cost);
totalcost = shapecost;
shape_machine.play();
_global.choice1 = this.title;
output.htmlText = choice1;
//gotoAndStop("shape");
price_tv.total_cost.text = "£"+totalcost;
function waitforpump() {
Twease.tween({target:cake_shape, _y:425, time:0.2, ease:'easeInOutQuad'});
clearInterval(pumpTimer);
}
pumpTimer = setInterval(waitforpump, 1000);
cake_shape.load_shape.loadMovie(this.image);
};
}
}
Dee