Archive for the 'Tutorials' Category

Haxe 3.0& HaxeAswing Sources

August 5th, 2013

update  Haxe 3.0& Openfl  builds for mobile and desktop
ok now~~



  • Tutorials
  • Comments Off on Haxe 3.0& HaxeAswing Sources

Aswing CSS style skinnable plugins

BBS trashed, move to google group

AsWing 2.0 Beta Released

March 11th, 2011

After a long time break, patient finally we get a time to make AsWing 2.0 finished. We first release it as beta, malady however, the core framework is stable in the svn for a long time, we are trying to get more feedbacks from this release.

The main change from 1.5 is the new default LookAndFeel, you can see there are many products already using the new features, such as AWSSOFT products, Postprint, this6 and some webgames etc. For more details of the new LookAndFeel features, see the Presentation.

Click here to download AsWing2.0beta all-in-one package.

___________________________AsWing 2.0 beta_________________________

New default LookAndFeel
Added style tune feature
Added mideground color feature

Added JStepper — a Numeric Stepper component
Improved JAdjuster, state change event will fired when input changes
Fixed JComboBox selection change event bug
Improved JTable(
will not limit its maximize size,
added footer feature, it now can has a footer in its view,
improved show/hide grid methods, easier use than before)

Added DateChooser component
Added WeightBoxLayout
Many other little bugfixes

AsWing 3D experiment

July 13th, 2009

From AWSSOFT’s Droower comments, i saw Srdjan has done some transform of AsWing components. There is a Rotated/Skewed text with scrollbar, so i guess maybe we can made 3D effects for user interface by just AsWing components, with some test, i first just rotate a JList with JFrame, sadly the text will not be shown when rotated(this should be a well-known flash feature), see this rotation. I guess Srdjan cached his text into a Bitmap, so his Rotated/Skewed text displays well.

Then, i tested the new properties from FP10, rotationX/Y/Z, it’s exciting that FP10 renders text very well in 3D transform. See this rotation_y. It’s almost a realy 3D user interface, currently everything is fine except the Drag function of JFrameTitleBar, maybe the drag() function doesn’t works with 3D transform.


Here’s the source code snip(it’s simple):

var sprite:Sprite = new Sprite();

var jf:JFrame = new JFrame(sprite, "Test JFrame");
var jlist:JList = new JList();
var model:VectorListModel = new VectorListModel();
for(var i:int=0; i<100; i++){ model.append(i + " uitem"); } jlist.setModel(model); jf.setContentPane(new JScrollPane(jlist)); jf.setSizeWH(300, 160);; sprite.x = sprite.y = 150; sprite.rotation = -40;

Flash MiniBuilder: Online AS3 IDE

July 8th, 2009

Maybe it is a old news, many guys already have seen the awesome stuff yesterday — Code and Edit and Compile then Run your ActionScript programme online. It is not a simple text editor and call backend compiler, it is powerful just like a real IDE! Great works, Victor!!

Flash MiniBuilder

Flash MiniBuilder

The reason i post it here because it use AsWing, although it just used scrollbars buttons and combobox, not a heavy use of AsWing, but maybe we can never know the inside if the author does not tell us:

for quite a while, i’ve been looking for a component set that would suite my needs better than the bulky flex
one of the problems i couldn’t get flex to solve is editing big texts (like 6000 lines), where it becames very slow.
i tried to build my own text area and failed under flex, it’s still slow anything i do
but i managed to build a very fast one using aswing and viewportable interface.
the purpose of this component is editing actionscript code, and some class files are quite long

using aswing and viewportable, this component can manage pasting 6000 lines of code instantly and then
scroll with no delay at all. of course, it renders only the visible fragment of text.

This is not a defence or compares, it just says that AsWing can handle that flexible i even don’t know. Of course it is main because of the great implement of ScriptArea too.

How 2.0 will works with skins

February 6th, 2009

Well, at the past, it’s hard to custom the skin of AsWing components.
With 2.0, we plan to improve this because there’s not many guys can make a new LookAndFeel, they want to change some basic properties directly by just call some methods.

Here it is, for example we have a normal button – “A Button”.(The first button in the picture, PS:this is not the final design of button look, it will be well designed when 2.0 released)
We want to change its color, just call button.setBackground(new ASColor(0xF4A0AA));, it will be looks like “Blue Button”, you can see it changes well, the gradient, border and shadow keep looks well, really a blue button.

How about a red button? Simple, setBackground(new ASColor(0xf4a0aa)); then it will looks like “Red Button”.

Want to make it flater? Yes you can, there’s StyleTune for every component, you can call button.setStyleTune(button.getStyleTune().sharpen(0.1));, then it will looks like “Flatten Button”, 0.1 times gradient; well same way to sharpen it call button.setStyleTune(button.getStyleTune().sharpen(2)); it becomes 2 times sharper than normal one like “Sharpen Button”

Also, you can change the round property of StyleTune to 10, you’ll get a button looks like “Round Button”.

All about StyleTune class, it has 5 major properties to affect the style of a component, you can read the asdoc to know it:

* Gradient brightness range of content color [-1, 1]
public var cGradient:Number;
* The birightness offset for border color [-1, 1]
public var bOffset:Number;
* Gradient brightness range of border color [-1, 1]
public var bGradient:Number;
* Shadow alpha value [0, 1]
public var shadowAlpha:Number;

* The round rect radius, 0 means not round [0, +]
public var round:Number;

private var mideAdjuster:StyleTune;

* Create a UIColorAdjuster with specified params
* @param cg gradient brightness range of content color
* @param bo birightness offset for border color
* @param bg gradient brightness range of border color
* @param sa shadow alpha
* @param r the round rect radius, 0 means not round
public function StyleTune(cg:Number=0.2, bo:Number=0.15, bg:Number=0.35, sa:Number=0.2, r:Number=0)

With a full customized StyleTune and background foreground set, you even can get a button like “Customed” button in the picture. Its StyleTune and colors are:

button.setStyleTune(new StyleTune(0.18, 0.05, 0.20, 0.20, 2));
button.setBackground(new ASColor(0x299083));
button.setForeground(new ASColor(0xFFFFFE));

Next time, i’ll introduce another feature about Component.setMideground()

How to make a Popup always on top?

November 6th, 2008

Some guys asked me about this question for times, i thought i should make a post here since you want to know this too.:)

Well, all the Popups in AsWing, including JPopup and all its sub classes such as JWindow JFrame, has their owner — the first param of their constructor, for example new JFrame(owner, …), the owner specified where the popups create their assets. You can set a default owner for all popups by calling AsWingManager.init(defaultOwner, …) or AsWingManager.setRoot(defaultOwner), if there’s a default owner set, you can pass null to the popup constructors, null means to use default one.

So, how to make a popup on top of others? Yes, you already know, just make its owner on top of others, for example, there’s two sprite on your stage, sprite2 is on top of sprite1, if you call AsWingManager.setRoot(sprite1) to make sprite1 as default owner, then you created a popup with sprite2 as its owner for example topFrame = new JFrame(sprite2, …), then you’ll got topFrame always on top of other popups which created with default owner.

BTW, the owner can be a JPopup instance too, if a owner is a popup, the created popup will be its sub popup, always on top of parent popup and if parent popup hide or minimized the sub popup will be non-visible.

Here’s a demo:

public class TopPopup extends Sprite{

private var sprite1:Sprite;
private var sprite2:Sprite;

public function TopPopup(){
sprite1 = new Sprite();
sprite2 = new Sprite();

createFrame(null, "Normal Frame1");
createFrame(null, "Normal Frame2");
createFrame(createFrame(null, "Parent"), "Sub").setSizeWH(100, 80);
createFrame(sprite2, "Top Frame").setSizeWH(200, 140);

private function createFrame(owner:*, title:String):JFrame{
var frame:JFrame = new JFrame(owner, title);
frame.setSizeWH(140, 100);
frame.setLocationXY(Math.random()*200, Math.random()*100);;
return frame;


(Click here to run the SWF)

  • A3 , Tutorials
  • Comments Off on How to make a Popup always on top?

Next »