Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 280
  • Last Modified:

manupulating JSON in Actionscript

hi guys

I am using JSON on the UI with Adobe Flex

On my JSON side i have

      "trade:Manager":{
         "id":"trade:Manager",
         "name":"Manager",
         "render":[
            "Text"  
         ],
         "renderAs":"Text",        
         "key":"TradeId",        
         "value":"",        
         "visible":true,
         "events":[

         ],
         "req":"/app/tradeApp.do",
         "reqType":"json",
         "reqMethod":"GET",
         "width":150,
         "height":20,
         "inc":[

         ],
       
      },

when screen is submitted my action script code is invoked
On my action scrpt side i am able to see "trade:Manager"  ( Object[4].id = "trade:Manager") -- from JSON
My requirment is
On my actionscript code is there any way i can change the visible":true( in JSON code) to visible":false ?

Object[4].id.visible  = false ?

Any help will be greatly appreciated

thanks

0
royjayd
Asked:
royjayd
  • 2
1 Solution
 
leakim971PluritechnicianCommented:
for (var i:uint = 0; i < jsonObject.length; i++) 
{
      if( jsonObject[i].id ==  "trade:Manager" ) {
          jsonObject[i].visible = true; 
          break;
      }
}

Open in new window

0
 
royjaydAuthor Commented:
thanks
should it be

jsonObject [ i ] .visible = 'true';  ?
0
 
leakim971PluritechnicianCommented:
no, 'true' is a string
true is a boolean
I understand you want to set visible as a boolean

boolean are valid value for json object

check value here : http://www.json.org/
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now