Archive for April, 2006

MySQL tweaks

Friday, April 28th, 2006

I’ve spend the last half of the day trying to optimise (thats how you spell it in Australia) a MySQL script that was grabbing a heap of data to build a excel spreadsheet.

The script included four left joins and was selecting from about 20,000 rows.  It had gradually become slower and slower over the last month as the database grew, until now it was taking over 30 seconds to run the script and make the excel file.

(more…)

Ax

Wednesday, April 26th, 2006

Ax stands for Actionscript XML

Please note: This is a work in progress………

In XHTML there is a standard which is used by all coders which enables browsers to render the code into viewable content.

For example, this sentence in XHTML is within paragraph tags <p >exmaple</p >

XHTML (when done properly) is seperated into three conceptual layers.

  • Content
  • Presentation
  • Behaviour

Flash however is generally quite different. In Flash its very common to see the content seperated out (in xml or via loadVars), however the presentation and behaviour are often grouped together. It could be argued that with Flash this makes more sense. There are obvious advantages to this but there are also disadvantages.

What is Ax?

Ax is an attempt at seperating Flash movies into three layers: Content, Presentation and Behaviour.

But more than that, Ax is attempting to develop a standard for Flash.

The most important feature of Ax is the way that content is stored (The Ax file). This is a XML file which has set standards (similar to XHTML) for storing content. Like XHTML this standard is simple and caters for all types of content.

With a content standard, it is then easy to develop a contentRenderer class. The contentRenderer class talks to the presentationClass to work out how to display the different content elements. There would also be a behaviourClass that would handle things like navigation etc.

This means that you could have a working application as soon as you have the content in a Ax standards based XML. You could then extend the base classes to make the content render and behave as you want.

Advantages

  • Very fast to develop
  • Very easy to change how an application looks or behaves.
  • External tools would be available to make development easy: For example, it would be possible to create a PHP renderer that took a Ax file and turned it into XHTML. Or a basic CMS could easily be build to handle updating Flash movies.
  • Users could switch style sheets while viewing the movie. This means you could create a vision impaired presentation stylesheet (eg. high contrast, big font size)
  • Plugins could be coded and shared. For example if someone created a Ax compatible drop down navigation system, it could be shared and other coders could drop the class straight into their app and it should work.
  • You could have different behaviour and presentation for different devices.
  • Standards are really good :)
  • Easier to develop.

 

Example

This is an example of how Ax may work in its simplest form


function Application(){
    // load fancy stuff only for those who can handle/want it

    if(user == "someone who needs content to be accessible"){
          presentation.setStyleType("highContrastStyleSheet");
          navigation.setNavigationType("simpleList");
          behaviour.setBehaviourType("none");
    }else{
          presentation.setStyleType("fancyStyleSheet");
          navigation.setNavigationType("dropdowns");
          behaviour.setBehaviourType("fadeIn");
    }

    // load content
    contentRenderer.loadAx("myContent.xml");
}

IS this MVC??

No. Not really.

ASForms Version 1.2

Friday, April 21st, 2006

Have uploaded a updated version of ASForms (1.2).

In this version I have added a very simple button FormButton. There is also an example of how the event management works.

(more…)

ASForms released unto the unwary masses

Thursday, April 20th, 2006

ASForms

ASForms is a very lightweight Actionscript component set. They are basically very similar to forms in HTML, but done in flash. (You know, radio buttons, checkboxes - that kind of thing). This release is fairly stable yet lacks accessibility and the button class which I’m still tweaking. The code examples give a basic indication of how it all works and I’ll make an effort to fill in some of the commenting holes over the next couple of weeks.

The code is released under the GPL MIT and was developed with MTASC strict in a AMES dev environment.  

Check it out here.

technorati tags: , ,

as2ant

Wednesday, April 19th, 2006

Using ANT files is to me one of the attractions of using open source flash. One of the things that I really like is the ability to be able to compile multiple swfs at once.

(more…)

Hugeobject launches mtaasuper.com.au

Monday, April 10th, 2006

Screenshot_mtaa2.png
Hugeobject has been ultra busy lately. MTAA super has just been launched - and we are pretty proud of it. From start to release took three weeks (Ackk!). Check it out here.

ASForms bugs and features to add

Wednesday, April 5th, 2006

Todo: need to create a ASForms submit button

Testing: The checkbox has not been tested extensively with more than one checkbox item in a group. One checkbox item is working fine and has been tested heaps.

Download ASForms

Wednesday, April 5th, 2006

ASFormsASForms FAQ | Download ASForms | How to use ASForms

 

 

 

 

Download ASForms.zip Version 1.2

Version 1.2 (21th April 2006)

Have added a button class and included an example of the EventManager. Still need to fix accessibility and tabbing issues.

Version 1.0 (20th April 2006)

This is the first public version of ASForms. Most of the elements are stable and tested except for the Checkbox class which has only been tested using one checkbox. The next version will have built-in accessibility as well as a button class. Released under the GPL.

How to use ASForms

Wednesday, April 5th, 2006

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

Wednesday, April 5th, 2006

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!?!?