-
AS2 color picker and mixer?
I have been doing a bit of research to try and find this but i cant find specifically what im looking for.
I want to create a simple program that just demonstrates the mix of colours in a #000000 format. I just want to create 3 boxes to represent the RGB and let the user put in random numbers in 3 separate 00-99 numbers in these boxes and you will get to see what resultant colour is in another box (the final colour)
where can i go to find some info to research this further?
-
Designer, Programmer, Musician
I don't know if this is what you need, but this is why I made for you.
http://www.mediafire.com/?68e8srenr2bf6w6
Is in CS5 format. If you can not open it then do this:
1- create a movieclip, name it myMovie
2- create 3 input textfields, name them myFd1, myFd2 and myFd3.
3- create a dynamic textfield and name it mainFd
4- create a button or movieclip as button and name it submitButton
then apply this script on frame 1:
PHP Code:
//Hexadecimal RGB Colors Picker by Angel Hdz 2013
//Vars var my_color:Color = new Color(myMovie); var myInputs = "0x" + myFd1.text + myFd2.text+ myFd3.text;
//Functions
//Loop through all the input textfields for (i = 0; i < 4; i++){ //Restrict characters from Aa to Ff and numbers from 0 to 9 in each input textfield this["myFd" + i].restrict="a-fA-F0-9"; this["myFd" + i].maxChars=2; this["myFd" + i].borderColor=0x333333; this["myFd"+[i]].myNum=i;
//when each input textfield receives focus, empty it this["myFd"+[i]].onSetFocus=function() { _root["myFd" + this.myNum].text=""; } };
//Set default color, red (#FF0000) my_color.setRGB(myInputs); trace(myInputs);
//Buttons
//Submit Button submitButton.onPress=function() { if(myFd1.text == "" || myFd2.text == "" || myFd3.text == "" ) { mainFd.text= "Empty fields!";
} else { myInputs = "0x" + myFd1.text + myFd2.text+ myFd3.text; my_color.setRGB(myInputs); mainFd.text= "#"+ myFd1.text + myFd2.text+ myFd3.text; } }
*Remember to embed fonts
PD: If you need a table of all the hex web safe colors, let me know, i can create it with a loop/array
Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries
-
.
Hi,
Very good Angel. but it look suspiciously unlike your coding.
-
Designer, Programmer, Musician
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|