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

  • Home
  • SEARCH
  • 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 8771573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:49:24+00:00 2026-06-13T17:49:24+00:00

EDIT – Looks like you cannot parse data from PHP without going through XML.

  • 0

EDIT – Looks like you cannot parse data from PHP without going through XML. Using JSON will be the best way. Source

I’m very new to Flex been using it for 2.5 days. My Flex application accesses a PHP script that calculates two numbers. The script works as it is but I want to retrieve multiple variables from the PHP script so I can have an answer for not only addition but also multiplcation etc…

I hope I have made some sense….

Flex:

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark"
        title="Adding Numbers">

    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
        <s:HTTPService id="srvCalc" url="http://192.168.0.3/flex/flex-phpexample/calc.php"
                   resultFormat="text"
                   method="POST">

        <s:request xmlns="">
            <number1>{txtNumber1.text}</number1>
            <number2>{txtNumber2.text}</number2>
        </s:request>

    </s:HTTPService>
    </fx:Declarations>

    <fx:Script>
        <![CDATA[
            private function btnCalc_Click(event:MouseEvent):void
            {
                srvCalc.send();
            }
        ]]>
    </fx:Script>

    <s:VGroup width="400" horizontalCenter="0" verticalCenter="0">
        <s:Label id="txtAnswer" text="{srvCalc.lastResult}" />

        <s:Label text="First Number:" />
        <s:TextInput id="txtNumber1"
                     width="100%"/>

        <s:Label text="Second Number:"/>
        <s:TextInput id="txtNumber2"
                     width="100%"/>

        <s:Button id="btnCalc"
                  label="Calculate"
                  click="btnCalc_Click(event)"/>
    </s:VGroup>

</s:View>

PHP:

<?php
    $number1 = $_POST['number1'];
    $number2 = $_POST['number2'];

    print($number1 + $number2);
?>
  • 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-13T17:49:25+00:00Added an answer on June 13, 2026 at 5:49 pm

    The easiest method would be to have php return a JSON encoded block and then use http://flexjson.sourceforge.net/ to decode it in flex. There are some other methods you can use, but this is the easiest and most structured way.

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

Sidebar

Related Questions

Edit: This question looks like it might be the same problem, but has no
EDIT: iam using ajax to load text in my content that is why onload
EDIT : It turned out that this can only be done through an external
EDIT: Parsed the array completely (it contained unparsed JSON!) array(22) { [0]=> array(4) {
EDIT: Mangling is fixed - primary issue appears to be the php/mysql connection In
EDIT:This did it: SELECT DISTINCT profileid FROM profilesrelevation WHERE profileid NOT IN ( SELECT
EDIT: I have been using Postgres with PostGIS for a few months now, and
Edit: I would like to keep the infrastructure as is, so while the framework
EDIT: I am using MS SQL server 2008 R2 as well. Well, on a
Edit: The question in one line: How to pass along context from a MenuItem

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.