views:

271

answers:

4

I have a pure Actionscript 3 project, using flash.* libraries, compiles down to about 6k (using mxmlc). Program handles about 1k shapes, a few sprites, a sockets connection, works great (tastes less filling).

Now, how would I add a ComboBox control without incurring excessive bloat?

More specificially, I would like to keep the size under 100k.

So far I have tried:

  • Adobe mx.controls ComboBoxexample - simple mxml example compiles to 200+k both on my main Linux Box using mxmlc and in Windows using Flash Builder 4
  • Yahoo Astra - uses mx libraries underneath(so as bloated as Adobe?), plus does not contain exact ComboBox
  • Keith Peter's MinimalComps - seems small, but far from providing ComboBox functionality
  • SPAS (Swing Package for Actionscript) - compiles to 130k, but alpha version of ComboBox does not let me adjust height...
  • asuilib - compiles to 40k, unfortunately this ComboBox does not provide for scrolling items...if it does not fit on screen no way to scroll to it

Now my questions:

  1. Is there a way to lower size for projects importing mx.controls ?
  2. Maybe there is a way to fix SPAS or asuilib ComboBoxes?
  3. Perhaps, there are some other libraries which provide a ComboBox(or DropList)?
+1  A: 

Perhaps myLib will fit your needs.

Patrick
Giving it a try right now!
Sint
Not having too much fun with this library, no good examples, plus it had problems importing its own constants, then blank ComboBox constructor halts program. Still upvoted for suggesting alternatives. :)
Sint
+1  A: 

While I do not know of anyway to shrink the size of the mx.controls there is the option of creating shared assets. This way your file size stays small and the combobox resources are cached.

One way to reduce the size of your application's SWF file is by externalizing shared assets into stand-alone files that can be separately downloaded and cached on the client. These shared assets are loaded by any number of applications at run time, but only need to be transferred to the client once.

See http://livedocs.adobe.com/flex/3/html/help.html?content=intro_3.html

<?xml version="1.0">
<flex-config>
    <compiler>
        <source-path>
            <path-element>../mycomponents/components/local</path-element>
        </source-path>
    </compiler>
    <output>../libraries/CustomCellRenderer</output>
    <directory>true</directory>
    <debug>false</false>
    <include-classes>
        <class>CustomCellRendererComponent</class>
    </include-classes>
</flex-config>
Todd Moses
Todd this is a great suggestion. However, in my particular case, it may very well be that users are not using flash often(except my application), so I am not sure when the savings would come into play.
Sint
A: 

Temporary solution: using aforementioned SPAS package,

pros

  • has decent documentation
  • examples
  • lighter than mx.controls
  • last, but not least, it actually works

cons

  • confusing licence, apparently free as in beer, but not as in speech
  • some functionality missing, bugs apparent in alpha(doh)
  • still over 100k compiled
  • apparently one developer, long term viability suspect

Long term: still willing to accept an answer for a "better" flash library with ComboBox.

Sint
+1  A: 

Hi Sint,

I'm the SPAS 3.0 developer, so I'll try to give you some (useful?) answers.

>confusing licence

SPAS 3.0 is not totally free, but it is (always will be) free to use. This is the Java API License. It means that you can use this API the way you want, but you cannot change or sell SPAS 3.0 source codes.

>apparently one developer

You're right! I'm currently working to get partnerships for giving SPAS 3.0 a "real long term viability".

>some functionality missing, bugs apparent in alpha

Right too ;) I know that many developers have been disapointed by the API, because of this choice.

So, if anybody has some issues concerning bugs or missing functionalities, feel free to contact me. I always answer questions about SPAS 3.0.

Pascal

Pascal