Posts Tagged ‘Flex’

ActionScript3 Library for Yahoo! PlaceFinder Webservice released

Saturday, June 25th, 2011

Last night, I released an other small library, which allows you to use the Yahoo! PlaceFinder Webservice with Flex and ActionScript3. The library is based on Parsley, because I have developed the library for my Last.fm projects which use Parsley as application framework.

Yahoo! PlaceFinder Webservice allows to find addresses based on address parts or GPS geolocation information (latitude and longitude).

As Yahoo will discontinue and shut down their Maps Web Service in September, the Yahoo PlaceFinder Webservice can be use as replacement of GeoCoding APIs of the Maps Web Service.

An example, the documentation and the library can be found here.

Updated the Spark Slider with Track Highlight

Wednesday, April 27th, 2011

The latest version supports the toggling of the Track Highlight visiblity using the property showTrackHighlight and changing the Track Highlight color using the property accentColor. The default color of the Track Highlight using the themeColor. Everything works like the old MX Slider.

Also I fixed the problem with the clicking the Track Highlight.

The source code of the sliders is available on GitHub.

First version of PlayBook Device Simulation released!

Tuesday, February 22nd, 2011

Today, I released little private project “PlayBook Device Simulation” that allows to use PlayBook specific API when develop with the AIR Debug Launcher (ADL). The solution consists of two parts: an ActionScript3 Library (PlayBook Device Simulation) and an AIR application (PlayBook Device Simulator).

I ported some of the classes of the QNX AIR Library, so that the classes have some functions and variables (1:1). Currently supported classes and features: AudioManager, Device, MediaServiceConnection and QNXApplication. My solutions supports features, which can’t be test with the VMware Image of the PlayBook Device Simulator, like Power Management (Battery).  Another reason to test the solution is that won’t get any error messages (VerifyError: Error #1014: Class qnx.pps::PPSChannel could not be found) when using any of the supported classes.

Technically, I’m using the ServerSocket API of Adobe AIR to connect the Mobile AIR Application with the PlayBook Device Simulator. This allows a two communication between the Mobile AIR Application and the simulator.

Additional information about integration and usage can be found on the project site: http://www.patrick-heinzelmann.de/labs/playbookdevicesimulation

Playbook development with device specific libraries using QNX PPS and why is ADL throwing errors

Saturday, February 5th, 2011

The Playbook SDK of Blackberry provides additional libraries to use device capabilities which aren’t available in the standard Flex Hero SDK. These Blackberry specific libraries provide access to the controls of the device and contain the QNX specific UI Controls, MediaPlayer/MediaServiceConnection and Pop Dialogs. Blackberry (or QNX) realized the integration using the messaging system of QNX, called PPS Service (QNX Persistent Publish/Subscribe). You can find additional information about PPS here.

AudioManager (qnx.system.AudioManager)

Provides access to the Audio Controls of the Playbook.

MediaServiceConnection (qnx.media.MediaServiceConnection)

Allows the communication between application and the music controller in the upper controlbar of the Playbook.

Device (qnx.system.Device)

Device specific information and allow the application to monitor the battery state of the device.

QNXApplication (qnx.system.QNXApplication)

Allow the application to monitor if the device runs out memory or if the user makes a  Swipe Down Interaction.

MediaPlayer (qnx.media.MediaPlayer)

Build-in MediaPlayer of the BlackBerry Playbook

Dialogs (qnx.dialog.*)

The dialogs are native QNX OS dialogs and using PPS to communicate with your AIR application.

TextInput (qnx.ui.text.TextInput)

Provides the option to define which Keyboard layout will used by defining the type using the parameter “keyboardType”. The image below shows all the available keyboard types.

ADL throws an error when using Playbook specific stuff

If your application is using any of these class above and you try to run your application use ADL (AIR Debug Launcher), the ADL will throw an error (VerifyError: Error #1014: Class qnx.pps::PPSChannel could not be found.) that compiler can’t find the PPS specific class qnx.pps.PPS or qnx.pps.PPSChannel. This error will thrown because these classes are only available on the device or emulator.

I’m personally prefer to develop using the ADL and  only do my final tests using the device or emulator. So I found two solutions to avoid that ADL is throwing the error described above.

1.Solution: Monkey Patch the class PPSChannel

This solution works for the QNX TextInput. Monkey Patch describes the overlaying the original class by adding a modified class with the same name and package into your project.

  1. Open the Library Path in Project Properties
    (File -> Properties -> Flex Build Path -> Library Path)
  2. Selected the qnx-air.swc and change the Link Type from External to Merge into Code
  3. Create a package  called qnx.pps in your project and add a new class PPSChannel into the created package. Use a simple file (File -> New -> File) , otherwhise Flash Builder 4 will not create the class when using ActionScript class.
  4. The class PPSChannel should look like the code below
    package qnx.pps
    {
    	public class PPSChannel
    	{
    
    		public function PPSChannel(){
        	        }
    	}
    }
  5. Recreate the project!
  6. Run the application using ADL

You can download a Flex Project with this solution here.

PS: Don’t forget to remove the class and switch back the Link Type to External when running the application on the emulator or device!

2.Solution: Conditional Compilation

This solutions works perfect when using any of the device integration like AudioManager, MediaServiceConnection, Device or QNXApplication. Because these things can’t be used without running the application on the device or emulator, it makes sense to them off while developing with ADL.

Conditional Compilation allows to include or exclude code based on constants added to the compiler arguments in Flash Builder or using MXMLC.

The constants of the conditional compilation should look like line below.

-define+=CONFIG::device,true

In the source code of the application, you have to add the constant above the functions and attributes of the class which should be included or excludes by compilation.

CONFIG::device
public var audioManager:AudioManager;

CONFIG::device
public function init():void
{
	CONFIG::device
	{
		try{
			audioManager = AudioManager.audioManager;
			audioManager.addEventListener(AudioManagerEvent.OUTPUT_LEVEL_CHANGED, handleOutputLevelChanged);
			audioManager.addEventListener(AudioManagerEvent.OUTPUT_MUTE_CHANGED, handleOutputMuteChanged);
		}
		catch(error:Error)
		{}
	}
}

Set the parameter to “false” running the application with ADL or to “true” using the emulator or device.

Adobe Flex 4 LiveDoc for Conditional Compilation

The second solution helps also if you develop a multi device/screen application and you need a deep integration into the device without creating an extra project for each platform. The developer has only to change the parameter before exporting/building for a specific device or screen.

Stay tuned! At the moment, I’m working on a Flex library and AIR client which allow to trigger all the Playbook device events.

Links:

Documentation of Playbook ActionScript 3 Libraries

Spark Slider with Track Highlight

Tuesday, January 25th, 2011

I’m working on a Playbook application and wanted to recreate the VolumeSlider provided by the QNX ActionScript Library with Flex.

When I tried to convert my Illustrator into Skin for a HSlider in Adobe Flash Catalyst, noticed that the Spark Slider has no Track Highlight. The old MX Slider contains an optional Track Highlight, which can be switched on/off with the parameter “showTrackHighlight”. It was also possible to change color and skin of the Track Highlight on the MX Slider

I extended the original Spark Slider to add a Track Highlight using the Spark Skinning Architecture. At the moment ,I’m working to support the toggling of the visiblity based on the parameter “showTrackHighlight” and the possiblity to change the color of the highlight.

The source code of the sliders is available on GitHub.

With a little bit of modification on the skins, my slider could look like the screenshot below.

Playbook Volume Slider based on modified Spark HSlider with Highlighted Track

Update: 27.04.2011

The latest version supports the toggling of the Track Highlight visiblity using the property showTrackHighlight and changing the Track Highlight color using the property accentColor. The default color of the Track Highlight using the themeColor. Everything works like the old MX Slider. Also I fixed the problem with the clicking the Track Highlight.

Flex Framework for mobile applications

Thursday, October 8th, 2009

Adobe is working on a version of the Flex framework for mobile application, Codemane Slider. When I watched the video about the Slider Preview at Max presentation by Ely Greenfield (Adobe), I was totally impressed about the ideas behind Slider. I like the idea how to solve the to integrate into multiple plattforms and Cross Platform developement based on Conditions and Style/Skins. If you want to now what I’m talking about, check the video below. Adobe provides also a white paper at Adobe Labs.

Actionscript3 based Google Analytics Solution for Flash and Flex

Thursday, June 11th, 2009

If you wanted to track a Flash or Flex based application with  Google Analytics, you had to use the ExternalInterface to call the function of the JavaScript library. While search for a solution which isn’t using JavaScript, I found out that Google now provides some ActionScript3 libraries for Google Analytics.

You can find the documentation here and the libraries here.

The nice thing about the library is that you have the choice whether you want to use a ActionScript-Only solution or combine JavaScript and ActionScript. The only difference between both solutions is one parameter when calling of constructor of the tracker.

Spring BlazeDS Integration 1.0.0.RC1 Released

Thursday, May 7th, 2009

Today, Spring published the first Release Candiate of the Spring BlazeDS Integration. http://www.springsource.org/spring-flex

One of the new features is the annotation-based configuration of Remote Desitinations. You can include and exclude function, which should publish as Remote Objects. The annotation-based configuration really simplifies the configuration of BlazeDS, if you have a big and complex application. Loving it.
An other feature of this release is the full integration of the BlazeDS Message Service.

Next Thursday, Adobe and SpringSource having a Connect Session/eSemiar about the Spring BlazeDS Integration.

Registration: http://www.adobe.com/cfusion/event/i…2539&loc=en_us

dttl.tv relaunched!

Tuesday, May 5th, 2009

On time for the World Table Tennis Championships in Yokohama, the website of the German Table Tennis League (dttl.tv) was relaunched last week. The main element of the relaunched website is a new video player, based on Adobe Flex and the Adobe Flash Media Server. You can find all games of the German Table Tennis League in full length, interviews and the top rally of the day.

On May 15th 2009, the first live stream (19th match day of the German Table Tennis League) of the new website will avalaible.

To manage all the videos and streams, the player has a backend system based on BlazeDS, Spring and Hibernate.

Have fun and visit the website of the best Table Tennis League worldwide to see some of the most brillant table tennis players.

PureMVC Skeleton for Flash Media Server Applications

Tuesday, March 3rd, 2009

While searching for some Flash Media Server informations, I found a PureMVC Skeleton for Flash Media Server Applications on Stefan Richter’s Website. The skeleton provides the logic for the connection to Flash Media Server, but not any implementation of a video player.  I will use the skeleton in a video portal project, which I’m planning for a customer at the moment. Nice stuff.