Archive

Archive for July, 2008

Air Application Auto-Update

July 30th, 2008

There is a SDK at Adobe Labs with a beta of Air Application Updates. There are 2 ways, using the UI update and the headerless update. The headerless allows you to make updates and checks without the end-user knowing the checks.

Lets make a small example.

Short Description:
1.) Local AIR Application read local config file.
2.) The config file points to external (online) config file.
3.) Online Config file holds online released update and path to file.
4.) If file is never, download and upgrade

air-updater

1.) Download the SDK
1.1) Download the files from Adobe Labs AIR Update Framework.
1.2) Put the 2 *.swc file into your app-folder/sdks/3.0.0/libs/air

2.) Create a Project
2.1) Well, you know how to create a Flex AIR Project =)

3.) The Local Settings File
3.1) Create an XML file in the project (mine is config.xml)
3.2) Change the url path where the online pointer file is.
3.3) If using the GUI version of update change the settings in defaultUI

<configuration xmlns="http://ns.adobe.com/air/framework/update/configuration/1.0">
	<url>http://www.undefined-type.com/update-buxfer.xml</url>
	<delay>1</delay>
	<defaultUI>
		<dialog name="checkForUpdate" visible="true" />
		<dialog name="downloadUpdate" visible="true" />
		<dialog name="downloadProgress" visible="true" />
		<dialog name="installUpdate" visible="true" />
		<dialog name="fileUpdate" visible="true" />
		<dialog name="unexpectedError" visible="true" />
	</defaultUI>
</configuration>

4.) Create the Online Pointer File
4.1) Create the XML file, (mines called update-buxfer.xml) this is so that I put all my pointer xml file at 1 place on my server.
4.2) Fill the file with example code.

<update xmlns="http://ns.adobe.com/air/framework/update/description/1.0">
  <version>1.4</version>
  <url>http://undefined-type.com/apps/buxfer_1.4.air</url>
  <description>
           <![CDATA[
               This update enables automatic updates in the future.
           ]]>
   </description>
</update>

5.) The actual file
5.1) Don’t forget to put the actual new *.air file on the server where you are pointing =)
5.2) When building make sure as well to change the “version” in the application xml file.

6.) The Code
6.1) When you want to check the update just add this code.

import air.update.events.UpdateEvent;
import air.update.ApplicationUpdaterUI;
 
private var updater : ApplicationUpdaterUI;
private function check():void
{
	var confFile : File = File.applicationDirectory.resolvePath("config-template.xml");
	updater = new ApplicationUpdaterUI();
	updater.configurationFile = confFile;
	updater.addEventListener(UpdateEvent.INITIALIZED, onInit);
	updater.initialize();
}
 
private function onInit(event:UpdateEvent):void
{
	updater.checkNow();
}

AIR, Flex

Flex Builder – Built in Compare Tools

July 28th, 2008

Did you know that Flex Builder has support for comparing file (even from different projects) and keeping a local history for your files without that you need to use SVN/CVS.

Example #1 : Local History
1.) Right click on your file.

compare-history-1

2.) Select Compare With -> Local History
3.) Select when you want to compare with.

compare-history-2

4.) Do the comparison =)
compare-history-3

Example #2 : File Compare
1.) Select 2 files and right click.

compare-file-1

2.) Select Compare With -> Each Other
3.) Do the comparison =)
compare-file-2

Flex , ,

Västtrafik + API = undefined

July 28th, 2008

Got hold of Västtrafik (Gothenburgs public transportation system) and asked them for an open API. Vasttrafik has before had some open connections for services but it they have now shut it and their webmaster pointed me at this direction.
http://www.vasttrafik.se/sv/Att-resa/Reseplaneraren/Reseplaneraren-pa-din-sida/Post.aspx

So it seems like to use their services I need to include an iFrame with their services. A sad day for me, with an open API there was loads of posibilities for e.g. connecting a map with destinations drawn for your route, select where you want to go on the map and why not port that to the iPhone.

So I’m giving Västtrafik the thumbs down. Bad public service API;s…. bad…

Life ,

Flex Builder Plugins

July 27th, 2008

Flex Builder doesn’t have all the tools for your development, take XML for e.g.
So here is some plugins that might help. To install:
1.) Open Flex, Goto menu Help -> Software Updates -> Find and Install.
2.) Select “Search for new features to install”.
3.) Add a “New Remote Site…”, enter a prefered name and the url.
4.) Mark the site checkbox and Finish next and then just follow the instructions.

Aptana
It has some XML, JavaScript, PHP, Ruby on Rails, AIR and so on. The best thing that it’s totally free as long as you can stay away from the Pro version.
Install Path: http://update.aptana.com/install/3.2/

Subversive
Excellent SVN tool for your development, note here that Aptana has the plugin “Subclipse” that as well is a SVN software. Don’t know why but I like subversive more.
Install Path: http://www.polarion.org/projects/subversive/download/2/update-site/

Flex ,

Flex 3 as CS3 development tool

July 24th, 2008

I’ve played around a little with Flex 3 Builder. I love the FDT plugin to Eclipse. But I think it’s a little to expensive and for having a use for it I need the enterprise to get debugger functionality.

So I started to search and to play around with my Flex 3 Builder, why can’t I use this??? Well, as it looks like it’s actually possible.

I created a little video tutorial how to set it up. This is my first video tutorial so sorry if it’s a little strange. If anyone got some good tips of how to create video tutorials please let me know because this was harder than I thought. The files are very big so will try to record them all over.

Read more…

Flash, Flex , , ,

Don’t quit your day job!

July 23rd, 2008

I’ve quit my job as a Senior Flash Developer at HiQ Interactive in Sweden/Gothenburg. So now I’m sitting home with my new bought iMac computer =)

Must say that I love my new mac. But I’m having some problems with it as well. For a developer the keys are all messed up, shortcut keys don’t really work (as I want it to work :) ). But hey, I figure I gotta learn soon. I hope.

Life

Flex 3 Profiler = Life saver

July 22nd, 2008

Did some testing with Papervision 3D – Great White (2.0), strangly when I change my dataProvider for the Menu the memory kicks up a bit and never goes down. Tried to add weak listeners and nothing worked.

Then I started to look at the Profiler, by setting a “Memory Snapshot” in the end after a lot of clicking I can compare the 2 Snapshots and saw that the 2 classes RenderRecStorage and Vertex3DInstance was never collected by the garbage collector.

Using Flex 3 I can search All Files in the project and noticed that it’s the BitmapMaterial class that is never destroyed, even if I remove the DisplayObject3D;s from the Scene.
So I simply put all the material in a Array and when removing the DisplayObject3D from stage I make sure that I run *.destroy(); on the BitmapMaterial classes.

So this is how it looked like before.

papervision3d-profiler2

And now. Problem solved, the memory profile looks like it should :)

papervision3d-profiler

Flex ,

Buxfer Sweden Bank Converter

July 22nd, 2008

I figured that I would start keeping track on my personal bank accounts. Where does my money go anyway, why is it always empty ???

So after a little surfing on the web I found http://www.buxfer.com

Wonderful site with its simple way of tracking, keeping metadata tags for grouping. Just so simple and I love it. Then the problem came. I want to import my accounts and not do it manually and buxfer doesn’t support my bank (but it supports a very long list of other banks).

Download and try the air application: buxferbankaccountconverter

So what happened I wrote my own little parser.

#1 Copy & Paste Bank Account data

buxfer-account

#2 Paste into the converter and run it. Has for now Handelsbanken & Nordea. Export to the csv file.

buxfer-convert

#3 Import into Buxfer

buxfer-import

———-
UPDATED: 2008-07-05
Added support for banks
- Handelsbanken
- Nordea
- Swedbank
Extras
- Added support for direct upload data into buxfer account.
———-
UPDATED: 2008-07-13
Added support for banks
- SEB
———-
UPDATED: 2008-07-22
Bugfix
- Sort order by date and lock columns

- Remove Saldo in descriptions, messes up saldo for buxfer.
———-
UPDATED: 2008-07-30
Added support

- Application auto-update.
———-
UPDATE: 2009-02-21 (Version 1.5)
Fixed Handelsbanken Copy/Paste linebreaks
———-
Note: seems like problems for recognizing income/expense when uploading data.
———-
UPDATE:2009-03-31 (Version 1.6)
Fixed MAC OS 10.5 Paste problem.
A confirmed bug in Mac os x 10.5 made it almost impossible to copy/paste the account data to the application. The fix is to hijack the text event:

textField1.addEventListener(TextEvent.TEXT_INPUT, input);
function input(event:TextEvent){
event.preventDefault();
 
var textField:TextField = event.target as TextField;
var currentText:String = textField.text;
var insertionPrefix:String = currentText.substr(0, textField.selectionBeginIndex);
var insertionSuffix:String = currentText.substr(textField.selectionEndIndex, currentText.length);
textField.text = insertionPrefix + event.text + insertionSuffix;
var caretIndex:int = insertionPrefix.length + event.text.length;
textField.setSelection(caretIndex, caretIndex);
}

more information about the bug can be found at adobe bugs.

Download and try the air application: buxferbankaccountconverter

AIR, Life , , ,

Using tweens for animation

July 18th, 2008

Started to look what Tween Managers that is out there and after looked at Moses Tween Bencher. I’ve decided to start using Tween Lite AS3 . The performance and stability of multiple tweens are amazingly better than Tweener, Fuse, Laco that I’ve been using for some years now.

For more functions I think I try out Tween MAX – The big brother.

Flash , , ,