Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7167993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:41:23+00:00 2026-05-28T14:41:23+00:00

I am learning the networking portion of Flex 4.5 right now, and the course

  • 0

I am learning the networking portion of Flex 4.5 right now, and the course I am reviewing recommends that I use the <s:CallResponder> class whenever I make a call to a server, either with the <s:HTTPService> component or with my own custom service call to a database.

Both in the course itself and in the Adobe documentation, I cannot find a really good description as to why I should take the approach. Could someone please describe why this is a good idea, and perhaps provide a case where it is highly recommended?

See this example below for a simple case where I am using it. I declare an instance of the class inside of the <fx:Declarations> tagset, and I use it inside of the fetchData() method:

<?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" minWidth="955" minHeight="600"
               skinClass="skins.CustomAppSkin">
    <fx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
            import mx.controls.Alert;
            import mx.rpc.events.FaultEvent;
            import mx.rpc.events.ResultEvent;

            [Bindable]
            private var booksCollection:ArrayCollection;

            private function formatPrice(data:Object, columns:GridColumn):String {
                return priceFormatter.format(data.price);
            }

            protected function fetchData(event:MouseEvent):void {
                booksResponder.token = books.send();
            }

            protected function processXML(event:ResultEvent):void {
                this.booksCollection = event.result.catalog.book;
            }

            protected function loadHandler(event:FaultEvent):void {
                Alert.show(event.fault.faultString, event.fault.faultCode);
            }
        ]]>
    </fx:Script>

    <fx:Declarations>
        <s:HTTPService id="books" url="data/books.xml"/>
        <s:CurrencyFormatter id="priceFormatter" currencySymbol="$" fractionalDigits="2" trailingZeros="true" useCurrencySymbol="true"/>
        <s:CallResponder id="booksResponder" result="processXML(event)" fault="loadHandler(event)"/>
    </fx:Declarations>

    <s:Panel id="panel" title="Products" horizontalCenter="0">
        <s:DataGrid dataProvider="{booksCollection}" height="400">
            <s:columns>
                <s:ArrayList>
                    <s:GridColumn headerText="Title" width="250" dataField="title"/>
                    <s:GridColumn headerText="Author" dataField="author"/>
                    <s:GridColumn headerText="Genre" width="100" dataField="genre"/>
                    <s:GridColumn headerText="Publish Date" width="100" dataField="publish_date"/>
                    <s:GridColumn headerText="Description" width="400" dataField="description"/>
                    <s:GridColumn headerText="Price (USD)" width="100" dataField="price" labelFunction="formatPrice"/>
                </s:ArrayList>
            </s:columns>
        </s:DataGrid>

        <s:controlBarContent>
            <s:Button id="getData" label="Get Data" click="fetchData(event)"/>
        </s:controlBarContent>
    </s:Panel>
</s:Application>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:41:24+00:00Added an answer on May 28, 2026 at 2:41 pm

    Maybe some “historical” background would help. The name “Responder” refers to the way NetConnection class, which is the Flash player built-in API handles the communication. When you make a call to NetConnection (which is commonly used for either plain HTTP connection, where messages are encoded in AMF, or for video download / streaming, which is usually an RTMP-variant connection). Responder is used with NetConnection to communicate using AMF encoding over HTTP.

    There is a built-in Responder class, which is used with NetConnection to store references to two callbacks which will be called in case of successful communication and in the case of communication failure.

    The above scheme is different from other networking API that exist in Flash player. It’s hard to think about the reason, but it’s been like that since AS2. In AS2, however, there was LoadVars object, which also used callbacks for fault and success messages. XML class behaved in a similar way – you would also create two callback functions and assign them to default XML handlers. It’s not impossible that responder is a rudiment of the pre-AS3 design.

    When Adobe (for the reasons known only to them alone) decided to pile up a bunch of indirection layers on top of NetConnection (known in Flex as RemoteObject) they retained the old design choices. They also made more recent API behave in a more archaic way. Thus, for example, HTTPService, which is basically the URLLoader in disguise, behaves the same way as RemoteObject. This probably helped somewhat in MXML templates, but as soon as you realize that MXML language is extremely limiting, the relative merits of features tailored specifically for MXML layout will rather become a plaque made up of multiple questionable design decisions.

    Amy: afaik DCD feature (the code generation for services used in Flash Builder) has not been released to Apache – it’s a part of Flash Builder. So, it’s unlikely to change, unless Adobe will change that themselves.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning networking in C#, and I realized that I'm completely dependent on the
Simple stuff, I am learning URLs/Networking in my class and I am trying to
I am learning Computer Networking this semester, on which I find it quite interesting
I am currently learning about basic networking in java. I have been playing around
learning the basics of Python, now ready for a bigger challange... it didn't take
Learning a lot in my few years of programming that the best projects are
Learning Java I was sometimes taught to use the private access modifier so as
Learning to use Ruby Threads for transportability of code between different OS platforms. The
Learning flex, What would be the appropriate way to add some AS in a
Learning how to use scala DSL:s and quite a few examples work nice. However

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.