I am sure most of you know the color picker sample:
In my movie, i need 2 sets of faders with their own preview box each. Whatever i do, only one set of faders will work. Ther are obviously some basic things i don't know and i am not doing right.
I have been trying various things, having 2 frames, separating the actions for the two sets of faders on 2 scenes. I have no idea what to do.
Please help me.
Thank you.
Amalia
// create colors
color1 = new Color(screenbox);
//
this.onEnterFrame = function() {
// set c1, c2, c3, hc1, hc2, and hc3 equal to the positions of their respective faders and vice versa
for (i=1; i<=3; i++) {
this["color"+1].setRGB(rgb);
this["hexc"+i+"Text"].onKillFocus = function() {
hexMode = false;
};
this["hexc"+i+"Text"].onSetFocus = function() {
hexMode = true;
};
slider = this["slider"+i].cap;
if (dragging) {
this["c"+i] = slider._y;
this["hc"+i] = this["c"+i].toString(16);
} else {
if (hexMode) {
slider._y = parseInt("0x"+this["hc"+i]);
this["c"+i] = parseInt("0x"+this["hc"+i]);
} else {
slider._y = this["c"+i];
this["hc"+i] = Number(this["c"+i]).toString(16);
if (this["c"+i]>255) {
this["c"+i] = 255;
}
}
}
}
//
// combine c1, c2, and c3 into one variable using bitwise left shift and bitwise OR
rgb = (c1 << 16 | c2 << 8 | c3);
};
// create colors
color2 = new Color(previewbox);
//
this.onEnterFrame = function() {
// set c1, c2, c3, hc1, hc2, and hc3 equal to the positions of their respective faders and vice versa
for (i=1; i<=3; i++) {
this["color"+2].setRGB(rgb);
this["hexc"+i+"Text"].onKillFocus = function() {
hexMode = false;
};
this["hexc"+i+"Text"].onSetFocus = function() {
hexMode = true;
};
fader = this["fader"+i].knob;
if (dragging) {
this["c"+i] = fader._y;
this["hc"+i] = this["c"+i].toString(16);
} else {
if (hexMode) {
fader._y = parseInt("0x"+this["hc"+i]);
this["c"+i] = parseInt("0x"+this["hc"+i]);
} else {
fader._y = this["c"+i];
this["hc"+i] = Number(this["c"+i]).toString(16);
if (this["c"+i]>255) {
this["c"+i] = 255;
}
}
}
}
//
// combine c1, c2, and c3 into one variable using bitwise left shift and bitwise OR
rgb = (c1 << 16 | c2 << 8 | c3);
};
In my movie, i need 2 sets of faders with their own preview box each. Whatever i do, only one set of faders will work. Ther are obviously some basic things i don't know and i am not doing right.
I have been trying various things, having 2 frames, separating the actions for the two sets of faders on 2 scenes. I have no idea what to do.
Please help me.
Thank you.
Amalia
// create colors
color1 = new Color(screenbox);
//
this.onEnterFrame = function() {
// set c1, c2, c3, hc1, hc2, and hc3 equal to the positions of their respective faders and vice versa
for (i=1; i<=3; i++) {
this["color"+1].setRGB(rgb);
this["hexc"+i+"Text"].onKillFocus = function() {
hexMode = false;
};
this["hexc"+i+"Text"].onSetFocus = function() {
hexMode = true;
};
slider = this["slider"+i].cap;
if (dragging) {
this["c"+i] = slider._y;
this["hc"+i] = this["c"+i].toString(16);
} else {
if (hexMode) {
slider._y = parseInt("0x"+this["hc"+i]);
this["c"+i] = parseInt("0x"+this["hc"+i]);
} else {
slider._y = this["c"+i];
this["hc"+i] = Number(this["c"+i]).toString(16);
if (this["c"+i]>255) {
this["c"+i] = 255;
}
}
}
}
//
// combine c1, c2, and c3 into one variable using bitwise left shift and bitwise OR
rgb = (c1 << 16 | c2 << 8 | c3);
};
// create colors
color2 = new Color(previewbox);
//
this.onEnterFrame = function() {
// set c1, c2, c3, hc1, hc2, and hc3 equal to the positions of their respective faders and vice versa
for (i=1; i<=3; i++) {
this["color"+2].setRGB(rgb);
this["hexc"+i+"Text"].onKillFocus = function() {
hexMode = false;
};
this["hexc"+i+"Text"].onSetFocus = function() {
hexMode = true;
};
fader = this["fader"+i].knob;
if (dragging) {
this["c"+i] = fader._y;
this["hc"+i] = this["c"+i].toString(16);
} else {
if (hexMode) {
fader._y = parseInt("0x"+this["hc"+i]);
this["c"+i] = parseInt("0x"+this["hc"+i]);
} else {
fader._y = this["c"+i];
this["hc"+i] = Number(this["c"+i]).toString(16);
if (this["c"+i]>255) {
this["c"+i] = 255;
}
}
}
}
//
// combine c1, c2, and c3 into one variable using bitwise left shift and bitwise OR
rgb = (c1 << 16 | c2 << 8 | c3);
};