Welcome

Thanks for dropping by! Feel free to join the discussion by leaving comments, and stay updated by subscribing to the RSS feed. See ya around!

Categories

Tag Cloud

WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

Unwrap ObjectProxy to access real object

Sometimes you need to wrap Flex object with special mx.utils.ObjectProxy wrapper class to listen for property change events. Documentation describes special object_proxy “object” property containing reference to real object. But accessing this property at runtime always returns “null”, althought this property is visible in debuger watch window with “package” icon. Code below demonstrates the problem, and shows “Real object: null” message:

import mx.utils.ObjectProxy;
import mx.controls.Alert;
...
var o1:Object = { f1:"test", f2:123 };
var o2:Object = new ObjectProxy(o1);
var o3:Object = ObjectProxy(o2).object;
Alert.show("Real object: "+o3);

Solution is pretty simple. To access the original object, you need to use special namespaced property and  special code handling. Here is a sample:

import mx.utils.ObjectProxy;
import mx.utils.object_proxy;
import mx.controls.Alert;
...
var o1:Object = { f1:"test", f2:123 };
var o2:Object = new ObjectProxy(o1);
var o3:Object = ObjectProxy(o2).object_proxy::object;
Alert.show("Real object: "+o3);

Could not resolve mx:AdvancedDataGrid to a component implementation

Today my daily maven build was broken with wierd message:

[ERROR] Could not resolve <mx:AdvancedDataGrid> to a component implementation 

This happened after adding  <mx:AdvancedDataGrid> component to project mxml file. In Flex Builder all compiled fine, but build with maven failed. After spending some time with google, i’ve found the root of a problem.  The problem is that  this component isn’t included in Flex SDK, that was installed in my repository.  The files needed for successful compilation are ‘datavisualization.swc’ and ‘datavisualization_rb.swc’. So i took these files from Flex SDK version 3.2 and installed two artifacts to maven repository:

 mvn install:install-file -DgroupId=com.adobe.flex.sdk -DartifactId=datavisualization -Dversion=3.2.0.3958 -Dpackaging=swc -Dfile=datavisualization.swc
mvn install:install-file -DgroupId=com.adobe.flex.sdk -DartifactId=datavisualization_rb -Dversion=3.2.0.3958 -Dclassifier=en_US -Dpackaging=swc -Dfile=datavisualization_rb.swc

And added two dependencies to project pom.xml:


<dependency>
<groupId>com.adobe.flex.sdk</groupId>
<artifactId>datavisualization</artifactId>
<version>${flex.sdk.version}</version>
<type>swc</type>
</dependency>
<dependency>
<groupId>com.adobe.flex.sdk</groupId>
<artifactId>datavisualization_rb</artifactId>
<version>${flex.sdk.version}</version>
<type>swc</type>
<classifier>en_US</classifier>
</dependency>

That’s all, hope it will be helpful for somebody.

How-to set proxy properties in Java

Sometimes you need to connect to internet from your java programs. It’s easy to do via URLConnection. But when you are behind the proxy server, your program doesn’t know how to deal with it. Configuration of proxy server is fairly easy. All you need to do is to setup following system properties:

System.setProperty("http.proxySet", "true");
System.setProperty("http.proxyHost", "name_of_proxy_server");
System.setProperty("http.proxyPort", "proxy_server_port_number");

Spring BlazeDS Integration Release

Today Jeremy Grelle had announced that the first GA release of Spring BlazeDS Integration, the open source solution for building Spring-powered RIAs with Adobe Flex, is now available.

This project’s purpose is to make it easier to build Spring-powered Rich Internet Applications using Adobe Flex as the front-end client. It aims to achieve this purpose by providing first-class support for using the open source Adobe BlazeDS project and its powerful remoting and messaging facilities in combination with the familiar Spring programming model.

More details and download is available on http://www.springsource.org/node/1499

For anyone who is just starting to explore the world of Spring-powered RIAs, be sure to check out Using Spring BlazeDS Integration 1.0 for an introduction and to get up and running.

How-to download source files for maven dependencies

If you want to have source files of your project dependencies in local repository, you need to execute following command:

mvn dependency:sources

If you are creating project for Eclipse and want source files to be included to the project, you can run this one:

mvn eclipse:eclipse -DdownloadSources

Flex Formatter Eclipse Plug-in

If you’re using Eclipse and Flash/Flex Builder, you might want to have a look at the Flex Formatter Plug-in. It’s a great add-on that allows you to (auto-)format your ActionScript and MXML files, based on the templates you define.

More info: http://sourceforge.net/projects/flexformatter/

Hello World!

This is first post on VariaMind blog. Left here for historical purposes:)