kadazuro.com
 Tutorialesxchange:ColorBox
 
por: kadazuro
|ejemplo|bajar el zip |
imprimir este documento
 

español

ColorBox is an flashmx extension that generates a webSafe colorBox picker, the file is for flashMX and is needed the ExtensionManager for instalation purporses.


componente in action

download this sample

Methods:
The component has the follows methods making easy the access to the component information.

component.getRgbValue() : returns an rgb value ( numérico ) of the color selected in that moment.

valor = mycomponente.getRgbValue();
trace (valor)// numeric output

component.getRgbObj() : returns the value( as an Object ) of the color selected in that moment.
ex.

valor = mycomponente.getRgbObj();
for (var i in valor){
  trace ( valor[i] add ":" add i )
}
//possible output
r:valor
g:valor
b:valor

component.getHexValue(): returns an hexadecimal value( as string) of the color selected in that moment.

valor = mycomponente.getHexValue();
trace (valor)// output tipe string #RRGGBB

component.getHexObj() : returns an hexadecimal value (as an Objet ) of the color selected in that moment.

valor = mycomponente.getHexObj();
for (var i in valor){
  trace ( valor[i] add ":" add i )
}
//possible output
r:RR
g:GG
b:BB

using component.setChangeHandler(myHandler) you can set the component changeHandler who will fires when a color is selected.

example:

myColor = new Color(myClip);//create a new color object to the clip "myClip"

myHandler = function (component){
  myColor.setRGB(component.getRgbValue());//here we asign the new color to the color object.
}

myComponent.setChangeHandler("myHandler");// here we asign the component handler so when we select a new color, it fires our function "myHandler"

use:
After instaling it will show under de componets menu, under the name colorBox.

Place an instance in the timeline and configure via components parameters, you cuan also see a sample in the zip file.

 

 
regresar
{diccionario}
 
Historial: