Welcome!

Adobe Flex Authors: Matthew Lobas, PR.com Newswire, Shelly Palmer, Kevin Benedict

Related Topics: Adobe Flex

Adobe Flex: Article

Integrating Remote Shared Objects with Flex and Flash Communication Server

In this project, a remote shared object on a Flash Communication Server contains data that changes frequently

Communication Server (FCS) together provide an amazing toolbox that will undoubtedly provide inspiration to thousands of developers and projects. Unfortunately, without concrete examples and guidelines for good practices on their integration, we spent many hours on tiny issues that, with additional information, could have been easily circumnavigated.

Those hours of trail-blazing are the inspiration for this article. This article tackles the basic integration of how to use a remote shared object on FCS with Flex. Our goal was to make this integration as simple and straightforward as using a web service from within a Flex MXML file. Flex and FCS provide the foundation for Internet applications that deliver continually changing data to the desktop. This technology, called data push, allows a developer to update information on a user's screen without a browser refresh. In our company, we use this technology to build interactive auction sites that, within moments of a new bid, deliver updated prices on thousands of items to users around the world and update business systems that track critical orders, from estimate through final delivery. This coupling of technology can help you build any application where presentation, collaboration, and up-to-the-moment information is paramount.

Before continuing, I must emphasize that this is a basic implementation and a basic example. If you want to dig into more complex implementations, read, "Developing Rich Clients with Macromedia Flex" and "Programming Flash Communication Server." These books have become invaluable to our organization, and I can't say enough positive things about both of them.

The Project and Approach
In this project, a remote shared object on a Flash Communication Server contains data that changes frequently. It is imperative that the client immediately receive this data without any need to refresh.

In our approach, we connect to FCS server, attach to the remote shared object, and display the data in a Flex DataGrid control. Then, using FCS and Flex, we push changes to the client with Flex data-binding capabilities, so that the DataGrid displays updated data as changes occur.

The Project Scope
You can accomplish 95% of this project solely through MXML constructs, without ever writing a line of ActionScript; however, there are a few issues to understand.

  • Flex has components available for WebService and RemoteObject connections that you can easily access through MXML. Our team wanted to offer this same feature for FCS connections and gain some event listener and broadcasting capabilities.
  • The SharedObject class is static, and therefore it is not used from within MXML in the same way as familiar Flex components. Our team thought that a wrapper for this class that interacted with FCS and provided the user with viable events would be a useful.
If the above points are a bit foreign right now, that is okay. They will become clearer in the course of this and other articles; also, using the following components, you can still work with FCS.

Please take a moment and review FCSService and SharedRemote class documentation, available from the fcs_flex_sample.zip that you downloaded at the beginning of this article.

  • FCSService documentation (fcsservice_class_readme.html)
  • SharedRemote documentation (sharedremote_class_readme.html)
  • Examples of using the two classes together (two_classes_example.html)
  • FCSService.as
  • SharedRemote.as
Now read on to assemble the application.

The Layout
The following example creates a DataGrid control that displays in 90% of the available horizontal and vertical space.

You can create the following MXML file and name it flexFCS_01.mxml, or you can open the solution file (flexFCS_01.mxml) available in the ZIP file that you downloaded in the Requirements section of this article.

Example 1: flexFCS_01.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
xmlns="*" creationComplete="initializeApplication(event)">

    <mx:Script>
    <![CDATA[
      var myData:Array;
      function initializeApplication( event )
      {

    //We are called by the creation complete event of the application tag
    //Instantiate a new Array
      myData = new Array();
      }
    ]]>
    </mx:Script>
<mx:DataGrid id="display_grid" dataProvider="{myData}" width="90%" height="90%"/>
<!--Created a DataGrid and bound the dataProvider to myData--> </mx:Application>

The example specifies the dataProvider property for the DataGrid control as a variable named myData. In the creationComplete event of the <mx:Application> tag, the example calls initializeApplication, which instantiates myData as an instance of Array.

When you run this example, you a DataGrid control and other information displays. Next, you will add the functionality.

Flash Communication Server
Flex and FCS create a client/server environment. Using the MXML code in the flexFCS_01.mxml file, Flex creates a client application that executes on a user's machine. FCS acts as the server in this relationship, providing data and updates to the client.

This article is about interfacing two components, not programming FCS. For more on FCS check out the books mentioned in the beginning of the article. For now, I provide a basic server-side script to demonstrate the interface.

Place file, main.asc (included with the ZIP file in the Requirements section) on FCS server in a directory called random in the \Flash Communication Server MX\applications\ directory.

This file sets up a simple shared object on FCS server. The object has 10 slots, named 0-9. Each of these slots will have a random number (Figure 1). This random number changes every two seconds and FCS pushes the results to the client.

The Connection
At this point you have a simple client application, created in Flex, and a FCS application. Now you will make the client display the changing data from FCS. You accomplish this in two phases. First, you connect to FCS and the Remote Shared Object. Second, you receive information back from FCS and process it for display purposes.

First, add the following highlighted lines to Example 1 (flexFCS_01.mxml) or open the solution file, flexFCS_02.mxml, which is available from the fcs_flex_sample.zip that you downloaded at the beginning of this article.

More Stories By Michael Labriola

Michael Labriola is a founding partner and senior consultant at Digital Primates IT Consulting Group. Digital Primates analyzes client business processes and develops custom solutions that extend the latest technology.

Comments (1) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
SYS-CON Italy News Desk 03/01/06 06:11:57 PM EST

Communication Server (FCS) together provide an amazing toolbox that will undoubtedly provide inspiration to thousands of developers and projects. Unfortunately, without concrete examples and guidelines for good practices on their integration, we spent many hours on tiny issues that, with additional information, could have been easily circumnavigated.

@ThingsExpo Stories
What is the best strategy for selecting the right offshore company for your business? In his session at 21st Cloud Expo, Alan Winters, U.S. Head of Business Development at MobiDev, will discuss the things to look for - positive and negative - in evaluating your options. He will also discuss how to maximize productivity with your offshore developers. Before you start your search, clearly understand your business needs and how that impacts software choices.
High-velocity engineering teams are applying not only continuous delivery processes, but also lessons in experimentation from established leaders like Amazon, Netflix, and Facebook. These companies have made experimentation a foundation for their release processes, allowing them to try out major feature releases and redesigns within smaller groups before making them broadly available. In his session at 21st Cloud Expo, Brian Lucas, Senior Staff Engineer at Optimizely, will discuss how by using...
SYS-CON Events announced today that Taica will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. ANSeeN are the measurement electronics maker for X-ray and Gamma-ray and Neutron measurement equipment such as spectrometers, pulse shape analyzer, and CdTe-FPD. For more information, visit http://anseen.com/.
SYS-CON Events announced today that Daiya Industry will exhibit at the Japanese Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Ruby Development Inc. builds new services in short period of time and provides a continuous support of those services based on Ruby on Rails. For more information, please visit https://github.com/RubyDevInc.
Nordstrom is transforming the way that they do business and the cloud is the key to enabling speed and hyper personalized customer experiences. In his session at 21st Cloud Expo, Ken Schow, VP of Engineering at Nordstrom, will discuss some of the key learnings and common pitfalls of large enterprises moving to the cloud. This includes strategies around choosing a cloud provider(s), architecture, and lessons learned. In addition, he’ll go over some of the best practices for structured team migrat...
As businesses evolve, they need technology that is simple to help them succeed today and flexible enough to help them build for tomorrow. Chrome is fit for the workplace of the future — providing a secure, consistent user experience across a range of devices that can be used anywhere. In her session at 21st Cloud Expo, Vidya Nagarajan, a Senior Product Manager at Google, will take a look at various options as to how ChromeOS can be leveraged to interact with people on the devices, and formats th...
SYS-CON Events announced today that Yuasa System will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Yuasa System is introducing a multi-purpose endurance testing system for flexible displays, OLED devices, flexible substrates, flat cables, and films in smartphones, wearables, automobiles, and healthcare.
Join IBM November 1 at 21st Cloud Expo at the Santa Clara Convention Center in Santa Clara, CA, and learn how IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Cognitive analysis impacts today’s systems with unparalleled ability that were previously available only to manned, back-end operations. Thanks to cloud processing, IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Imagine a robot vacuum that becomes your personal assistant tha...
Organizations do not need a Big Data strategy; they need a business strategy that incorporates Big Data. Most organizations lack a road map for using Big Data to optimize key business processes, deliver a differentiated customer experience, or uncover new business opportunities. They do not understand what’s possible with respect to integrating Big Data into the business model.
Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, will discuss how from store operations...
Recently, REAN Cloud built a digital concierge for a North Carolina hospital that had observed that most patient call button questions were repetitive. In addition, the paper-based process used to measure patient health metrics was laborious, not in real-time and sometimes error-prone. In their session at 21st Cloud Expo, Sean Finnerty, Executive Director, Practice Lead, Health Care & Life Science at REAN Cloud, and Dr. S.P.T. Krishnan, Principal Architect at REAN Cloud, will discuss how they bu...
SYS-CON Events announced today that Dasher Technologies will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Dasher Technologies, Inc. ® is a premier IT solution provider that delivers expert technical resources along with trusted account executives to architect and deliver complete IT solutions and services to help our clients execute their goals, plans and objectives. Since 1999, we'v...
SYS-CON Events announced today that TidalScale, a leading provider of systems and services, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. TidalScale has been involved in shaping the computing landscape. They've designed, developed and deployed some of the most important and successful systems and services in the history of the computing industry - internet, Ethernet, operating s...
Enterprises have taken advantage of IoT to achieve important revenue and cost advantages. What is less apparent is how incumbent enterprises operating at scale have, following success with IoT, built analytic, operations management and software development capabilities – ranging from autonomous vehicles to manageable robotics installations. They have embraced these capabilities as if they were Silicon Valley startups. As a result, many firms employ new business models that place enormous impor...
SYS-CON Events announced today that Taica will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Taica manufacturers Alpha-GEL brand silicone components and materials, which maintain outstanding performance over a wide temperature range -40C to +200C. For more information, visit http://www.taica.co.jp/english/.
SYS-CON Events announced today that MIRAI Inc. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. MIRAI Inc. are IT consultants from the public sector whose mission is to solve social issues by technology and innovation and to create a meaningful future for people.
As hybrid cloud becomes the de-facto standard mode of operation for most enterprises, new challenges arise on how to efficiently and economically share data across environments. In his session at 21st Cloud Expo, Dr. Allon Cohen, VP of Product at Elastifile, will explore new techniques and best practices that help enterprise IT benefit from the advantages of hybrid cloud environments by enabling data availability for both legacy enterprise and cloud-native mission critical applications. By rev...
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend 21st Cloud Expo October 31 - November 2, 2017, at the Santa Clara Convention Center, CA, and June 12-14, 2018, at the Javits Center in New York City, NY, and learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
SYS-CON Events announced today that Datera will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Datera offers a radically new approach to data management, where innovative software makes data infrastructure invisible, elastic and able to perform at the highest level. It eliminates hardware lock-in and gives IT organizations the choice to source x86 server nodes, with business model option...
Infoblox delivers Actionable Network Intelligence to enterprise, government, and service provider customers around the world. They are the industry leader in DNS, DHCP, and IP address management, the category known as DDI. We empower thousands of organizations to control and secure their networks from the core-enabling them to increase efficiency and visibility, improve customer service, and meet compliance requirements.