Technology blog oriented towards good design and impressive web applications.

IdleTogether Home

Archives Posts

Incrementing htmlText on a Spark TextArea in Flex 4

April 10th, 2010 by Nicolas Noben

The property ‘htmlText’ is gone in spark TextArea. It was obviously making life too easy ;)

A work around is to use the spark.utils.TextFlowUtil and shove the html code in it. It formats it for TextArea to display.

This example goes a step further and shows how to add more to an existing TextArea with HTML in it.

// Required: spark.utils.TextFlowUtil
// output is a <s:TextArea />

output.textFlow = TextFlowUtil.importFromString(output.text + htmlSourceToAdd + "<br />");
Filed under Tutorial, Air, Flex, Flash, All having No Comments »

Archives Posts

Reduce CPU usage in Air applications

May 21st, 2009 by Nicolas Noben

arno.org has a great article on how to reduce the CPU usage in your air apps. The meat of it is essentially not using ENTER_FRAME (duh), and more interestingly dropping the framerate to once every 10 seconds (0.1) once the air application goes in the background (minimized/hidden).

Read the full article at arno.org

Filed under News, Air, Flex, All having No Comments »

Archives Posts

The case for a great CAPTCHA idea: Rotate the image

May 7th, 2009 by Nicolas Noben

Here is a great concept for a CAPTCHA.

The ROTCAPTCHA (PDF, 1.4MB).

It’s a CAPTCHA based on image orientation.

The ROTCAPTCHA system requires users to adjust randomly rotated images to their upright position. This is a task most people will be familiar with given the state of early digital cameras, etc.

This system has many advantages, such as being language independent and support many input sources.

Picture 1.png

Filed under Art, News, Rant, Flex, Flash, All having No Comments »

Archives Posts

JSWOOF - A faster JSON encoder decoder for Flex

March 29th, 2009 by Nicolas Noben

JSWOOF is a pretty neat JSON parser. It’s lightweight and about a third faster than the corelib JSON encoder/decoder.

Filed under News, Air, Flex, All having No Comments »

Archives Posts

Database of snippets of code for AS3

March 22nd, 2009 by Nicolas Noben

Here is a great little site I stumbled upon today.

It’s called java2s and it’s basically example source code (snippets) of many languages, organized by topic.

Here is the Flex / Flash / Actionscript category.

Do you know other ones (categorized)? If so, let us know.

snippets-code-flex-as3-flash.jpg

Filed under Tutorial, Air, Flex, Flash, All having No Comments »

Archives Posts

Class to Open object(s) from file with Flex in Air

February 24th, 2009 by Nicolas Noben

Before, I wrote about How to save one or more objects to file using this class.

Today it’s time to read it and bring back the object in Flex.

The class

package com.idletogether
{
	import flash.events.Event;
	import flash.filesystem.*;

	public class Opener
	{
		public static var file:File;

		public static function openFile() :void
		{
			file = new File();
			file.addEventListener(Event.SELECT, dirSelected);
			file.browseForOpen('');
		}

		public static function dirSelected(e:Event) :void
		{
			// this will be our object back
			var dat:Object = new Object();

			var fileStream:FileStream = new FileStream();
			fileStream.open(file, FileMode.READ);
			dat = fileStream.readObject();
			fileStream.close();

			some.object = dat.data;
			some.other.object = dat.structure;
		}

	}
}

How to use it

Simply…

import com.idletogether.Opener;
Opener.openFile();

This example is very basic, but it is kept simple for the sake of being easy to understand. From there you can build up a much more tailored system. This should get you started.

Use the Expressions panel of Flex and add a ‘watch’ to the variable ‘dat’ to see what came back in and if it is in good form.

HTH,
Cheers.

Filed under Tutorial, Air, Flex, All having 1 Comment »

Archives Posts

Class to Save object(s) to file with Flex in Air

February 23rd, 2009 by Nicolas Noben

The class

Feel free to use it for free or commercial projects.

package com.idletogether
{
	import flash.events.Event;
	import flash.filesystem.*;

	public class Saver
	{
		public static var file:File;

		public static function saveToFile() :void
		{
			// pick an unused extension
			file = new File("/filename.ext");
			file.addEventListener(Event.SELECT, dirSelected);
			file.browseForSave('');
		}

		public static function dirSelected(e:Event) :void
		{
			// this object will get saved to the file
			var dat:Object = new Object();

			dat.data = some.object;
			dat.structure = some.other.object;

			var fileStream:FileStream = new FileStream();
			fileStream.open(file, FileMode.WRITE);
			fileStream.writeObject(dat);
			fileStream.close();
		}
	}
}

How to use it

It’s a static method to be called so, simply…

import com.idletogether.Saver;
Saver.saveToFile();

This will prompt the user to pick a destination and will suggest the file name “filename.ext”.

Please note that you can’t save DisplayObjects straight to file using writeObject. It’s a limitation.

From here, find out how to get the object back into flex in the next post.

HTH,
Cheers.

Filed under Tutorial, Air, Flex, All having 2 Comments »

Archives Posts

Apply drop shadow to text at runtime with Flex in MXML

February 22nd, 2009 by Nicolas Noben

A quick and easy one but I always end up looking for it and not finding it easy.

<mx:DropShadowFilter id="dropShaText" distance="1" angle="45" blurX="0" blurY="0" alpha="1" color="0x111111" />
<mx:Label text="Hello world" filters="{[dropShaText]}" />

font-drop-shadow-flex.png

Filed under Tutorial, Flex, All having No Comments »

Archives Posts

Flash / Flex / AIR Development Adelaide - Freelance Available…

February 12th, 2009 by Nicolas Noben

senior-flash-flex-webapplication-ria-development-freelance-australia.pngJust a quick personal update. I’m in the process of going Freelance in Adelaide for Flash development and Flex development.

If you need or know someone who needs a senior Flash/Flex/AIR developer with experience, please don’t hesitate to forward my details.

I’m open for freelance and contract work, remotely or on location anywhere in Australia.

I’ve been developing and designing websites and web applications since the late 90ies and I’ve been full-time Flash-ist for 6 years. I started as a Web Designer. With experience on both sides, I manage my time efficiently and take care of a project from specifications to deployment.

Cheers
Nicolas

Filed under News, Google, Flex, Flash, Blogroll, All having No Comments »

Archives Posts

Adobe launches the Adobe AIR™ Market Place

February 11th, 2009 by Nicolas Noben

Today Adobe announced the launch of the Adobe Air Market Place. It’s a new website supposed to help the promotion of Adobe Air applications and to highlight them for sale.

It’s not an Apple app store, for sure, but it should help promote your Air applications out there.

Picture 5.jpg

Filed under News, Flex, All having No Comments »

Archives Posts

SpatialKey: Heat mapping application

January 21st, 2009 by Nicolas Noben

Spatialkey let’s you overlay data on a map. Really cool.

Picture 3.jpg

Filed under News, Flex having No Comments »

Archives Posts

Capture CTRL+N / CMD+N in Flex/Air/AS3

November 23rd, 2008 by Nicolas Noben

When you program features for (web) application, it’s often useful & good practice to allow users shortcuts for common actions.

This easy snippets shows how to capture ‘new’ or Control+N or Command+N on the Mac.

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown);

private function keyDown(e:KeyboardEvent) :void
{
        if(e.commandKey || e.ctrlKey)
        {
                switch(e.keyCode)
                {
                        case Keyboard.N:
                                // do stuff
                        break;
                }
        }

}
Filed under Tutorial, Flex, Flash, All having No Comments »

Archives Posts

Easy Form Validation and Submit Button enable-disable in Flex 3

November 18th, 2008 by Nicolas Noben

The submit button is enabled/disabled automatically based on the form elements’ validations.

The form

<mx:Form x="0" y="90" width="100%" height="100%" id="form1" creationComplete="resetForm()">
	<mx:FormItem label="Email" width="100%">
		<mx:TextInput width="100%" id="txtEmail" change="validateUs()" />
	</mx:FormItem>
	<mx:FormItem label="Password" width="100%">
		<mx:TextInput width="100%" id="txtPassword" displayAsPassword="true" change="validateUs()"/>
	</mx:FormItem>
	<mx:FormItem width="100%">
		<mx:Button id="btnLogin" label="Login" width="85" height="25" click="loginUser()" />
	</mx:FormItem>
</mx:Form>

The validators

<mx:EmailValidator id="val1" source="{txtEmail}" property="text" required="true" />
<mx:StringValidator id="val2" source="{txtPassword}" property="text" required="true" minLength="2" />

The script

private function resetForm() :void
{
	btnLogin.enabled = false;
}
private function validateUs() :void
{
	btnLogin.enabled = (Validator.validateAll([val1,val2]).length == 0);
}
Filed under Tutorial, News, Flex, All having 2 Comments »

Archives Posts

Automatically resize Text/TextArea based on content (autoSize) in Flex

November 13th, 2008 by Nicolas Noben

UPDATE: turns out that doesn’t always work. the autoSize property is not reliable at all…

This, should do!

var ta_height:uint = 25;

field.validateNow();

for(var i:int=0; i < field .mx_internal::getTextField().numLines; i++) {
	ta_height += field.mx_internal::getTextField().getLineMetrics(i).height;
}

derivedHeight = ta_height;

Thanks Vaan.


Original post:

Adobe’s dodgy textHeight sure doesn’t do the trick. I end up getting a textfield of 2000px height while it clearly looks like 300 tops.

This, however, works.

the code

private function resizeMe(field:TextArea) :void
{
	field.validateNow();
	field.mx_internal::getTextField().autoSize = TextFieldAutoSize.LEFT;
	field.height = field.mx_internal::getTextField().height;
}

Just use that on your TextArea or Text component:

creationComplete="resizeMe(this.myTextAreaInstance)"

Thanks to Vaan for some insight about the mx_internal::getTextField().

Filed under Rant, Flex, All having 9 Comments »

Archives Posts

Odd @font-face parsing in Flex 3 (bug?)

November 6th, 2008 by Nicolas Noben

This works:

@font-face
{
	src: url("assets/FontReg.ttf");
	fontFamily: FontReg;
	fontWeight: normal;
	fontStyle: normal;
}

@font-face
{
	src: url("assets/FontMed.ttf");
	fontFamily: FontMed;
	fontWeight: normal;
	fontStyle: normal;
}

This won’t work properly (all ends BOLD):

@font-face {
	src: url("assets/FontReg.ttf");
	fontFamily: FontReg;
	fontWeight: normal;
	fontStyle: normal;
}

@font-face {
	src: url("assets/FontMed.ttf");
	fontFamily: FontMed;
	fontWeight: normal;
	fontStyle: normal;
}

Yeah. Not much to add. I believe it has to do with the way the flex compiler parses the style code.

Filed under Rant, Flex, All having No Comments »

Archives Posts

Flokoon - flex visual search using last.fm

July 11th, 2008 by Nicolas Noben

Picture 1.pngFlokoon is a visual search engine that uses last.fm api. It’s in french.

Pretty cool. Not too sure about the use of it though.

flokoon.jpg

Filed under Google, News, Flex, All having 1 Comment »

Archives Posts

Awesome Papervision3D experiment - 3D pixels vs. Kraftwerk video

February 12th, 2008 by Nicolas Noben

This is one of the coolest Papervision 3D experiment I have seen.

The screenshots don’t really do it any justice. It has to be animated to really get the cool effect.

Check it out here.

More information can be found in this blogpost.

Picture 12.jpg

Picture 13.jpg

Filed under Flex, All having 1 Comment »

Archives Posts

Flex app: Yahoo! launches Live - Broadcast yourself.

February 8th, 2008 by Nicolas Noben

yahoo live.pngThis is an early beta of a new Yahoo! service called Y! Live.

Yahoo live lets user create their own channel and be live on video I guess. It’s cool and all but frankly I wouldn’t do it. Some You Tube freaks might be craving for it tho, time will tell.

This early beta craps itself all the time. The app looks promising although unclear as to what it’s trying to achieve.

Check out Yahoo! Live.

Love the holycow (url) error.


Design: ★★★★☆
Usability: ★★★★☆
Execution: ★★★☆☆
Overall: ★★★½☆

Yahoo live video.jpg

Yahoo flex video live broadcasting.jpg

Filed under News, Flex, All having No Comments »

Archives Posts

Yahoo Finance - RIA that doesn’t (totally) suck

February 3rd, 2008 by Nicolas Noben

Yahoo Finance has a new charting app in beta. It’s not too bad if you love charts, but still pretty useless being delayed by 15 min; unless you’re into the long term trends.


Design: ★★★☆☆
Usability: ★★★☆☆
Execution: ★★★☆☆
Overall: ★★★☆☆

finance yahoo ria web app.png

finance yahoo flash flex.png

Filed under Flex, Flash, All having No Comments »

Archives Posts

Henley properties - stunning flex Flash app for display homes

February 1st, 2008 by Nicolas Noben

Besides the buggy deep linking in their flash, it’s a very well done web app.

Update: it’s a Flash app, excuse the title.

Henley Properties display homes


Design: ★★★★☆
Usability: ★★★★☆
Execution: ★★★★☆
Overall: ★★★★☆

Henley properties build house.jpg

Henley Properties application.jpg

Filed under Flex, Flash, All having 3 Comments »

« Previous Entries