MinimalComps v0.91

Get the new version here: MinimalComps v0.91

A few additions and changes. Now you see the VUISlider and HUISlider, which contain a label, slider and value label with settable precision, and a basic Text component. Many of the components take another optional parameter in the constructor for the initial value or label of the component, so you can now set up a button even easier:

[as]new PushButton(this, 10, 10, “Click Me”, onClick);[/as]

I know this is an API change that will break earlier code, which is a big no-no, but screw it, I don’t think that many people are using these things yet. ๐Ÿ™‚

I messed around a while trying to get the SWC to work with CS3, without much luck. I could create a component SWC in CS3 and get it to show up in the components panel. And by dragging that into the library, the component classes were available, but still no font. Best bet is to install the PF Ronda Seven font on your system, then add a font symbol to your FLA library and export it first frame, then add the class path to your FLA. That works for sure.

Also, I moved from a direct call to draw() to a invalidate-and-wait-a-frame method. This was part of my trying to get layout containers working. If you see any glitches in rendering, let me know.

Someone asked me in the comments of the earlier post, why do I bother doing something like this, when there are “tons” of other solutions out there I could contribute to. Well first of all, I’d like to see the “tons” of other non-Flex, AS3 UI components. Other than AsWing (which is the only one the commenter mentioned by name) and the CS3 components, I don’t know of any other packages that fit that bill.

Also, I’m going in a very different direction with these components, as I think is obvious. These are not the kind of things you’d probably want to use on a large, enterprise level RIA. But I think they are awesome for quick apps, experiments, proof of concept pieces, etc. From the amount of positive responses I’ve gotten on these, they definitely seem to fill a niche. In fact, it’s the positive responses that got me to do more work on them, so if you want more, keep it up. ๐Ÿ˜‰

I’ll probably get the source up on Google Code over the weekend, as I’m starting to get requests for that.

This entry was posted in Components, Flash. Bookmark the permalink.

15 Responses to MinimalComps v0.91

  1. Danny Miller says:

    Great,
    Yes it did break my code. I guess I can understand the additional parameter, but I didn’t mind saying MyButton.label at all. In fact, I prefer it since I can bounce back and forth between a regular Button and PushButton.

    Anyway, these are great.

    As for the font, it works for me. I’m using Flex Builder 3 Beta, imported the SWC and the fonts seem to work (at least for PushButton).

    Now all I’d recommend is creating a “style” class. Where you can create a style and apply it to the different components (or globally). I’d also recommend having the _handle Sprite in the scrollers accessible, or at least be able to manipulate the width/height of them.

    Keep it up!

    -Danny

  2. Josh says:

    I’m with Keith. There are too few component sets for AS3 right now, and I’d love to see half a dozen more. Is the the point where I mention that I’m building my own? ๐Ÿ˜‰

  3. felix says:

    I’m interested why you don’t rate the CS3 component set?

  4. kp says:

    Josh, cool! Any previews?

    Felix, I can’t say I used the CS3 comps extensively. I did try to use the slider a couple times and found it a bit buggy. I can’t say for sure that that wasn’t on a beta version though. But they are built for use in the Flash IDE. I guess you can import the SWC to a Flex project and use them that way, but I imagine there is various overhead in there for the IDE live preview, skinning, styling stuff that is not applicable to compiling in CS3. It may be a non issue. I just felt that they were made for Flash authoring, not Flex Builder. In the long run, I just wanted to do my own. ๐Ÿ™‚

  5. Josh says:

    I’ve used the Flash CS3 components in Flex Builder on several occasions. They actually work pretty decently outside of Flash authoring.

    No previews for my components just yet. I’m currently finishing the bare minimum of features to include them in a project I’m doing right now where my client needs components ASAP and Flash CS3’s 9.0.45 version requirement doesn’t jive. They’ll be a little hacky in some important areas, like styles and skinning, so I want to clean up those things before I let anyone see.

    I’m also inspired by the MVC Flex components that Ely Greenfield showed at MAX last year, so I’m considering doing a little refactoring to see if I can build a similar architecture. I’d like to keep mine much lighter than Flex, though, so my final decision to do that or not depends entirely on how much I can take advantage of code reuse for similar components.

    I suppose that explanation isn’t much different than a preview. Someone’ll probably blog about it now, and the pressure will be on. ๐Ÿ™‚

  6. Bert says:

    Hi there,

    great release and I sure think you fill a niche here.
    Anyway, I tried out the VUISlider and I get this error:

    TypeError: Error #1009: Cannot access a property or method of a null object reference.

    I just copied the com folder to my project, installed the Ronda font qas well and use this code:

    var v:VUISlider = new VUISlider(this, stage.width-20, 20,”no”);

    Can you point me to my mistake.

  7. kp says:

    your code works fine for me. I did import the class, and change stage.width to stage.stageWidth:

    import com.bit101.components.*;

    var v:VUISlider = new VUISlider(this, stage.stageWidth-20, 20,”no”);

    and made a new font symbol in the library, exported first frame. Even without the font, the slider still works. just no text shows up. and using stage.width just puts the component off to the left of the stage. no errors in any case.

  8. kp says:

    I just realized that I may not have included the new components in the SWC. Duh! I always forget to update the included files in a Library projects when I add new classes. Anyway, the zip referenced is fixed now and should have the new stuff.

  9. zeflasher says:

    Hello Keith.
    Nice to see those components. There is only a few out there, and not all good or easy to set up.
    So keep up the good work ๐Ÿ™‚

    Btw, talking about AS3 components, there is a component set called liquid developed by bytearray.org
    http://www.bytearray.org/?p=109

    Interresting features like scalable bitmaps, …
    ++

  10. Ken Rawlings says:

    These components look great. I’m looking forward to working with them more. Quick question — I’ve done some research and it’s somewhat unclear what the “Creative Commons Attribution-Share Alike 3.0 License” requires when applied to source code. Is it your intention for any project that uses MinimalComps to be required to provide the source code for the entire project, or only for modifications to the MinimalComps library itself?

    Thanks,
    Ken

  11. kp says:

    Ken, my main intention was just to let the components be open and used freely, and to protect myself from someone modifying them a bit and releasing them as their own with no credit to me. I don’t know much about licences either. In any case, if you have any question about how you can or can’t use them, just email me and there’s a 99.999% chance I’ll say go for it. ๐Ÿ™‚

  12. Ken Rawlings says:

    Thanks Keith, that’s great news! I’m mainly just playing around right now, but definitely will do when I end up doing anything substantial. Speaking of the components, thanks so much for releasing them. Between them and your excellent book I think I’m finally wrapping my head around the subtleties of Flash’s display architecture. ๐Ÿ™‚

  13. Hi Keith,

    I was wondering if you got the code up on Google yet? I ran into a small issue with the checkbox, where the target property of the received event in the click handler is not the checkbox itself, but the Sprite that the user clicks on. This means I can’t ask for the selected state of the checkbox itself unless I store it somewhere. It’s easy to fix that with “mouseChildren = false;” in the init() function of the CheckBox.

    Considering rendering: at low framerates the components can be seen resizing, especially when a different width or height is set after construction. But as you say, these components are ideal for experiments, so no worries there.

    I didn’t get the SWC to work in an Eclipse/FDT/fcsh environment, got some weird error message, so I used the source instead, which is working great. They’re everything I expected: easy to use, very intuitive. Good work!

  14. From Flash CS3 I added the library to the classpath and now I am able to use the classes from the code (but the font is not showing even though I registered the font in my system and added it as a Font symbol in the FLA) however I haven’t been able to use the components from the components panel. If you can illustrate more clearly how to do this it’d be great!

  15. 101 says:

    Iรขโ‚ฌโ„ขm mainly just playing around right now, but definitely will do when I end up doing anything substantial. 101

Leave a Reply