Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am sure most of you know the colo

Status
Not open for further replies.

amaliat

IS-IT--Management
Nov 3, 2003
2
GB
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[&quot;color&quot;+1].setRGB(rgb);
this[&quot;hexc&quot;+i+&quot;Text&quot;].onKillFocus = function() {
hexMode = false;
};
this[&quot;hexc&quot;+i+&quot;Text&quot;].onSetFocus = function() {
hexMode = true;
};
slider = this[&quot;slider&quot;+i].cap;
if (dragging) {
this[&quot;c&quot;+i] = slider._y;
this[&quot;hc&quot;+i] = this[&quot;c&quot;+i].toString(16);
} else {
if (hexMode) {
slider._y = parseInt(&quot;0x&quot;+this[&quot;hc&quot;+i]);
this[&quot;c&quot;+i] = parseInt(&quot;0x&quot;+this[&quot;hc&quot;+i]);
} else {
slider._y = this[&quot;c&quot;+i];
this[&quot;hc&quot;+i] = Number(this[&quot;c&quot;+i]).toString(16);
if (this[&quot;c&quot;+i]>255) {
this[&quot;c&quot;+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[&quot;color&quot;+2].setRGB(rgb);
this[&quot;hexc&quot;+i+&quot;Text&quot;].onKillFocus = function() {
hexMode = false;
};
this[&quot;hexc&quot;+i+&quot;Text&quot;].onSetFocus = function() {
hexMode = true;
};
fader = this[&quot;fader&quot;+i].knob;
if (dragging) {
this[&quot;c&quot;+i] = fader._y;
this[&quot;hc&quot;+i] = this[&quot;c&quot;+i].toString(16);
} else {
if (hexMode) {
fader._y = parseInt(&quot;0x&quot;+this[&quot;hc&quot;+i]);
this[&quot;c&quot;+i] = parseInt(&quot;0x&quot;+this[&quot;hc&quot;+i]);
} else {
fader._y = this[&quot;c&quot;+i];
this[&quot;hc&quot;+i] = Number(this[&quot;c&quot;+i]).toString(16);
if (this[&quot;c&quot;+i]>255) {
this[&quot;c&quot;+i] = 255;
}
}
}
}
//
// combine c1, c2, and c3 into one variable using bitwise left shift and bitwise OR
rgb = (c1 << 16 | c2 << 8 | c3);
};
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top