hey folk, i am about to pull my hair out here. I have this code that loads my buttons from xml as images:
// shapes function
function GenerateShapes(shape_xml) {
var shape_images = shape_xml.firstChild.childNodes;
for (var i = 0; i<shape_images.length; i++) {
var currentShape = shape_images*;
_global.current_shape_mc = shape_menu.createEmptyMovieClip("shape_object"+i, i);
trace(current_shape_mc);
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;
current_shape_mc.onRelease = function() {
_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);
//description_lv.load(this.description);
};
scrollingSHAPE = function () {
shape_menu.setMask(maskedShape);
var scrollHeight:Number = scrollTrack._height;
var scrollFaceHeight:Number = scrollFace._height;
this.onEnterFrame = function() {
var contentHeight:Number = shape_menu._height+20;
if (shape_menu._height>0) {
checkshape = function () {
if (curFrame == "shape") {
main_nav.sizeBtn.filldot.gotoAndStop(2);
main_nav.back._alpha = 30;
main_nav.back.enabled = false;
Twease.tween({target:current_shape_mc, time:0.5, _alpha:100});
current_shape_mc.enabled = true;
if (shape_images.length>=3) {
btnUp._visible = true;
btnDown._visible = true;
btnUp.gotoAndPlay(2);
btnDown.gotoAndPlay(2);
} else {
btnUp._visible = false;
btnDown._visible = false;
}
} else {
backTimer = setInterval(waitforback, 2000);
//Twease.tween({target:current_shape_mc, time:0.5, _alpha:30});
btnUp._visible = false;
btnDown._visible = false;
}
}
checkshape();
var maskHeight:Number = maskedShape._height;
var initPosition:Number = scrollFace._y=scrollTrack._y;
var initContentPos:Number = shape_menu._y;
var finalContentPos:Number = maskHeight-contentHeight+initContentPos;
var left:Number = scrollTrack._x;
var top:Number = scrollTrack._y;
var right:Number = scrollTrack._x;
var bottom:Number = scrollTrack._height-scrollFaceHeight+scrollTrack._y;
var dy:Number = 0;
var speed:Number = 10;
var moveVal:Number = (contentHeight-maskHeight)/(scrollHeight-scrollFaceHeight);
scrollFace.onPress = function() {
var currPos:Number = this._y;
startDrag(this, false, left, top, right, bottom);
this.onMouseMove = function() {
dy = Math.abs(initPosition-this._y);
shape_menu._y = Math.round(dy*-1*moveVal+initContentPos);
};
};
scrollFace.onMouseUp = function() {
stopDrag();
delete this.onMouseMove;
};
btnUp.onPress = function() {
this.onEnterFrame = function() {
if (shape_menu._y+speed<maskedShape._y) {
if (scrollFace._y<=top) {
scrollFace._y = top;
} else {
scrollFace._y -= speed/moveVal;
}
shape_menu._y += speed;
} else {
scrollFace._y = top;
shape_menu._y = maskedShape._y;
delete this.onEnterFrame;
}
};
};
btnUp.onDragOut = function() {
delete this.onEnterFrame;
};
btnUp.onRelease = function() {
delete this.onEnterFrame;
};
btnDown.onPress = function() {
this.onEnterFrame = function() {
if (shape_menu._y-speed>finalContentPos) {
if (scrollFace._y>=bottom) {
scrollFace._y = bottom;
} else {
scrollFace._y += speed/moveVal;
}
shape_menu._y -= speed;
} else {
scrollFace._y = bottom;
shape_menu._y = finalContentPos;
delete this.onEnterFrame;
}
};
};
btnDown.onRelease = function() {
delete this.onEnterFrame;
};
btnDown.onDragOut = function() {
delete this.onEnterFrame;
};
if (contentHeight<maskHeight) {
scrollFace._visible = false;
btnUp.enabled = false;
btnDown.enabled = false;
} else {
scrollFace._visible = true;
btnUp.enabled = true;
btnDown.enabled = true;
}
// remove the event handler so it doesn't run forever
this.onEnterFrame = null;
}
};
};
scrollingSHAPE();
}
}
what i need to be able to do is disable all the current_shape_mc instances but all it ever does is 1. What am i missing?
Dee