{RIA Developer}

Silverlight newsflash

September 28th, 2008 Posted in .net, coding, expression, silverlight | No Comments »

Well, I have to admit that I haven’t been busy with Silverlight lately. I try to follow up on the blogs and here is a list of blogs about Silverlight 2 Release Candidate:

Here you can find more information about downloading and installing the Silverlight 2 RC0 runtime and developer tools. Also Microsoft released Service Pack 1 Preview for Expression Blend that adds full support building for Silverlight 2 applications.

Another interesting blog that I found is this one: Flash vs Silverlight Gallery. It just list a couple of nice visual apps and there are samples including source code in both Flash and Silverlight. So if you want to learn some nice effects in Silverlight her you go. They are all licence free.

Loading remote swf files in AIR

September 16th, 2008 Posted in air, coding, flex | 4 Comments »

I am doing some research for a large AIR application that has to dynamically load swf files (these can be Flex modules, but also regular Flash movies). This is apparently not that easy to accomplish, because it doesn’t work the same as in a normal Flex web application. You quickly run in to security issues because your AIR application runs in a different security sandbox then the remote files you are trying to execute.

You might want to read the following posts before using the code:

Finding a proper solution is not easy. While the second post has a solution that is usable in some situations, it should be implemented with caution. A better solution that uses signing your Flex modules is described in the first post, but it is definitely harder to implement. For now I would go for the second approach.

The following code snippet loads a local swf file into your AIR application. The swf file has to be in the user’s local app-storage folder. The original code can be found in this post.

private function loadLocalSwf(fileName:String):void
{              
    // File reference
    var file:File;
    file = File.applicationStorageDirectory.resolvePath(fileName);

    // Open the SWF file
    var fileStream:FileStream = new FileStream();
    fileStream.open(file, FileMode.READ);

    // Read SWF bytes into byte array and close file
    var bytes: ByteArray = new ByteArray();
    fileStream.readBytes(bytes);
    fileStream.close();

    // Prepare the loader context to avoid security error
    var loaderContext:LoaderContext = new LoaderContext();
    loaderContext.allowLoadBytesCodeExecution = true;

    // Load the SWF file
    var swfLoader: SWFLoader = new SWFLoader();
    swfLoader.loaderContext = loaderContext;
    swfLoader.source = bytes;  
   
    // Add to you stage
    swfContainer.addChild(swfLoader);                              
}

Hopefully Adobe will add more support and techniques to achieve this in future versions of AIR. This would offcourse be very usefull when you want to create large enterprise applications.

Merapi

September 13th, 2008 Posted in air, coding, flex, java | No Comments »

Merapi

Can Merapi help us get more interesting Adobe AIR projects in the future? Well I hope so, but first I have to get approved by the team to play around with the current Alpa version. I registered on their website after reading the articles RFID Enabled AIR Applications With Merapi and Live GPS Visualizations With AIR & Merapiand. This looks very promising indeed.

At my company we get a lot of requests to build an Adobe AIR application for a client, but the client has no clue what Adobe AIR can do and especially what it can’t do. This means that we get requests for applications to interact with other applications and/or communicating with external hardware. You can think of workarounds or tell the client that Adobe AIR is not right technology to solve their problem. But using the Flash/Flex framework can be powerful if you want to build a “Filthy Rich Client”. Using Java also means that the end solution you are building will remain platform independent.

But it also means that you are breaking the security sandbox and your application will have more power over the user’s system. The installation experience of the Java/AIR application might also become more complex then the smooth installation of AIR applications.

Well it’s an interesting product and I hope to play with it very soon.

Check our Project Rosetta

September 11th, 2008 Posted in silverlight | No Comments »

What is Project Rosetta?

Project Rosetta is a site dedicated to helping designers and developers build applications in Silverlight while taking advantage of skills they already know. Learn more about Project Rosetta.

To follow the progress of Project Rosetta, you can follow on Twitter or by subscribing to the RSS feed.

Filthy Rich Flex Clients

September 7th, 2008 Posted in coding, flex | No Comments »

I found this presentation from Chet Haase, who is actually a Java developer, about Filthy Rich Flex Clients. He gave this presentation at Flex360. I really like the term filthy rich client and this is the definition from the book:

“Filthy rich clients are applications that are so graphically rich that they ooze cool. They suck the user in from the outset and hang onto them with a death grip of excitement. They make the user tell their friends about the applications. In short, they make the user actually enjoy their application experience.”

Flex 4 Gumbo: Hello World :)

September 3rd, 2008 Posted in air, coding, expression, flex | No Comments »

Yesterday I downloaded an installed the latest stable build of Flex 4 “Gumbo”. After configuring and installing Flash Player 10, I was able to create my first Flex 4 app. It is only a Hello World kind of application but it shows you the new FXG format for graphics.

When you wanted to add some shape in a Flex project you always needed to go back to Flash and create objects that can be used in Flex. With the FXG you can  now declare shapes using XML. The specification documentation says the following:

FXG 1.0 describes an XML-based graphics interchange format for the Flash Platform. FXG contains high-level graphical and text primitives that can be used to create, group, transform and visually modify basic vector and bitmap shapes.

One of the basic concepts of FXG are graphical objects. FXG provides a general Path element that is used to create a bunch of graphical objects like Ellipses and Rectangles. There are three other concepts and you can read more about it here. For now I’ll stick to playing with the new graphical objects.

FXG supports shapes like Rectangle, Ellipse, Path and these shapes can be filled or stroked. This small example shows a Rectangle with a Stroke and a Fill:

<Rect width="200" height="200">
   <fill>
      <SolidColor color="#FF0000" />
   </fill>
   <stroke>
      <SolidColorStroke weight="10" color="#0000FF" alpha="0.5" />
   </stroke>
</Rect>

This is actually what Silverlight can already do right now with XAML, and why there already exists a tool like Expression Blend. When Flex 4 will be released the integration with design tools (like Thermo) will be a lot easier, at least thats what they are aiming for.

To conclude here is my first go at “Gumbo”. It is an ugly smiley, so don’t shoot me because I am just a developer and not a designer.

<?xml version="1.0" encoding="utf-8"?>
<Application xmlns="http://ns.adobe.com/mxml/2009"
            xmlns:mx="library:adobe/flex/halo"    
            xmlns:gumbo="library:adobe/flex/gumbo">
   
    <gumbo:Group>
        <gumbo:content>      
            <gumbo:Ellipse width="200" height="200">
                <gumbo:fill>
                    <mx:SolidColor color="#FFFF00" />              
                </gumbo:fill>
                <gumbo:stroke>
                    <mx:Stroke color="#000000" weight="2"/>  
                </gumbo:stroke>
            </gumbo:Ellipse>          
            <gumbo:Ellipse x="50" y="50" width="25" height="25">
                <gumbo:fill>
                    <mx:SolidColor color="#000000" />              
                </gumbo:fill>            
            </gumbo:Ellipse>          
            <gumbo:Ellipse x="125" y="50" width="25" height="25">
                <gumbo:fill>
                    <mx:SolidColor color="#000000" />              
                </gumbo:fill>            
            </gumbo:Ellipse>          
            <mx:Path left="50" top="125" data="Q 50 50 100 0">  
                <mx:stroke>
                    <mx:SolidColorStroke color="#000000" weight="5"/>
                </mx:stroke>          
            </mx:Path>
        </gumbo:content>
    </gumbo:Group>  
</Application>

Click here to see the smiley (you will need to have the Flash Player 10 installed to see it).

Upgrading to Flex 3.1

September 2nd, 2008 Posted in air, coding, flex | No Comments »

A couple of weeks ago Adobe release a new version of Flex (version 3.1). The new version contains several bug fixes, but also official support for Adobe AIR 1.1 which was also released a some time ago. Upgrading your Flex SDK is not very hard, you just need to download the zip file that contains the new SDK and configure Flexbuilder so that you can start using it. While writing this I am also downloading the Flex4 Gumbo release, and I am looking forward to check it out.

Just follow these steps to install a new SDK in your Flexbuilder:

  • Download the new SDK: version 3.1
  • Unzip the downloaded file.
  • Open Flexbuilder and go to Window > Preferences > Flex > Installed Flex SDKs
  • Click “Add…” and point the SDK location to the directory where you extracted the zipfile.
  • And now select version 3.1 as your default SDK.
  • That’s it.

footballfan.be

August 29th, 2008 Posted in coding, java | 1 Comment »

I have been working on a social networking platform for soccer fans and players for the last month. We started more or less a month ago building the platform from scratch. We developed the site in Java with a team of very good developers. By using existing frameworks like Hibernate and Spring we were able to deliver on time (which was actually almost impossible).

The new part for me was working with Spring MVC, which meant working a lot in the HTML front-end. With Spring MVC you can almost have data binding like in Flex, but off course keeping in mind that we still are working in a HTTP context. Another cool thing was adding the UrlRewriteFilter so that we can have clean urls like http://www.footballfan.be/users/alain instead of something like http://www.footballfan.be/user.do?username=alain. There are also some cool AJAX features in there. So in the end it was fun developing again in Java, but now I am also eager to go back to Flex or “who knows” a Silverlight project.

So here you go footballfan.be has gone live yesterday and has been launched as part of the “We Believe” campaign. The site is only available in Dutch and French.

This is so true

August 28th, 2008 Posted in coding, fun | No Comments »

Cairngorm moved to Adobe Opensource

August 6th, 2008 Posted in coding, flex | No Comments »

Today the Adobe Consulting team announced in their blog that they have moved Cairngorm to Adobe Opensource. This means that the source code is available via a Source Control System (Subversion), there is also a bugbase for bugs and enhancement requests (JIRA) and there are developer forums for the discussion of features.

You can check it out here.