Comments
yourfanat wrote: I am using another tool for Oracle developers - dbForge Studio for Oracle. This IDE has lots of usefull features, among them: oracle designer, code competion and formatter, query builder, debugger, profiler, erxport/import, reports and many others. The latest version supports Oracle 12C. More information here.
Cloud Expo on Google News
SYS-CON.TV
Cloud Expo & Virtualization 2009 East
PLATINUM SPONSORS:
IBM
Smarter Business Solutions Through Dynamic Infrastructure
IBM
Smarter Insights: How the CIO Becomes a Hero Again
Microsoft
Windows Azure
GOLD SPONSORS:
Appsense
Why VDI?
CA
Maximizing the Business Value of Virtualization in Enterprise and Cloud Computing Environments
ExactTarget
Messaging in the Cloud - Email, SMS and Voice
Freedom OSS
Stairway to the Cloud
Sun
Sun's Incubation Platform: Helping Startups Serve the Enterprise
POWER PANELS:
Cloud Computing & Enterprise IT: Cost & Operational Benefits
How and Why is a Flexible IT Infrastructure the Key To the Future?
Click For 2008 West
Event Webcasts
Getting Started with Adobe Flex 2
Flex, as I'm sure most people know, is a way for programmers to create Flash movies

The code, once again, goes inside the application block. The RemoteObject tag has an ID, which allows us to access it in code, a destination that is a special distinguisher, and the source. The source is the Web location of your CFC. When accessing the CFC remotely, it must be Web accessible (unless you change settings to allow you to access CFCs via a ColdFusion mappings, but such a configuration is beyond the scope of this article). Inside the RemoteObject block there is one method that we respond to: "GetHello". The mx:method tag accepts two arguments: a name and the result. The name is the name of the method on the CFC. The result is the name of a local method that will be called when the Flash Player gets the results from calling that event.

The next step in our code base is to write the GetHello_Handler, which is written in ActionScript. You can put ActionScript in a MXML page using the mx:Script tag:

<mx:Script>
<![CDATA[
    import mx.rpc.events. ResultEvent;
    import mx.utils.ObjectUtil;

private function GetHello_handler( event:ResultEvent):void {
    Result.text = ObjectUtil.toString(event.result);
    }
]]>
</mx:Script>

After the script tag comes the CDATA. This tells the XML parser to ignore the text in the script tag. ActionScript is not a valid XML dialect. (I'm not saying that's bad, though.) Then I import the two objects that are used in the function. Importing objects in this manner is not common in ColdFusion development, but if you've worked with older versions of ActionScript or Java, you've probably seen it. It just says, "I need this object, so make it available to me."

The function should look similar to a CFScript function; I specified the function as private. Then comes the function keyword, followed by the name of the function. Next comes the list of arguments. This function only has a single argument, the ResultEvent. Then comes a colon followed by the return type. This function doesn't return anything. The one line of code takes the result from our function call, translates it to a string, and assigns it to the text of our Result label. It sounds more complicated than it actually is.

Type in the code (or copy and paste from the Web version), compile it, and execute it. You should see something similar to Figure 1. Click the button. Unfortunately nothing happened as the button was not told what to do yet. A click event needs to be added to the button. The new button code will look like this:

<mx:Button x="154" y="56" label="Get Hello" click="helloWorld.GetHello()"/>

The click event refers to the helloWorld remote object and says, "Execute the GetHello" method on that object. You should recognize this syntax for calling the method from your use of CFCs inside ColdFusion. When the button is clicked, the Flash player goes to the remote object and calls the method. When the method result is returned, the Flash player looks for the "mx:method" tag and executes the result function. Recompile the code and try it out. Click the button and you should see the Hello World text display next to the button (see Figure 2).

Conclusion
Adobe has done a fantastic job of making ColdFusion the best back-end tool for developing Flex applications. Included with Flex Builder are some Eclipse extensions that work well with ColdFusion, including RDS support and some code generators. I'm just scratching the surface of what can be done with Flex and how you can combine it with ColdFusion. I'd love to see what you are going to do with this technology, so be sure to let me know! See you in a month.

About Jeffry Houser
Jeffry is a technical entrepreneur with over 10 years of making the web work for you. Lately Jeffry has been cooped up in his cave building the first in a line of easy to use interface components for Flex Developers at www.flextras.com . He has a Computer Science degree from the days before business met the Internet and owns DotComIt, an Adobe Solutions Partner specializing in Rich Internet Applications. Jeffry is an Adobe Community Expert and produces The Flex Show, a podcast that includes expert interviews and screencast tutorials. Jeffry is also co-manager of the Hartford CT Adobe User Group, author of three ColdFusion books and over 30 articles, and has spoken at various events all over the US. In his spare time he is a musician, old school adventure game aficionado, and recording engineer. He also owns a Wii. You can read his blog at www.jeffryhouser.com, check out his podcast at www.theflexshow.com or check out his company at www.dot-com-it.com.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

I'm going to postpone the second part of my RSS aggregator article to tie this column into this Flex-themed issue. Have no fears, though, it will be back in full force in the next issue. Flex, as I'm sure most people know, is a way for programmers (you, me, and us) to create Flash movies.


Your Feedback
Web Developer's & Designer's Journal wrote: I'm going to postpone the second part of my RSS aggregator article to tie this column into this Flex-themed issue. Have no fears, though, it will be back in full force in the next issue. Flex, as I'm sure most people know, is a way for programmers (you, me, and us) to create Flash movies.
Latest Cloud Developer Stories
To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitiga...
Intelligent Automation is now one of the key business imperatives for CIOs and CISOs impacting all areas of business today. In his session at 21st Cloud Expo, Brian Boeggeman, VP Alliances & Partnerships at Ayehu, will talk about how business value is created and delivered throug...
"We're here to tell the world about our cloud-scale infrastructure that we have at Juniper combined with the world-class security that we put into the cloud," explained Lisa Guess, VP of Systems Engineering at Juniper Networks, in this SYS-CON.tv interview at 20th Cloud Expo, hel...
Historically, some banking activities such as trading have been relying heavily on analytics and cutting edge algorithmic tools. The coming of age of powerful data analytics solutions combined with the development of intelligent algorithms have created new opportunities for finan...
As businesses adopt functionalities in cloud computing, it’s imperative that IT operations consistently ensure cloud systems work correctly – all of the time, and to their best capabilities. In his session at @BigDataExpo, Bernd Harzog, CEO and founder of OpsDataStore, presented ...
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021



SYS-CON Featured Whitepapers
ADS BY GOOGLE