Agile Developer, Berlin, Germany

18.03.2008

Using (Native)Windows with AIR

Filed under: air, flex, programming — pegolon @ 11:16

If you want to use windows in AIR with custom chrome (especially transparent) you have to consider some drawbacks. First you cannot use NativeWindow if you want to use Flex components from the mx.* namespace. There is a separate Window class in the AIR package which encapsulates a NativeWindow. To get your own content inside this window you can create a separate MXML file like this:

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Window xmlns:mx=”http://www.adobe.com/2006/mxml”
width=”200″ height=”100″
transparent=”true” systemChrome=”none” type=”normal”
showStatusBar=”false” showTitleBar=”false” showFlexChrome=”false”>
<PlaceYourContentHere/>
</mx:Window>

This will display a transparent window without any controls and header on the screen.

Whenever you want to create and display the window use:

var myWindow:MyWindow = new MyWindow
myWindow.open()

If you want to change the position of the window you have to use its nativeWindow property:

// Center window

myWindow.nativeWindow.x = (Capabilities.screenResolutionX – myWindow.width) / 2
myWindow.nativeWindow.y = (Capabilities.screenResolutionY – myWindow.height) / 2

I used to use the NativeWindow class for transparent windows since AIR beta 1. To get Flex-Containers in it I initialized them in the main application window, removed them there and added them to stage of the NativeWindow. This worked fine until I used controls like ComboBox or ColorPicker which relied on the PopupManager. The popup window didn’t occur until I found that it was opened in the main application window at the position of the initial component.

18.02.2008

My favorite monospaced font for coding of the month

Filed under: flex, programming — pegolon @ 15:29

I am constantly overthinking my editor font for coding. Using Java and Eclipse I was able to use a anti-proportional font because of the automatic code formatting. Unfortunately in Flexbuilder there is no such thing as automatic code formatting. Much worse the editor ignores sometimes, that I don’t want to use tabs at all and mixes tabs and spaces. So I had to switch back to a monospaced font and found this one in the web: http://www.ghostscript.com/~raph/type/myfonts/inconsolata.html Its under the Open Font License which feels rather unrestricted. 

23.01.2008

Strange Flex/AIR error

Filed under: air, flex, programming — pegolon @ 14:14

If you get this error:

Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found. 

There is likely a Loader.load() call which cannot find the file. You should add an event listener like this

loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onError)  

17.10.2007

Adobe Max Barcelona: Round-up Day 3

Filed under: air, flex, programming — pegolon @ 19:27

The last day of the conference.

XD Initial Visions for the AIR experience

One of the best sessions I attended. Using the Adobe Media Player the presenter described the design decissions they made. Gave me some cool insights especially for the paradigm “Moving has Meaning”

Best Practices for Developing with ActionScript 3.0

The agenda was quiet impressive but the session at all was a complete dissappointment. Nearly a third was about ActionScript the rest was about how to develop programs. I don’t need to know that. The better named that session “Best Practices for Programming Newbies” :-(

Functional & Performance Testing flex Applications: Borland’s Approach

I didn’t know that Borland bought an Austrian company that writes testing software. SilkTest it is called and now supports also Flex but the GUI is so ugly (Windows 95 style, Windows only) I had to suppress a reflex to vomit. I would never ever use such an ugly software. They are planning to release it next year as an Eclipse plugin. Very boring and confusing presentation.

HTML and Script Bridging for Flex Applications in AIR

That guy (Kevin Hoyt) was incredible. He had no powerpoint slides and did all the hacking live without using any prepared code statements. Very cool and thorough look into the possibilities of the Bridging API.

Introduction to LiveCycle Data Services for Flex Developers

A German trying to make a presentation in English with some really strange pronounciations (“thee” instead of “the”, “methord” instead of “method”…). He really messed up the whole presentation and could not impress the audience with the cool features of LCDS at all. Nonetheless I found the framework very cool.

Flash Player Internals

Some useful insights into the inner works of the Flash Player. I enjoyed it very much.

16.10.2007

Adobe Max Barcelona: Round-up Day 2

Filed under: air, flex, programming — pegolon @ 20:27

The second day started with a keynote. They showed some really cool services:

Scene7 – server-side image scaling and management service, really nice shopping experiences are possible with that

Pacifica – a VoIP service for FlashPlayer

Share – a data sharing service, which renders the uploaded files in a Flex application

CoCoMo – a collaboration service which can be used with Flex

The rest of the day I attended the following sessions:

Adobe Platform Roadmap

Nothing really new here. Just one sentence made me listen attentively.  There seem to be already plans to port AIR also to mobile devices and other platforms…

Customizing the Flex Framework

Some interesting things. I hope the slides will appear soon on the max site so I can read them a second time. The topics validators and formatters will need more work in my current applications. I wasn’t aware, they existed.

Rich Internet Applications and Mobility

Held by an Intel guy who was a little bit disappointed that Adobe was not listening to him. He wanted to have battery and wifi status methods in AIR. Since Adobe was not listening he showed some browser plugins that provided these functions through JavaScript. I didn’t really get the point here…

Optimizing ActionScript 3.0 Performance

The content was very good but the presenter, a Swiss guy with very bad English pronounciation was overstrained. He could not speak fluently and sometimes mixed his speech French words and letters. Listening was a pain.

AIR Tips and Tricks

The third (!) time I got an introduction into AIR, how cool it was and especially how the File API worked. But there were also some new things especially about native windows in AIR, which change a little bit with the last beta.

Sneak Peek Session

Some nice and cool new features which might make it in real products where shown. The most impressive one: they hired a guy who had this really cool idea how to resize images far better.

15.10.2007

Adobe Max Barcelona: Round-up Day 1

Filed under: air, flex, programming — pegolon @ 19:52

I attended the following sessions on my first day.

Working with Persistent Data in AIR

Although I already used the File API and the SQL API very intensively this session gave some new insights to the new synchronous SQL API and the new Encrypted Local Store which comes in handy.

Flex Roadmap

Some cool new features which might appear in the next version of Flex: primitive graphics. Another cool feature: the components are being split up into MVC parts so especially the View can be altered very extensively.

Local Database Access with AIR and Data Synchronisation Strategies

My second introduction to AIR and the SQL API :-( Oh my, the presenter used most of the time telling the audience what it means that the SQL API can be used synchronously and asynchronously. Then 3 minutes before the end he remembers that there was another topic: Data synchronisation. That was the part that interested me. His only comment: “Well, data synchronisation is difficult”. That was very disappointing!

Adobe Max Barcelona: Keynote

Filed under: air, flex — pegolon @ 17:05

That was impressive.

The keynote showed some details of the different Adobe products. Especially the future versions for the Flash Player, Flex and AIR was kind of an eye opener for me. The key problem I’ve had so many times was to decide which framework/language to use when the key factors were plattform independency and performance.

  • Java was Ok to use, but the startup-time and the download size of the VM is a showstopper and Swing looks quiet differently (and boring) on different platforms.
  • Cocoa looked sleek, but it was only Mac OS X and Objective-C is in my oppinion no programming language I want to program with.
  • Qt was very promising, but it is not royalty free and the days of C++ are over (Qt Jambi Java support is too early).

After the keynote I had the answer: AIR! You get such a nice user experience with eyecandy and effects, can do all the stuff you need, your application looks exactly you want it on each operating system and installation of your app is quiet easy for the user. You get auto update functionality and can sign your apps to prevent fraud.

The cool things Apple did with CoreImage are possible with Hydra (write your own filters) plattform-idependent. CoreGraphics 3d effects like in the Apple TV start screen are possible with the 3d feature of Flash Player 10 (Astro).

I have already used the SQL-API in AIR and I am wondering if it would be powerful enough to compete with something like JDBC…

They showed many Flex/AIR applications like an iMovie clone for mixing videos online, a cool shopping application from Antrophologie. I have never seen such a great user experience! Really great.

Adobe Max Barcelona: Flex Best Practices

Filed under: flex — pegolon @ 10:25

My first session at Adobe Max in Barcelona. Just some talk about various topics. I was a little disappointed, since I didn’t learn anything really new. The topics discussed where:
- Start with Flex

How to start a Flex project. What should Flash developers keep in mind when switching to Flex.

- Server Side Integration

If your need server side data managing consider using the Flex Lifecycle Data Services. It is Java based and very stable. If you have to built your own it might not be that much cheaper…

- Modules
- Don’t use the module manager. It’s buggy. Adobe Consultants write their own.
- Write your own loader and wait for event
- Use it for dynamic class loading, assets (themes), movie clips
- (pensieve)
- Use modules only when the complexity really is too high

- ActionScript with mxml
- Use only gui logic in mxml
- Place business logic in separate as files to use FlexUnit tests on them
- (Refactor desktop.mxml)

- CSS
- Integrate early
- -> Style Explorer
- Subclass builtin components to make usage of CSS easier

My favorite quote and highlight of the session: “Developers tend to design Star Trek consoles

12.10.2007

I’m back and have great news

Filed under: Blogroll, flex, programming — pegolon @ 9:39

After a few months in my new job I’m returning to this blog to post some interesting stuff.

I switched my development focus from Java to Adobe Flex and AIR. On sunday I will fly to Barcelona to attend Adobe Max and get some insighs about the future development of this cool technology.

My first impressions about Flex are very enthusiastic since one can build a fancy GUI with some nice eye-candy effects in no time. The communication with a server backend is very lean and the learning curve from Java to ActionScript 3.0 was quiet flat. In fact AS3 has some nice similiarities with Ruby like in-built associative arrays and closure-style functions.

My development environment is Flexbuilder 3 Beta 2 as a Eclipse plugin which I use with Eclipse 3.3 (Europa). At the moment the transition from Beta 1 to Beta 2 is quite ruff since the are some draw-backs.

For instance I did some refactoring in a Flex library project and moved my FlexUnit test classes in a subproject to call it. Refactoring in Flexbuilder 3 should be a key feature of the new version but I must say it is almost non-existing. If you move a file the filename is replaced but the classname inside and the package are not changed. Sometimes you cannot rename files at all and have to switch to the console to do it by hand and with another text editor. So after my refactoring I keept getting an error “could not find source for class test.XYZ” at location “Unknown”. Cleaning the project didn’t help.

Then a collegue of mine discovered that in the file .flexLibProperties are all the source files which have to be compiled. Removing all the moved files solved the problem.

I’ll keep you posted about my impressions from the Max conference.

Blog at WordPress.com.