alsvik
06-01-2003, 10:26 PM
How do i change the actions on "over" and "down" on the "Pill Button" from the component library in Flash MX ?
They don't have the normal layout of a button, so editing the button, doesn't show these four normal frames to edit.
Can anyone help me?
Code from the button:
_________________________________________
this.onPress = function() {
pressing = true;
for (i=1; i<=3; i++) {
buttonColor = new Color(eval("piece"+i).colorchip);
buttonColor.setRGB(0x333333);
lowColor = new Color(eval("piece"+i).bottomhilite);
lowColorTransform = new Object();
lowColorTransform = {ra:'0', rb:'200', ga:'0', gb:'200', ba:'0', bb:'200', aa:'100', ab:'0'};
lowColor.setTransform(lowColorTransform);
}
};
this.onRelease = function() {
pressing = false;
};
this.onReleaseOutside = function() {
pressing = false;
};
this.onEnterFrame = function() {
if (pressing!=true) {
for (i=1; i<=3; i++) {
buttonColor = new Color(eval("piece"+i).colorchip);
buttonColor.setRGB(rgb);
lowColor = new Color(eval("piece"+i).bottomhilite);
lowColorTransform = new Object();
lowColorTransform = {ra:'0', rb:hc1, ga:'0', gb:hc2, ba:'0', bb:hc3, aa:'100', ab:'0'};
lowColor.setTransform(lowColorTransform);
}
}
};
with (piece2) {
_width = _parent.wide;
piece1._x = _x-_width/2;
piece3._x = _x+_width/2;
_parent.midshadow._width = _width;
_parent.leftshadow._x = _x-_width/2;
_parent.rightshadow._x = _x+_width/2;
}
label1.autoSize = "center"
label2.autoSize = "center"
They don't have the normal layout of a button, so editing the button, doesn't show these four normal frames to edit.
Can anyone help me?
Code from the button:
_________________________________________
this.onPress = function() {
pressing = true;
for (i=1; i<=3; i++) {
buttonColor = new Color(eval("piece"+i).colorchip);
buttonColor.setRGB(0x333333);
lowColor = new Color(eval("piece"+i).bottomhilite);
lowColorTransform = new Object();
lowColorTransform = {ra:'0', rb:'200', ga:'0', gb:'200', ba:'0', bb:'200', aa:'100', ab:'0'};
lowColor.setTransform(lowColorTransform);
}
};
this.onRelease = function() {
pressing = false;
};
this.onReleaseOutside = function() {
pressing = false;
};
this.onEnterFrame = function() {
if (pressing!=true) {
for (i=1; i<=3; i++) {
buttonColor = new Color(eval("piece"+i).colorchip);
buttonColor.setRGB(rgb);
lowColor = new Color(eval("piece"+i).bottomhilite);
lowColorTransform = new Object();
lowColorTransform = {ra:'0', rb:hc1, ga:'0', gb:hc2, ba:'0', bb:hc3, aa:'100', ab:'0'};
lowColor.setTransform(lowColorTransform);
}
}
};
with (piece2) {
_width = _parent.wide;
piece1._x = _x-_width/2;
piece3._x = _x+_width/2;
_parent.midshadow._width = _width;
_parent.leftshadow._x = _x-_width/2;
_parent.rightshadow._x = _x+_width/2;
}
label1.autoSize = "center"
label2.autoSize = "center"