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 8387925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:20:59+00:00 2026-06-09T18:20:59+00:00

I would like to reuse a s:HTTPService component if possible. I am having trouble

  • 0

I would like to reuse a s:HTTPService component if possible. I am having trouble understanding how to pass a parameter to the service call so the result function can be changed.

For example,

functOne(), HTTPService result = "FunctOneRtn(event)"
functTwo(), HTTPService result = "FunctTwoRtn(event)"

flex 4.6

<fx:Declarations>
    <s:HTTPService id="myCall" url="http://myUrl.com/"
                   useProxy="false" method="POST" result=funct***Rtn(event) >
    </s:HTTPService>
</fx:Declarations>
<fx:Script>
    <![CDATA[
        import mx.rpc.events.ResultEvent;
        private function functOne() :void
        {
            var params:Object = new Object();
            /* call FuntOneRtn */       
            myCall.send(params);
        }
                    private function functTwo() :void
        {
            var params:Object = new Object();
            /* call FuntTwoRtn */       
            myCall.send(params);
        }

        public function FunctOneRtn(event:ResultEvent) : void{
            // Do Some Stuff
        }
                    public function FunctTwoRtn(event:ResultEvent) : void{
            // Do Some Stuff
        }




    ]]>
</fx:Script>

thx Art

  • 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-06-09T18:21:00+00:00Added an answer on June 9, 2026 at 6:21 pm

    You can not pass a parameter to the HTTPService but you can can change the handler function for different requests. This is a sample

    <fx:Declarations>
    <s:HTTPService id="myCall" url="http://myUrl.com/"
                   useProxy="false" method="POST">
    </s:HTTPService>
    </fx:Declarations>
    
    private function functOne():void
    {
           myCall.addEventListener("result",FunctOneRtn);
    }
    private function functTwo():void
    {
           mycall.removeEventListner("result",FunctOneRtn);
           myCall.addEventListener("result",FunctTwoRtn);
    }
    private function FunctOneRtn(event:ResultEvent)
    {
        //handle function one result
    }
    private function FunctTwoRtn(event:ResultEvent)
    {
        //handle function two result
    }     
    

    Then You can call functOne() and functTwo() as you like

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

Sidebar

Related Questions

I would like to reuse the exact same font-face etc... like Android uses in
I would like to reuse certain packages installed systemwide, while ignoring all others. I
We're porting a legacy Java app to JRuby and would like to reuse some
I would like to reuse my GWT linker in several projects, with different configurations.
I have multiple Java projects in Eclipse. I would like to reuse some classes
I am working on address book synchronization algorithm. I would like to reuse some
I would like to reuse code by writing a proto transform which is templated
i am using AndEngine. I have a scene that i would like to reuse
I would like to reuse a figure I create in Matlab script. fig1 =
I would like to reuse safetype enum which I already have to specify argument

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.