and then...

browse by category
browse by month

2010: 01 02 03 04 05 06 07 08 10 11 12
2007: 01 02 03 04 05 06 07 08 10 11 12
2006: 01 02 03 04 05 06 07 08 10 11 12
2005: 01 02 03 04 05 06 07 08 10 11 12

Archive for 'General'

How to use ASForms

ASFormsASForms FAQ | Download ASForms | How to use ASForms

 

 

 

 

Using ASForms is fairly simple – especially if you have ever used html forms before as its the same principal. For each form you need to add a ‘element’ which consists of an id and a label.

For example if I wanted to add a checkbox I would do this:


// add checkbox with id 'p' and label Papadums
var checkbox:Checkbox = new Checkbox(_root, "indianDelights", 123);
checkbox.addFormElement("p", "Papadums");
checkbox.setPos(50, 50); // set the position of the checkbox (x,y values)
checkbox.render(); // draw the checkbox

If you wanted to change a form (perhaps because of an event), you can easy add another form element or remove one, as long as you render the movieclip again:


// add another couple of checkboxes
checkbox.addFormElement("n", "Naan");
checkbox.addFormElement("r", "Raita");
checkbox.render(); // when this draws there will be three checkboxes: Papadums, Naan, Raita

Remove an item:


// remove Naan
checkbox.removeFormItem("Naan");
checkbox.render(); // when this draws there will be two checkboxes: Papadums, Raita

To get the selected values from the form is easy:


// get the results from the checkboxes
var resultsArray:Array = checkbox.getSelected();
trace(resultsArray); // this will display an array of the checkboxes that are selected (eg. n,r)
// note that it only displays the id - not the label

One thing to note is that the results are always returned in a array – even for text inputs and radios. In this case you just grab the first element of the array – getSelected()[0] :


// get the results from the radioboxes
var radioBoxesResult:String = radioBoxes.getSelected()[0];
trace(radioBoxesResult); // output: someId
// note that it only displays the id - not the label

More to come…

I’ll keep adding to this. But will make an effort to add code in the next few days explaining:

  • The simple event management built in
  • How the skins work
  • All the available methods and functions and what they do and do not
  • How to implement buttons[code to come]
  • ASForms FAQ

    ASFormsASForms FAQ | Download ASForms | How to use ASForms

     

     

     

     

    What are ASForms?

    ASForms is a group of Flash ‘form’ components designed to replace the buggy and bloated Adobe components. In other words radio buttons, drop down menus, text inputs etc. They are very light weight and snappy.

    Can you skin them?

    ASForms has been designed to resemble html form elements. Changing the colours, and fonts of ASForms is very easy. However changing the shapes requires further hacking. This is because ASForms has been designed to be fast and lightweight so the code bloat added by a full featured skinning engine has been omitted. If you want a fully skinnable set then you should check out some of the other component sets out there.

    Are they fast to render?

    Yes. One of the requirements of ASForms was that they would be very snappy.

    Are they MTASC compliant?

    Of course! All code has been developed in a AMES environment using a strict MTASC setting.

    Are they Open Source?

    ASForms are released under the GPL MIT.

    Why don’t they do this or that?

    ASForms are simple and light weight. If you want something more full featured then check out ASWing or some of the other open source component sets.

    Whats up with the commenting?

    I used a auto commenting java program to fill everything out and I haven’t finished making it all pretty yet!?!?

    ASForms

    ASFormsASForms FAQ | Download ASForms | How to use ASForms

     

     

     

     

    ASForms are lightweight and snappy Flash forms (components). They are designed for people who don’t need a full component framework, but rather need quick and easy flash forms they can drop into an application without too much trouble or size increase. Forms included so far are: Radio buttons, checkboxes, text input, password input, hidden fields, drop down boxes and simple text boxes

    Although a skin system has been implemented, it is fairly primitive at this stage – changing colours or fonts is easy but anything else is difficult.

    Example of ASForms (7kb)
    [kml_flashembed movie="/projects/ASForms/SmallDemo.swf" height="200" width="200" /]

     

    Adding ASForms in is dead simple:

    
    import com.hugeobject.asforms.*; // import asforms
    // create some radio buttons in the movieclip 'base'
    var radio:Radio = new Radio(base, "rBands", depth++);
    radio.setPos(10,80); // set the x and y
    radio.addFormElement("a1", "Interpol");
    radio.addFormElement("a2", "Sebadoh");
    radio.setSelected("a1"); // sets 'Interpol' as selected
    radio.render(); // draws the radio buttons
    
    // get the results from the radio
    radio.getSelected()[0]; // returns 'a1'
    
    

    The current version is stable enough to be used in production however the focus management isn’t great at the moment. Over the coming weeks I hope to get the focus management a-OK and let you choose which Skin file to use on a form by form basis.

    If you are using ASForms or have any questions or find a bug, let me know via email. If you would like to be notified when I update ASForms please send an email here.

    Code

    ASForms – a lightweight actionscript component alternative.

    AX – standards based flash.

    Go Dave go

    My mate Dave recently scored a quick job with 37signals.  Nice work Dave! I remember about a year ago, sitting in a crappy cubicle based work place and Dave was  telling me all about 37signals with a zeal  unbefitting anything web :) He implemented the sounds in campfire via a small flash movie.

     

    Check out Daves project Xhtmlized – great idea.

    technorati tags: ,

    About

    My name is Andrew and I’m located over here in Melbourne, Australia. I work for a company called Hugeobject - which I started with my mate Scott late 2004. Hugeobject makes websites and multimedia. I use Flash, PHP, .NET, Xhtml/css and dabble in a dozen others.

    So…. you should write me an email now.

    Hello world

    After messing around with serendipity for a while, I’ve finally migrated to wordpress. Nice and simple interface.