[kml_flashembed movie=”http://www.bit-101.com/minimalcomps/trig.swf” width=”600″ height=”408″/]
Been picking away at refining the components here and there. Fun stuff. I added another compound component to the set, the VUISlider, which you can see above. Basically, it’s a label, a VSlider, and a value label at the bottom. Handles all internal layout on its own and has a labelPrecision property that formats the value label with however many decimals you want. A quick example from the demo:
[as]_heightSlider = new VUISlider(this, 10, 15, “Height”, onChange);
_heightSlider.maximum = 200;
_heightSlider.minimum = 0;
_heightSlider.value = 0;
_heightSlider.labelPrecision = 2;[/as]
This is all it took out to set up each of those sliders. Makes rapid application / experiment / proof of concept development really easy. The demo comes in at 16k. Not bad.
I even found out that the base component class is nice to extend for one off application components, like those two panels on the left. Each one is a “TrigControlsView”. A snippet of that class:
[as] public class TrigControlsView extends Component
{
private var _title:Label;
private var _heightSlider:VUISlider;
private var _waveLengthSlider:VUISlider;
private var _offsetSlider:VUISlider;
public function TrigControlsView(parent:DisplayObjectContainer, x:Number, y:Number)
{
super(parent, x, y);
…
[/as]
It extends the base Component class, and takes a parent, x, and y in the constructor, which it passes to super(). Then, to create one of these views, I just had to say:
[as]_sineView = new TrigControlsView(this, 4, 4);[/as]
I’ll probably go ahead and make an HUISlider, and I’m toying with the idea of some minimal layout containers, probably HBox and VBox only. None of this new stuff is released yet, but depending on how much more I work on it this weekend, maybe soon.
looks great.
would it be possible for you to share code of this example ( drawing line )
awesome stuff Keith, thanks for sharing.
Awesome! Layout containers would be great. Would love to see the HUIScroller (especially for my project). Please release the SWC when you can!
Thanks as always,
Danny
Great job.
I’d like to know about the way you plot the graph dynamically. I used lineTo – MoveTo functions but it doesn’t allow some real time changes like this. I would be grateful if you could share a simple example of this part of your code.
Thanks
Charles