A quick recording which demonstrates how to use a splash screen within your AIR for Android applications built with Flash Builder and the Flex 4.5 SDK!
Tag Archives: Flex
Mobile Flex 4.5 Demonstration
Demo of mobile Flex 4.5 using Flash Builder 4.5.
The Flex Show: Episode 132

The Flex Show
An interview I did with The Flex Show, back in December 2010, is now available!
On the show, we talk about the use of Flex in higher education – specifically focused on projects I’ve been involved in at the University of Denver. We also go over the Adobe Education Leader program and chat about the wider Flex-in-education community. There is even some talk on mobile application development, the implications of tablet computing in education, and even some AIR for TV!
Toward the close of the episode; I talk about my upcoming book and give mentions to CodeBass, Emergent Collective One, 6Threads, and other projects.
Listen here: Flex in Higher Education: The Flex Show Episode 132
My 360|Flex Proposal was Rejected… yet I am Thrilled!
Like a lot of Flex developers out there, I went through the trouble to author and submit a session proposal for what is probably the premiere Flex conference on the planet: 360|Flex. Earlier today, I learned that my session proposal was rejected. While I would have been quite happy had my proposal been accepted, I am actually thrilled with the fact that it was not. You may, at this point, be asking yourself: “Why?” Why would I be happy about being REJECTED from such a prestigious conference???
This is why:
- Have you seen some of these topics??? Let’s eat!
What a well-rounded and interesting bunch of topics! Think on this: these are only the topics I’ve heard about in passing. The full schedule is going to be AMAZING.Jun Heider – “Developing ActionScript based applications for the iPad”
Antonio Holguin – “Your App is a Theme Park”
Dee Sadler – “Logical Design for Developers – Design isn’t a four letter word”
RJ Owen – “Five Reasons to Learn Flex despite HTML5 and Apple”
Kevin Suttle – “Post-modern Web Design”
Michelle Yaiser – “A long time ago in a galaxy far, far away…”
Dan Florio – “Introduction to Away3D”
Brent Arnold – “AIR for Android: It’s easier than you think”
Kevin Schmidt – “Real Time Gaming Data Services with BlazeDS and LCDS”
Jeffry Houser – “Building Components from MX to Mobile” - I will be able to focus on my book instead of prepping session materials.
I’m actually almost half way completed with my draft chapters – well ahead of schedule. A little extra time never hurt anything! Sometime in the next few weeks, I’ll write a little about my writing process and some things I’ve learned. - I will have time to organize Emergent Collective Two. Let’s rock!
Yeah, I announced EC2 at the FITC Unconference at Adobe MAX last year… but haven’t done anything about it yet. I’ll be taking a different approach to gathering submissions this time; what that means, exactly, is up in the air. Now I have time to really think about this. - I will be able to RELAX!
What? Go to a conference and actually sit back, taking in all the great gobs of information… chatting it up with other attendees… and not having to worry about presenting, myself? Sounds pretty good to me.
Lastly, as I tweeted earlier:
Seriously.
Really looking forward to attending 360|Flex this April, in my home city of Denver. Hope many of you will join me!
Get Up and Running with BlazeDS AMF in Spring MVC
There is a dismal lack of clear instruction for configuring BlazeDS AMF services with Spring. Many of the resources that do exist refer to older versions of the software or strict scenarios that do not apply to everyone using Spring for their projects. This document will outline the steps necessary to configure BlazeDS with Spring when using both Spring MVC, specifically, and Flex.
You can grab the latest build of Spring from:
http://www.springsource.org/
You can grab the latest build of BlazeDS from:
http://opensource.adobe.com/wiki/display/blazeds/BlazeDS
First, you will want to be sure that Spring is configured in the following way:
- You will already have a dispatcher servlet entry in your web.xml for Spring MVC similar to the following:
<servlet> <servlet-name>spring</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>spring</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping>
- Be sure to include the following JAR packages in the /WEB-INF/lib directory of your project:
- asm.jar
- blazeds-common-3.0.jar
- blazeds-core-3.0.jar
- cglib-2.2.jar
- com.springsource.edu.emory.mathcs.backport-3.0.0.jar
- com.springsource.flex.messaging.services.remoting-3.2.0.3978.jar
- org.springframework.flex-1.0.3.RELEASE.jar
- commons-codec-1.3.jar
- commons-httpclient-3.0.1.jar
- flex-messaging-common.jar
- flex-messaging-core.jar
- flex-messaging-opt.jar
- flex-messaging-proxy.jar
- flex-messaging-remoting.jar
- flex-rds-server.jar
- xalan.jar
- commons-logging.jar
- cfgatewayadapter.jar
- spring-flex-1.0.1.RELEASE.jar
To get BlazeDS integrated with Spring, complete the following steps:
- Add the following lines to web.xml:
<servlet-mapping> <servlet-name>spring</servlet-name> <url-pattern>/messagebroker/amf</url-pattern> </servlet-mapping>
- Add the following lines to your servlet XML file:
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/> <flex:message-broker> <flex:mapping pattern="/messagebroker/amf" /> </flex:message-broker>
- Create a file called “services-config.xml” and add this to /web-inf/flex:
<?xml version="1.0" encoding="UTF-8"?> <services-config> <services> <default-channels> <channel ref="my-amf" /> </default-channels> </services> <channels> <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel"> <endpointurl=http://{server.name}:{server.port}/{context.root}/messagebroker/amf class="flex.messaging.endpoints.AMFEndpoint" /> <properties> <polling-enabled>false</polling-enabled> </properties> </channel-definition> </channels> <logging> <target class="flex.messaging.log.ConsoleTarget" level="info"> <properties> <prefix>[BlazeDS]</prefix> <includeDate>false</includeDate> <includeTime>false</includeTime> <includeLevel>true</includeLevel> <includeCategory>false</includeCategory> </properties> <filters> <pattern>Endpoint.*</pattern> <pattern>Service.*</pattern> <pattern>Configuration</pattern> </filters> </target> </logging> </services-config> - Import the RemotingDestination class and add the following annotations to any Java classes that will be used by Flash:
import org.springframework.flex.remoting.RemotingDestination; @Service("flexService") @RemotingDestination(value="flexService",channels={"my-amf"}) - If you are using Spring security, add the following line to whichever xml you are using to define security parameters so we can access message broker:
<security:intercept-url pattern="/messagebroker/**" access="IS_AUTHENTICATED_ANONYMOUSLY" />
Now, to get Flex talking to Java through BlazeDS, we must configure our application as such:
- Import the remoting event packages so that we can send data over AMF:
import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent;
- Now, in your declarations tag, set up a RemoteObject structure similar to this:
<fx:Declarations> <s:RemoteObject id="ro" endpoint="http://website.root/messagebroker/amf" destination="flexService" result="resultAMF(event)" fault="faultAMF(event)"> <s:method name="methodNameFromJavaClass"> <s:arguments> <arg1>{arg1}</arg1> <arg2>{arg2}</arg2> <arg3>{arg3}</arg3> </s:arguments> </s:method> </s:RemoteObject> </fx:Declarations>If you are not passing any arguments, you can simplify the setup as such:
<fx:Declarations> <s:RemoteObject id="ro" endpoint=" http://website.root/messagebroker/amf" destination="flexService" result="resultAMF(event)" fault="faultAMF(event)"/> </fx:Declarations>
- Create methods to handle the result and fault events reported through our remote service:
private function resultAMF(e:ResultEvent):void {} private function faultAMF(e:FaultEvent):void {} - To invoke a remoting call through BlazeDS AMF, simply invoke the specific method off of our remote object instance:
ro.methodNameFromJavaClass.send();
That should be all there is to it.
If you want to test this quickly, here is some quick MXML to do so:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
width="600" height="400">
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
protected function testAMF(e:MouseEvent):void {
ro.helloWorld.send();
}
private function resultAMF(e:ResultEvent):void {
Alert.show("BlazeDS Worked...", "Hot Shit!");
}
private function faultAMF(e:FaultEvent):void {
Alert.show(e.fault.faultString, "Duck and Cover!!!");
}
]]>
</fx:Script>
<fx:Declarations>
<s:RemoteObject id="ro" endpoint="http://website.root/messagebroker/amf" destination="flexService" result="resultAMF(event)" fault="faultAMF(event)"/>
</fx:Declarations>
<s:Button width="375" height="120" label="Test BlazeDS" click="testAMF(event)" fontSize="36" fontWeight="bold" horizontalCenter="0" verticalCenter="0"/>
</s:Application>
Special thanks to Carrie Lorenz for figuring out all the Spring MVC bits and assisting with this documentation.
Note that this document was compiled from our internal experiences integrating BlazeDS and Spring MVC. This is what worked for us… we do not claim to be experts in this area – if you have any feedback, please let us know!
UPDATE: Also check out Edward Montgomery’s post on using BlazeDS with Java (POJOs) using Tomcat!


