AsWing The home of AsWing framework.

AsWing is an Open Source Flash ActionScript GUI framework and library that allows programmers to make their flash application(or RIA) UI easily. Its usage is similar to Java Swing. It provides a set of GUI components, which we intent to implement in pure object oriented ActionScript 2. A pluggable look and feel will be implemented too. It also provides many Util classes. AsWing is BSD licensed.

AsWing A3 is the next/another life with ActionScript 3, components set is almost same to ActionScript 2 time, but capabilities are much more powerful.

You can discuss on our forumn: http://bbs.aswing.org.

Join AsWing team, contact us here.

如果你说中文,可以访问我们的中文站点: http://cn.aswing.org.

GuiBuilder 1.4.2 with haXe code generator released

iiley July 23rd, 2008

We are happy to announce AsWing GuiBuilder 1.4.2 release, with the haXe code generator contributed by Johan Coppens, now GuiBuilder may be more useful for haXe coders. (see also Using AsWing/as3 with Haxe)

Thanks Johan Coppens for the generator implementation to make us a chance to release this version.

guihaxe

code generator

You can download it here now: http://code.google.com/p/aswing/downloads/list
The newest source code is in svn.
Enjoy!!

Tip 2, Unregular Window, JWindow+GraphicsAsset

iiley July 14th, 2008

Some times, our art designer prefer a unregular window, especially for a game UI or some cool application.

Well, here is a tip:


package{

import flash.display.DisplayObject;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.filters.DropShadowFilter;
import flash.geom.Rectangle;

import org.aswing.*;
import org.aswing.border.EmptyBorder;

public class UnregularWindow extends Sprite{

[Embed(source="windowbg.png")]
private var imgClass:Class;

private var window:JWindow;

public function UnregularWindow(){
super();

AsWingManager.initAsStandard(this);

window = new JWindow();
var img:DisplayObject = new imgClass() as DisplayObject;
img.filters = [new DropShadowFilter()];
//make some blank space leave to the img shadow
window.setBorder(new EmptyBorder(null, new Insets(0, 0, 4, 4)));
window.setBackgroundDecorator(new AssetBackground(img));
//or even you can directly call addChild to append a image
//window.addChild(img);

var buttonPane:JPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
buttonPane.appendAll(new JButton("OK"), new JButton("Cancel"));
window.getContentPane().append(buttonPane, BorderLayout.SOUTH);
window.getContentPane().append(new JLabel("This is a JWindow"), BorderLayout.CENTER);
window.setSizeWH(300, 300);
window.show();
//simplly make the window dragable
window.addEventListener(MouseEvent.MOUSE_DOWN, __mouseDown);
window.addEventListener(MouseEvent.MOUSE_UP, __mouseUp);
}

private function __mouseDown(e:Event):void{
window.startDrag(false, new Rectangle(0, 0, stage.stageWidth, stage.stageHeight));
}

private function __mouseUp(e:Event):void{
window.stopDrag();
}
}
}

unregular window
(Click here to run the swf)
It is simple, just add a Image to the background of the JWindow, we added a Picture in this demo, but you, you even can add a Movie to be the background. Or even a MovieClip with Shapes, Buttons created by Flash IDE…

Tip 1: Use EmptyBorder to make gap

iiley July 11th, 2008

Assume we have a dialog looks like below:
gap1
It is created by code(snippted):

AsWingManager.initAsStandard(this);
var okButton:JButton = new JButton("Conform");
var cancelButton:JButton = new JButton("Cancel");
var tipButton:JButton = new JButton("Tip");
var pane:JPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 4, 4));
pane.appendAll(tipButton, okButton, cancelButton);

var window:JFrame = new JFrame(null, "Gap");
window.getContentPane().append(pane, BorderLayout.SOUTH);
window.setComBoundsXYWH(10, 10, 200, 200);
window.show();

The three button is layouted by a FlowLayout, they have same 4 pixel gap between each other. If i want to increase only the gap between Tip and Conform buttons, it’s not easy to do it with little change of above code except use a EmptyBorder.
If i add this setence below tipButton creating:
tipButton.setBorder(new EmptyBorder(null, new Insets(0, 0, 0, 20)));
The final dialog will be looks like this:
gap2
You see, it’s easy.

EmptyBorder performance a border with blank graphics. So it is usually used to create gaps. And depond on AsWing Border system, border can be nested, so you even can make a gap between two border of one component, for exampel.
yourCompnent.setBorder(new LineBorder(new EmptyBorder(new BevelBorder(), new Insets(…))));

Again one commercial project uses AsWing

iiley June 17th, 2008

There is a video chat application uses AsWing for a long time, it is a awesome project, you can setup rooms to make a video meeting, chat with friends, multi-multi chat or one-one chat, video or text, even, you can play some games there.

They’v designed and made a skin for their UI based on SkinBuilderLAF, beautiful done.

There’s AIR and Web versions, include server side, saled many copies in the past months, it is named VeryChat. You can visit its home page here.

And here’s some newest screenshots sent by the author:

very chat 1
(AIR version login window, click for large pic)

very chat 2
(AIR version web page viewer, click for large pic)

very chat 3
(The chat hall, click for large pic)

very chat 4
(In a video chat room, click for large pic)

AsWing 1.4 relased!

iiley June 13th, 2008

Well, AsWing AS3 version is now 1.4, it’s very stable now that since there are commercial products running months based on it.

The only big additions of this version are MultipleAssetIcon and GridList. The GridList component maybe useful for some guys, see it’s example. MultipleAssetIcon is contributed by Srdjan, also GridList is his introduction, Thanks him very much.

The preferred size cache bug fixing is very helpful for some strange layout issues.

The SkinBuilderLAF ComponentUI implementation improvement is very helpful for same kind components has different skins.

GuiBuilder 1.4 has just one addition: The GridList support.

Download AsWing 1.4 all-in-one(Include GuiBuilder 1.4) now.

Enjoy!

here’s the details change log:
___________________________AsWing A3 1.4_________________________
additions:

1. Added ability to only set preferred width or height, another will be auto count by layout or UI.
If you call setPreferredWidth() to set a number(!=-1) the width will be locked.
setPreferredWith(-1) to make it return to be auto counted.
Same to maximim and miminum sizes.

2. Make JTextArea avoid scroll change when make focus
3. Improved JPopupMenu popup location

4. Added DefaultsDecorator to make ComponentUI default change behavor correcter
now
//——-
var ui:ComponentUI = aCom.getUI();
ui.putDefault(xxx, xxx);
ui.putDefault(xxx, xxx);

aCom.setUI(ui);
//——-
Will runs more better about some skin assets defaults properties changing there.

5. Added MultipleAssetIcon by Srdjan
6. Added GridList

________________
bugfixes:

fixed drag jframe buggy issue after changed LAF
fixed AWSprite bringToTop/Bottom bug when useBitmapCache
fixed a JList key navigation bug
fixed a preferred size cache bug that a non-valid component invalidate will not get cache fresh

JList of cell become bigger when click

iiley May 31st, 2008

Today a friend at AsWing QQ group got trouble to implement a QQ2008 style List, that is, when click on a item, clicked item become bigger.(Means selected item should be bigger than others).

Here i tried to impelented one, it’s not complex, but really hard for AsWing beginners, for this, you should know two points:
1. Your cell factory must be a “non-shareCells” and “cells not same height” factory.
2. JList has a cache for each cell, it only refreshes the cell heights when related values changed.

Here’s the demo:


And here’s the source ListTest.asкомпютри втора употреба.

new ext container GridList on svn

iiley May 29th, 2008

Days ago Srdjan discussed with me about a wrap list container perfromance like window file explorer, fortunately i’v already write one for this6, but it is a poor component, with less functionities support. Soon later, another cool guy Johan mailed me to requested same component, i thought i should put this component into AsWing core now.

So, with improvement, the GridList now support multiple selection, with trackWidth/trackHeight functionity. See demo below(Try to select track width/track height check box and scale the frame to see how it performances):

It’s usage is similar to JList, you can define your own cell renderer for it, it use ListModel to provide data. But well still some functionities are missing, such as key board cell navigation/selection, share cell strategy etc. But however, it is usable for a windows file explorer style container now.

You can download its source/swc from svn now.

SVN version swc

iiley May 22nd, 2008

Since many guys are using swc instead of source codes, and they also need the svn version some times, so i commited the compiled swc files to svn repository now.

If you need the newest swc, browse to the svn and download it. :)

Cheers~

Next »