You really ought to get off the fence and just speak your mind.
:cap:
Quote:
Originally Posted by tmoore935
I call these "additional tools" for the flash programer
A Date With A DateChooser
The new DateChooser component in action:
http://krazyaboutpizza.co.uk/index.php?page=240
This reads the same data (MySQL/PHP fed as inline XML)from server my Flex one inside my blog reads from to populate itself with all dates with blog posts (highlighted). On select it reads the same data the blog datechooser does (but simply displays some of the data instead of what it would normally do if chosen with the Flex one).
Just an outstanding job on these guys. I can't believe how fast this is all coming together :)
Unasked question the stupid question
Can someone explain how the following script could be used in KM to create the desired effect?
ColorPickerExample.as
This example demonstrates how to change the color of a Shape instance by listening to events from a ColorPicker.
1. Drag three ColorPicker instances and one ComboBox instance to the stage.
2. Name the ColorPicker instances cp1 , cp2 , and cp3 .
3. Name the ComboBox cb .
4. Save this code as ColorPickerExample.as in the same directory as your FLA.
5. Set the DocumentClass in the FLA to ColorPickerExample.
package
{
import flash.display.Sprite;
import flash.display.Shape;
import flash.display.BlendMode;
import flash.events.*;
import fl.controls.ColorPicker;
import fl.controls.ComboBox;
public class ColorPickerExample extends Sprite
{
var circle1:Shape;
var circle2:Shape;
var circle3:Shape;
public function ColorPickerExample():void {
setupCircles();
setupComboBox();
cp1.addEventListener(Event.RENDER,colorChange);
cp2.addEventListener(Event.RENDER,colorChange);
cp3.addEventListener(Event.RENDER,colorChange);
}
private function colorChange(e:Event):void {
var cp:ColorPicker = e.target as ColorPicker
switch (cp) {
case cp1:
colorCircle(circle1,cp.selectedColor);
break;
case cp2:
colorCircle(circle2,cp.selectedColor);
break;
case cp3:
colorCircle(circle3,cp.selectedColor);
break;
default:
break;
}
}
private function setupComboBox():void {
cb.setSize(150,24);
cb.addItem( { label: "Select BlendMode:", data:BlendMode.NORMAL } );
cb.addItem( { label: "ADD", data:BlendMode.ADD } );
cb.addItem( { label: "ALPHA", data:BlendMode.ALPHA } );
cb.addItem( { label: "DARKEN", data:BlendMode.DARKEN } );
cb.addItem( { label: "DIFFERENCE", data:BlendMode.DIFFERENCE } );
cb.addItem( { label: "ERASE", data:BlendMode.ERASE } );
cb.addItem( { label: "HARDLIGHT", data:BlendMode.HARDLIGHT } );
cb.addItem( { label: "INVERT", data:BlendMode.INVERT } );
cb.addItem( { label: "LAYER", data:BlendMode.LAYER } );
cb.addItem( { label: "LIGHTEN", data:BlendMode.LIGHTEN } );
cb.addItem( { label: "MULTIPLY", data:BlendMode.MULTIPLY } );
cb.addItem( { label: "OVERLAY", data:BlendMode.OVERLAY } );
cb.addItem( { label: "SCREEN", data:BlendMode.SCREEN } );
cb.addItem( { label: "SUBTRACT", data:BlendMode.SUBTRACT } );
cb.addEventListener(Event.CHANGE,blendChange);
}
private function blendChange(e:Event):void {
var newBlend:String = cb.selectedItem.data;
if(newBlend) {
circle1.blendMode = newBlend;
circle2.blendMode = newBlend;
circle3.blendMode = newBlend;
}
}
private function setupCircles():void {
circle1 = new Shape();
circle2 = new Shape();
circle3 = new Shape();
circle1.x = 127;
circle1.y = 64;
circle2.x = 87;
circle2.y = 130;
circle3.x = 164;
circle3.y = 130;
colorCircle(circle1,0xFF0000);
colorCircle(circle2,0xFF0000);
colorCircle(circle3,0xFF0000);
addChild(circle1);
addChild(circle2);
addChild(circle3);
}
private function colorCircle(circle:Shape,newColor:uint):void {
circle.graphics.clear();
circle.graphics.beginFill(newColor,1);
circle.graphics.drawCircle(0,0,50);
circle.graphics.endFill();
}
}
}