Flash Tutorial: Actionscript 3.0
As I was making dress up games, I was suggested to try using color pickers for changing colors instead of a button that only goes through a limited selection of colors. Unfortunately, Actionscript 2.0, did not have such a thing as a color picker, so I was left with googling and downloading color pickers made by other people that supported that version. I wanted to try Actionscript 3.0 which supported this, but I had to pretty much relearn my actionscript to make dressups work and it was far from easy as I hadn't seen any tutorials for dressups with Actionscript 3.0!
As I was making dressups for the pokemon fifth-generation, I finally put one together using this version. https://abusorugia.deviantart.com/, https://starwishermidnight.deviantart.com/ and others wanted a tutorial in making dressups with color changers. I have procrastinated enough and finally was able to produce a somewhat less confusing tutorial than my other ones I hope ^_^;
Note: I have copied the code I used for the tutorial below, but the drag and drop part of the code only works if you have an object called "santahat" in your project!
Needless to mention, you should have some basic familiarity with Flash to use this tutorial. Constructive feedback welcome as always! ^_^
COLOR CHANGING
import fl.controls.ColorPicker;
import fl.events.ColorPickerEvent;
import flash.geom.ColorTransform;
var BodycolorInfo:ColorTransform = Body.transform.colorTransform;
cpBody.addEventListener(ColorPickerEvent.CHANGE, colorChange);
BodycolorInfo.color = cpBody.selectedColor;
Body.transform.colorTransform = BodycolorInfo;
function colorChange(e:Event):void
{
BodycolorInfo.color = cpBody.selectedColor;
Body.transform.colorTransform = BodycolorInfo;
}
DRAG & DROP
santahat.buttonMode = true;
santahat.addEventListener(MouseEvent.MOUSE_DOWN, hatPickUp);
stage.addEventListener(MouseEvent.MOUSE_UP, hatDropIt);
function hatPickUp(e:MouseEvent):void
{
santahat.startDrag();
}function hatDropIt(e:MouseEvent):void
{
santahat.stopDrag();
}