Size of resulting SWF when using AsWing

8 views
Skip to first unread message

Marximus

unread,
Dec 20, 2008, 6:21:05 PM12/20/08
to ActionScript User Interface Development
I've been doing some coding in AS3 using FlashDevelop 3.0... basically
for fun. I needed a slider control and found the base flex sdk didn't
include one (at least not one easily accessible from pure AS3).

So I googled and found AsWing. Had a slider implemented in my UI in
less than 30 minutes. Bravo!

Here's the problem, though... code bloat. My SWF went from 12Kb to
170Kb. I was careful to import only the classes and constants I
needed for the slider control.

When I look at the source... I see the base class for the slider has
"import org.aswing.*"... and I see it other places as well. So I've
little hope that there is much I can do in *my* code to reduce the
bloat.

Questions...
1) Does anyone know of an effective way to shrink the size down? This
is *pure* AS3 code... no assets to compress. I configured FD to
optimize byte code... to no effect.
2) Any way to shrink AsWing's footprint... short of excising just the
slider and reworking it to not include the kitchen sink?

I sure hope that this problem isn't intractable by design... the
nature of porting swing to AS meant duplicating functionality built
into flash (and thus not into SWF files). This matters to me... I'll
end up writing my own slider if I have to... :(

Thanks in advance,

Marximus

gencha

unread,
Dec 20, 2008, 6:50:01 PM12/20/08
to as...@googlegroups.com
If you really ONLY want a slider than maybe you're better off
implementing your own.
To my understanding AsWing is more focused on completeness and
functionality than on size.

Marximus

unread,
Dec 20, 2008, 7:01:00 PM12/20/08
to ActionScript User Interface Development
That is a fair observation. AsWing does indeed appear very complete
and highly functional. Would be icing on the cake if it were possible
to include only the components needed... so perhaps something to
consider for a future release.

gencha

unread,
Dec 20, 2008, 7:14:56 PM12/20/08
to as...@googlegroups.com
Marximus wrote:
> That is a fair observation. AsWing does indeed appear very complete
> and highly functional. Would be icing on the cake if it were possible
> to include only the components needed... so perhaps something to
> consider for a future release.
>
Well you are only including what you need. And the stuff the components
you need need :P
If you were really importing _everything_ in AsWing you would gain about
700kb.

iiley

unread,
Dec 21, 2008, 8:30:17 AM12/21/08
to as...@googlegroups.com
Hi,

Even you just use only one component, you'll compiled all the needed core classes for example FocusManagers, KeybordManagers etc. So it is not little. (about 150k)

If you just need a slider and want a very small size of swf, better to implement one byself.

Cheers~~



--
iiley
AsWing http://www.aswing.org
Personal http://www.iiley.com

Marximus

unread,
Dec 21, 2008, 4:33:32 PM12/21/08
to ActionScript User Interface Development
Ended up (heavily) adapting someone else's posted code for a slider...
only added 12K to my footprint... so from 26K to 38K.

I'll revisit AsWing should I ever need the full-blown benefits of a
framework... say constructing a form with several control variants.

On Dec 20, 4:14 pm, gencha <teil-neh...@gmx.net> wrote:
> Marximus wrote:
> > That is a fair observation.  AsWingdoes indeed appear very complete
> > and highly functional.  Would be icing on the cake if it were possible
> > to include only the components needed... so perhaps something to
> > consider for a future release.
>
> Well you are only including what you need. And the stuff the components
> you need need :P
> If you were really importing _everything_ inAsWingyou would gain about
> 700kb.
>
> > On Dec 20, 3:50 pm, gencha <teil-neh...@gmx.net> wrote:
>
> >> Marximus wrote:
>
> >>> I've been doing some coding in AS3 using FlashDevelop 3.0... basically
> >>> for fun.  I needed a slider control and found the base flex sdk didn't
> >>> include one (at least not one easily accessible from pure AS3).
>
> >>> So I googled and foundAsWing.  Had a slider implemented in my UI in
> >>> less than 30 minutes.  Bravo!
>
> >>> Here's the problem, though... code bloat.  My SWF went from 12Kb to
> >>> 170Kb.  I was careful to import only the classes and constants I
> >>> needed for the slider control.
>
> >>> When I look at the source... I see the base class for the slider has
> >>> "import org.aswing.*"... and I see it other places as well.  So I've
> >>> little hope that there is much I can do in *my* code to reduce the
> >>> bloat.
>
> >>> Questions...
> >>> 1) Does anyone know of an effective way to shrink the size down?  This
> >>> is *pure* AS3 code... no assets to compress.  I configured FD to
> >>> optimize byte code... to no effect.
> >>> 2) Any way to shrinkAsWing'sfootprint... short of excising just the
> >>> slider and reworking it to not include the kitchen sink?
>
> >>> I sure hope that this problem isn't intractable by design... the
> >>> nature of porting swing to AS meant duplicating functionality built
> >>> into flash (and thus not into SWF files).  This matters to me... I'll
> >>> end up writing my own slider if I have to... :(
>
> >>> Thanks in advance,
>
> >>> Marximus
>
> >> If you really ONLY want a slider than maybe you're better off
> >> implementing your own.
> >> To my understandingAsWingis more focused on completeness and
> >> functionality than on size.
Reply all
Reply to author
Forward
0 new messages