Archive for the 'Flex' Category


Using Boolean AND && Operator in Flex MXML Data Binding

As you probably know because you are searching for a solution to this error, the following Flex MXML code will not work:
<HBox visible=”{((booleanValue1) && (booleanValue2))}” >
You will get this error message during compile:
Error: The entity name must immediately follow the ‘&’ in the entity reference.
Instead you will need to use html escape codes for these […]

How to Use Apache mod_proxy to Work Around crossdomain.xml Constraints

I was recently given the task to load xml from a Flex app hosted on our web site.  Easy task I thought, especially with the mx.rpc.http.mxml.HTTPService flex object. 
Until I ran into this error:

faultCode: Channel.Security.Error
faultString: ‘Security error accessing url’
faultDetail: ‘Destination: DefaultHTTP’
The problem was that the flex swf was to run on our web site, but the xml data was […]

NetStream Errors if no AsyncErrorEvent handler specified

This one kind of bugs me.  If you don’t create an event handler on the flex/flash NetStream object for the AsyncErrorEvent and you call the NetStream.play function you will get the following errors. Well, you will see it in the flash debug player.
ERRORS:
Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095: flash.net.NetStream was unable to invoke callback onMetaData. error=ReferenceError: […]

Flash Media Server from Flex 2

Flex2 with FMS2
OK, this one caused me to waste a bit of time so here I’m going to describe the problem in detail.  Hopefully it will save someone else the trouble I had.  Basically Flex 2 defaults to AMF3 and Flash Media Server 2 will only support AMF0.
On the FMS server side the application was […]

Flex 2 Java Session Log Out

Here is how to log out a user (invalidate their java web session) assuming you have a Flex 2 front end with a Java back end. Also assuming you are using the standard J2EE JAAS authentication api to protect your web app this will log them out of the software. Create a back end java function […]

XPath Issues with JBoss 4.0.3 SP1

I recently ran across this error message when running Flex Data Services 2 inside JBoss 4.0.3 SP1:
ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/samples].[MessageBrokerServlet]:145]
Allocate exception for servlet MessageBrokerServlet
java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom
The problem is with JBoss 4.0.3 SP1 and is […]

ActionScript Package Name Case Sensitvity

I checked out some mxml / action script code from our CVS repository today and recieved an error when trying to compile it:
 Error: Type was not found or was not a compile-time constant: <ActionScript Class Name>
It seemed from the error message that someone must have 1) forgotten to add an import in action script or 2) had messed up with the […]

How to Access HttpRequest from Flex Data Services 2

Sometimes in a flex app that is deployed as part of a java web app you will need to know who is the currently logged in user.  To do this in Flex 1.5 you could use the flashGateway.Gateway class.  In Flex 2.0 this is done using the flex.messaging.FlexContext class (part of the flex-messaging.jar file).  Use […]

Maven Build for Flex Applications

First see related blog Directory Structure for Integrated Flex and Java Web Applications.  This blog shows how easily one can build such project using maven with sample maven.xml, project.xml, project.properties files.  The samples are for maven version 1.0.2 and not version 2.x.             
<to be continued>
NOTE: You will get an error in maven on the call […]

Integrating Flex and Java in an Eclipse Web App Project

Requirements
1. Eclipse Web Tools Platform (WTP) from http://www.eclipse.org/webtools/, specifically the Web Standard Tools (WST) is used in this tutorial.
2. Flex 2 Builder Eclipse Plug-In from http://www.adobe.com/products/flex/flexbuilder/
Create the Eclipse Web App Project
1. Create a new project as “Web > Dynamic Web Project”.
2. Give it a descriptive project name.
3. Uncheck “Use default” and set “Directory” to the root directory where the project […]

Directory Structure for Integrated Flex and Java Web Applications

This blog describes a proposed directory structure for web applications that contain a mix of flex applications, java presentation layer code, and java integration layer code.  From this structure you could easily build projects using ant or maven (preferred). 

FDS 2 and Flex Builder 2

I have found that Flex Builder 2 does not properly recognize any flex data services 2 mx components because it does not include the fds2.swc file by default in its install and thus cannot use the FDS2 controls.  To fix this problem, simply copy fds2.swc from <fds2 install folder>\flex_sdk_2\frameworks\libs to <flex builder 2 plug-in install […]