March 21, 2007
Here is a nice little example of testing for online and offline within Apollo. It is very basic.
Test it by either hitting the Test Connection button or by pulling your cable on disconnecting your wireless.
Here is what is occurring within the application:
- on creationComplete Shell.shell.addEventListener(Event.NETWORK_CHANGE,onNetworkChange);
- onNetworkChange test the connection. Here is the contents of the test connection function.
- var headRequest:URLRequest = new URLRequest();
headRequest.method = “HEAD”;
headRequest.url = “http://blog.everythingflex.com”;
var response:URLLoader = new URLLoader(headRequest);
response.addEventListener(HTTPStatusEvent.HTTP_STATUS,statusChanged);
response.addEventListener(IOErrorEvent.IO_ERROR,error);
- when the HTTPStatusEvent.HTTP_STATUS Event is broadcast statusChanged is called
- The statusChanged fuction checks the status code and sets disconnected if code is 0
- if IOErrorEvent.IO_ERROR is broadcast
- we assume the connection is broken
Thats it. There are additional URLLoader events that can be checked but I haven’t included them in this example. Check the documentation for details on these events. Here is the results:
ONLINE:

OFFLINE:

Download the application
Download source code
2 Comments |
Apollo, Tutorials |
Permalink
Posted by everythingflex
March 21, 2007
LiveCycle Data Services 2.5 is the next generation of the Data Services product originally branded Flex Data Services as a part of the Flex 2 launch.
Here is the list of new features:
- A new Flex SDK (which will be released currently with Data Services 2.5), which includes updates the client-side Web Services library.
- Server-side PDF generation capabilities for RIA applications generates properly formatted PDF documents that include graphical assets from Flex applications, such as graphs and charts.
- Runtime configuration of data destinations in Data Services eliminates the need for a compile-time dependency between clients and the Data Services server configuration.
- Support for WSRP portal deployment of Flex applications, which makes it easy for developers to deploy a Flex application as a portlet in a portal server without having to do any portal specific programming.
- Per Client Messaging quality of service (QoS) allowing Flex clients to select custom data access policies for real- time data.
- Ajax Data Services, enabling Ajax applications to take advantage of the data management and messaging capabilities available in Data Services.
- The Flex-Ajax Bridge (FABridge), which is a small library that can be inserted into a Flex application, a Flex component, or even an empty SWF file to expose it to scripting in the browser without any additional coding.
- Improved off-line message queuing, supporting future Apollo development, which allows Flex applications using Data Services to queue outbound messages locally when the client is offline and manage exactly what is sent to the server upon reconnect.
- Groundwork for future Apollo application support, including a local data cache that enables developers to cache client data requests and data changes to the local file system for later retrieval when an application resumes.
- RTMP tunneling (RTMPT) that allows the use of the RTMP protocol in Data Service applications to traverse firewalls and proxies that currently prevent direct RTMP client connections to the server.
- A new SQL adaptor, which dramatically simplifies the development of applications using Data Management Services without having to write any server-side Java code.
- A new JSP Tag Library that enables MXML and ActionScript code to be embedded into a JSP page providing an easier entry for J2EE developers to Flex programming.
- Several important enhancements to core Data Services performance and scalability.
It is available on the Adobe Labs site now.
Leave a Comment » |
Announcements, Flex |
Permalink
Posted by everythingflex