SiverCookie on DeviantArthttps://www.deviantart.com/sivercookie/art/Color-Changer-438419508SiverCookie

Deviation Actions

SiverCookie's avatar

Color Changer

By
Published:
185 Views

Description

got the idee and the original code from Belozw's tutorial
link: belozw.deviantart.com/art/TUTO…

code

import fl.controls.ColorPicker;
import fl.events.ColorPickerEvent;
import flash.geom.ColorTransform;

var mycolor: ColorTransform = new ColorTransform();
var rotext: Boolean = false;


cp.addEventListener(ColorPickerEvent.CHANGE, colorChanger);

function colorChanger(event:ColorPickerEvent):void{

mycolor.color = cp.selectedColor;
mc.transform.colorTransform = mycolor;

}

ro.addEventListener(MouseEvent.CLICK,textro);

function textro(e:MouseEvent):void{
if (rotext){
rotext = false;
tof.gotoAndPlay('ro');
}
else if (!rotext){
rotext = true;
tof.gotoAndPlay('eng');
}
}

txt.addEventListener(Event.ENTER_FRAME,showtxt);

function showtxt(e:Event):void{
if (rotext){
txt.text="Schimbă-mi culoarea!";
}
if (!rotext){
txt.text="   Change my color!";
}
}



mc:big rectangle movieclip;
cp:the color changing tool;
txt:the dynamic text field;
tof:the small grey rectangle movieclip;
ro:the "ROMANA" button;
Image size
800x450px 225.22 KB
© 2014 - 2024 SiverCookie
Comments3
Join the community to add your comment. Already a deviant? Log In
xevoiius's avatar
This is really cool KFC Chicken Epic Dance