update
Former-commit-id: bdede6ed1b6f578f2ef046c338caf02d0b29d453 [formerly 7187de361b53e9c8ec121df379b762f2db736ea2] Former-commit-id: 447d58460fbbfd05ffe08428a1288e392637561d
This commit is contained in:
51
_embed/public/ace/demo/kitchen-sink/docs/actionscript.as
Normal file
51
_embed/public/ace/demo/kitchen-sink/docs/actionscript.as
Normal file
@@ -0,0 +1,51 @@
|
||||
package code
|
||||
{
|
||||
/*****************************************
|
||||
* based on textmate actionscript bundle
|
||||
****************************************/
|
||||
|
||||
import fl.events.SliderEvent;
|
||||
|
||||
public class Foo extends MovieClip
|
||||
{
|
||||
//*************************
|
||||
// Properties:
|
||||
|
||||
public var activeSwatch:MovieClip;
|
||||
|
||||
// Color offsets
|
||||
public var c1:Number = 0; // R
|
||||
|
||||
//*************************
|
||||
// Constructor:
|
||||
|
||||
public function Foo()
|
||||
{
|
||||
// Respond to mouse events
|
||||
swatch1_btn.addEventListener(MouseEvent.CLICK,swatchHandler,false,0,false);
|
||||
previewBox_btn.addEventListener(MouseEvent.MOUSE_DOWN,dragPressHandler);
|
||||
|
||||
// Respond to drag events
|
||||
red_slider.addEventListener(SliderEvent.THUMB_DRAG,sliderHandler);
|
||||
|
||||
// Draw a frame later
|
||||
addEventListener(Event.ENTER_FRAME,draw);
|
||||
}
|
||||
|
||||
protected function clickHandler(event:MouseEvent):void
|
||||
{
|
||||
car.transform.colorTransform = new ColorTransform(0,0,0,1,c1,c2,c3);
|
||||
}
|
||||
|
||||
protected function changeRGBHandler(event:Event):void
|
||||
{
|
||||
c1 = Number(c1_txt.text);
|
||||
|
||||
if(!(c1>=0)){
|
||||
c1 = 0;
|
||||
}
|
||||
|
||||
updateSliders();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user