Skip to content

Commit

Permalink
Restructured repository to allow for seperate examples directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Feb 1, 2012
1 parent 9ac7d50 commit d2b9146
Show file tree
Hide file tree
Showing 90 changed files with 124 additions and 250 deletions.
90 changes: 0 additions & 90 deletions Flux.as3proj

This file was deleted.

Binary file removed bin/FluxSandbox.swf
Binary file not shown.
Binary file added examples/editor/bin/FluxEditor.swf
Binary file not shown.
95 changes: 95 additions & 0 deletions examples/editor/src/FluxEditor.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
package
{
import flash.events.Event;
import flux.components.Application;
import flux.components.Container;
import flux.components.TextArea;
import flux.components.TextInput;
import flux.components.UIComponent;
import flux.components.VBox;
import flux.layouts.HorizontalLayout;
import flux.util.FluxDeserializer;

[SWF( width="800", height="600", backgroundColor="0x101010", frameRate="60" )]
public class FluxEditor extends Application
{
private var textInput :TextInput;
private var output :Container;
private var errorOutput :TextArea;


public function FluxEditor()
{

}

override protected function init():void
{
super.init();

layout = new HorizontalLayout();

var vBox:VBox = new VBox();
vBox.percentWidth = 100;
vBox.percentHeight = 100;
addChild(vBox);

textInput = new TextInput();
textInput.editable = true;
textInput.multiline = true;
textInput.percentWidth = 100;
textInput.percentHeight = 100;
textInput.addEventListener(Event.CHANGE, changeTextHandler);
textInput.fontFamily = "_typewriter";
textInput.embedFonts = false;
textInput.fontSize = 11;
vBox.addChild(textInput);

errorOutput = new TextArea();
errorOutput.percentWidth = 100;
errorOutput.height = 100;
vBox.addChild(errorOutput);

output = new Container();
output.percentWidth = 100;
output.percentHeight = 100;
addChild(output);

var exampleXML:XML =
<VBox width="100%" height="100%" >
<Button label="Button A" />
<Button label="Button B" toggle="true" />
<Button label="Button C" selected="true" />
</VBox>

textInput.text = exampleXML.toXMLString();
}

private function changeTextHandler( event:Event ):void
{
errorOutput.text = "";
try
{
var xml:XML = XML( textInput.text );
var component:UIComponent = FluxDeserializer.deserialize(xml);
while ( output.numChildren > 0 )
{
output.removeChildAt(0);
}
output.addChild(component);
}
catch ( e:Error )
{
errorOutput.text = e.message;

if ( textInput.text == "" )
{
while ( output.numChildren > 0 )
{
output.removeChildAt(0);
}
}
}
}
}
}
Binary file added examples/sandbox/bin/FluxSandbox.swf
Binary file not shown.
4 changes: 1 addition & 3 deletions src/FluxSandbox.as → examples/sandbox/src/FluxSandbox.as
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ package
import icons.*
import flux.cursors.*;

[SWF( backgroundColor="0x101010", frameRate="60" )]
[SWF( width="800", height="600", backgroundColor="0x101010", frameRate="60" )]
public class FluxSandbox extends Application
{
public var propertyInspector :PropertyInspector;
Expand Down Expand Up @@ -165,8 +165,6 @@ package
BindingUtil.bind( inspectableObject, "number2", inspectableObject, "number3" );
BindingUtil.bind( inspectableObject, "number3", inspectableObject, "number" );
BindingUtil.bind( inspectableObject, "number", inspectableObject, "number3" );
//BindingUtil.bind( inspectableObject, "number2", inspectableObject, "number3" );
//BindingUtil.bind( inspectableObject, "number3", inspectableObject, "number2" );

propertyInspectorDataProvider.addItem( inspectableObject );
propertyInspector.dataProvider = propertyInspectorDataProvider;
Expand Down
File renamed without changes.
Binary file added flux/bin/Flux.swc
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,19 @@ package flux.components
// values then get passed to the editor when created.
else
{
if ( value.charAt(0) == "[" && value.charAt(value.length-1) == "]" )
if ( value == "true" )
{
field.editorParameters[key] = true;
}
else if ( value == "false" )
{
field.editorParameters[key] = false;
}
else if ( isNaN(Number(value)) == false )
{
field.editorParameters[key] = Number(value);
}
else if ( value.charAt(0) == "[" && value.charAt(value.length-1) == "]" )
{
value = value.substr(1, value.length-2);
field.editorParameters[key] = new ArrayCollection(value.split(","));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/**
* PropertyInspectorItemRenderer.as
*
*
* Copyright (c) 2011 Jonathan Pace
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand All @@ -22,7 +22,7 @@
* THE SOFTWARE.
*/

package flux.components
package flux.components
{
import flash.display.MovieClip;
import flash.display.Sprite;
Expand Down Expand Up @@ -55,7 +55,7 @@ package flux.components
// Internal vars
private var _list :List;

public function PropertyInspectorItemRenderer( )
public function PropertyInspectorItemRenderer( )
{

}
Expand Down Expand Up @@ -108,7 +108,7 @@ package flux.components

headerSkin.visible = false;
}
else
else if ( _data != null )
{
propertyLabelField.width = _width - 8;
propertyLabelField.text = _data.label;
Expand Down Expand Up @@ -159,8 +159,8 @@ package flux.components
if ( event.target != this ) return;
_over = true;

_selected ?
(_down ? skin.gotoAndPlay( "SelectedDown" ) : skin.gotoAndPlay("SelectedOver")) :
_selected ?
(_down ? skin.gotoAndPlay( "SelectedDown" ) : skin.gotoAndPlay("SelectedOver")) :
(_down ? skin.gotoAndPlay( "Down" ) : skin.gotoAndPlay("Over"))

addEventListener(MouseEvent.ROLL_OUT, rollOutHandler);
Expand All @@ -186,8 +186,8 @@ package flux.components
{
_down = false;

_selected ?
(_over ? skin.gotoAndPlay( "SelectedOver" ) : skin.gotoAndPlay("SelectedUp")) :
_selected ?
(_over ? skin.gotoAndPlay( "SelectedOver" ) : skin.gotoAndPlay("SelectedUp")) :
(_over ? skin.gotoAndPlay( "Over" ) : skin.gotoAndPlay("Up"))

stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
Expand Down Expand Up @@ -262,21 +262,21 @@ package flux.components
}

public function get over():Boolean
{
{
return _over;
}

public function get down():Boolean
{
{
return _down;
}

public function get list():List
public function get list():List
{
return _list;
}

public function set list(value:List):void
public function set list(value:List):void
{
_list = value;
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit d2b9146

Please sign in to comment.