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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:11:09+00:00 2026-05-13T09:11:09+00:00

I receive from the httpservice with a certain frequency a string like this: 1#3#234525234

  • 0

I receive from the httpservice with a certain frequency a string like this:
1#3#234525234
where
row#column#value
I want to display into datagrid the above string at real time; at the moment my code displays the whole string, composed by many strings like the one above.
How can i solve the problem?
Thanks in advance

I have the following code

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
xmlns="*" creationComplete="srv.send()" >
<mx:Script>
<![CDATA[
    import mx.effects.effectClasses.AddItemActionInstance;
    import mx.effects.AddItemAction;
    import mx.collections.ArrayCollection;
    import mx.controls.dataGridClasses.DataGridColumn;
    import mx.events.*;
       import mx.rpc.events.ResultEvent;
       import mx.rpc.events.InvokeEvent;
       import mx.rpc.events.FaultEvent;
       import mx.rpc.AsyncRequest;
       import mx.rpc.AsyncResponder;
       import mx.rpc.AsyncToken;
       import mx.rpc.AbstractInvoker;
       import mx.controls.Alert;
       import mx.core.Container;
       import mx.core.IDataRenderer;
       import mx.controls.dataGridClasses.DataGridItemRenderer;
       import mx.controls.DataGrid;
       import flash.display.DisplayObject;
       [Bindable]
       public var i:Number;
       public var source:String;
       [Bindable]
       public var row:Array;
       public var column:Array;
       public var value:Array;
       public function cycle(source:String):void
       {
       var data:Array = source.split('#');
       i=0;
       for each(data in source)
       {
        row[i]=data[i]
        column[i]=data[i+1]
        value[i]=data[i+2]

        i=i+3
       }
       }

]]>
    </mx:Script>    
    <mx:HTTPService 
     id="srv" 
     url="http://10.15.20.75/server4flex/servlet/Datagen" 
     method="GET"
     /> 
    <mx:TextArea text="{cycle(srv.lastResult.toString())}" x="10" y="50" 
    width="699" height="59"/>
    <mx:AdvancedDataGrid dataProvider="{source}"  liveScrolling="true" id="dg" 
    x="10" y="117" width="621">
            <mx:columns>
                    <mx:AdvancedDataGridColumn dataField="{row[i]}"
               headerText="Riga"/>
                    <mx:AdvancedDataGridColumn dataField="{column[i]}"
               headerText="Colonna"/>
                    <mx:AdvancedDataGridColumn dataField="{value[i]}" 
               headerText="Valore"/>
            </mx:columns>
    </mx:AdvancedDataGrid>

  • 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-13T09:11:09+00:00Added an answer on May 13, 2026 at 9:11 am

    First of all, the loop seems to be wrong, you iterate over a string source, not an array.
    Secondly, your grid should bind to some properties of objects stored in a dataProvider (Array, ArrayCollection, etc.). So the data provider shouldn’t be a string, as in your code.
    Thridly, dataField is the name of the field of the object stored in the dataProvider, which value should be displayed in the grid cell.

    Basicly, you need to parse your incoming string, store each row in an object and store all these objects in a collection.

    So, the code should be something like:

    [Bindable]
    private var dataList:ArrayCollection;
    
    public function cycle(source:String):void
    {
    var ac:ArrayCollection = new ArrayCollection();
    for(var i:int = 0; i < data.length; i += 3) {
    var dataObj:Object = {row: data[i], column: data[i+1], value: data[i+2]};
    ac.addItem(dataObj);
    }
    dataList = ac;
    }
    
    <mx:AdvancedDataGrid dataProvider="{dataList}"  liveScrolling="true" id="dg" 
        x="10" y="117" width="621">
                <mx:columns>
                            <mx:AdvancedDataGridColumn dataField="row"
                   headerText="Riga"/>
                            <mx:AdvancedDataGridColumn dataField="column"
                   headerText="Colonna"/>
                            <mx:AdvancedDataGridColumn dataField="value" 
                   headerText="Valore"/>
                </mx:columns>
        </mx:AdvancedDataGrid>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 449k
  • Answers 449k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer What libraries and tools are available on Windows and Linux?… May 15, 2026 at 8:07 pm
  • Editorial Team
    Editorial Team added an answer I can only answer part of the question. You can… May 15, 2026 at 8:07 pm
  • Editorial Team
    Editorial Team added an answer Using a modern ver of mysql... Create table Tz_offsets: col… May 15, 2026 at 8:07 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.