infocie
04-27-2007, 12:49 PM
Hello, I have a problem for creat a color picker in koolmoves. I use an example of Koolmoves for creat my color picker but dont work. The action script work for "listbox", but how to change the color of my shape name : wall.
Help me please.
The action script :
stage.scaleMode = "noScale";
stage.align = "tl";
listbox.setSelectedIndex(0);
CreateKListBox("styling",4,{'_x':350,'_y':50,width:110,rowcount:3});
styling.addItem("Background", "background" );
styling.setSelectedIndex(0);
styling.onChange = function(){
var t = listbox1.getStyleProperty(styling.getValue());
t = '00000'+t.toString(16);
_root.ccode.text='( 0x'+t.substr(-6)+' )';
_root.ccode.text="test";
}
createEmptyMovieClip("colors",5);
colors._x=470;
colors._y=50;
colors.__proto__ = KComponent.prototype;
colors.c = new Array();
for (b=0;b<4;b++){
for (g=0;g<8;g++){
for (r=0;r<8;r++){
x = Math.floor(b/2)*8+r;
y = (b % 2)*8+g;
c = 65536*Math.round(r*255/7)+256*Math.round(g*255/7)+b*85;
colors.kDrawBoxFilled(x*6,y*6,x*6+6,y*6+6,c);
colors.c[x*16+y]=c;
}
}
}
colors.onPress = function(){
var p=new Object();
p.x=_root._xmouse;
p.y=_root._ymouse;
this.globalToLocal(p);
var x = Math.floor(p.x/6);
var y = Math.floor(p.y/6);
var s = _root.styling.getValue();
if (s.length>1) {
listbox.setStyleProperty(s,this.c[x*16+y]);
}
}
http://infocie.free.fr/Scripts cool/colorpicker.jpg
Help me please.
The action script :
stage.scaleMode = "noScale";
stage.align = "tl";
listbox.setSelectedIndex(0);
CreateKListBox("styling",4,{'_x':350,'_y':50,width:110,rowcount:3});
styling.addItem("Background", "background" );
styling.setSelectedIndex(0);
styling.onChange = function(){
var t = listbox1.getStyleProperty(styling.getValue());
t = '00000'+t.toString(16);
_root.ccode.text='( 0x'+t.substr(-6)+' )';
_root.ccode.text="test";
}
createEmptyMovieClip("colors",5);
colors._x=470;
colors._y=50;
colors.__proto__ = KComponent.prototype;
colors.c = new Array();
for (b=0;b<4;b++){
for (g=0;g<8;g++){
for (r=0;r<8;r++){
x = Math.floor(b/2)*8+r;
y = (b % 2)*8+g;
c = 65536*Math.round(r*255/7)+256*Math.round(g*255/7)+b*85;
colors.kDrawBoxFilled(x*6,y*6,x*6+6,y*6+6,c);
colors.c[x*16+y]=c;
}
}
}
colors.onPress = function(){
var p=new Object();
p.x=_root._xmouse;
p.y=_root._ymouse;
this.globalToLocal(p);
var x = Math.floor(p.x/6);
var y = Math.floor(p.y/6);
var s = _root.styling.getValue();
if (s.length>1) {
listbox.setStyleProperty(s,this.c[x*16+y]);
}
}
http://infocie.free.fr/Scripts cool/colorpicker.jpg