在AS3键值对 [英] Key Value Pairs in AS3

查看:154
本文介绍了在AS3键值对的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个后端PHP脚本发送信息到AS3应用程序。我把它发送的JSON的信息,我做了什么,使之成为键值对被粘键,并在它的前面一个等号,并把它关闭。它适用于较小的值,但由于某些原因,它不工作这一点,继承人的code,我希望你们能帮忙。感谢:)

I have a back-end PHP script sending info to an as3 app. What I have it sending is Json info, what I did to make it a key value pair was stick a key and an equals sign in front of it, and send it off. It works on smaller values, but for some reason, it's not working with this, heres the code, I hope you guys can help. Thanks :)

<$c$c>c3po=[{"in_reply_to_status_id":null,"favorited":false,"contributors":null,"truncated":false,"source":"API<\/a>","created_at":"Fri七月09二十三点15分29秒+0000 2010","coordinates":null,"in_reply_to_screen_name":null,"in_reply_to_user_id":null,"user":{"profile_background_image_url":"http:\/\/a1.twimg.com\/profile_background_images\/100564626\/hexagons-twtr.jpg","description":"Graphic\/web设计师和Abduzeedo一些,地利博客创建者:波尔图Alegre","profile_sidebar_fill_color":"d9f0fd","profile_image_url":"http:\/\/a3.twimg.com\/profile_images\/555183361\/avatar-hair_normal.jpg","profile_background_tile":true,"statuses_count":7520,"profile_sidebar_border_color":"c4c4c4","screen_name":"abduzeedo","lang":"en","profile_use_background_image":true,"created_at":"Mon 12月4日23时31分20秒+0000 2006","followers_count":54252,"contributors_enabled":false,"friends_count":407,"geo_enabled":true,"profile_background_color":"000000","following":false,"favourites_count":114,"protected":false,"verified":false,"profile_text_color":"525252","name":"Fabio Sasso","time_zone":"Brasilia","url":"http:\/\/www.abduzeedo.com","id":41553,"notifications":false,"utc_offset":-10800,"profile_link_color":"2d68a9"},"place":null,"geo":null,"id":18154410176,"retweeted_status":{"in_reply_to_status_id":null,"favorited":false,"contributors":null,"truncated":false,"source":"feedly<\/a>","created_at":"Fri七月09 22时57分03秒+0000 2010","coordinates":null,"in_reply_to_screen_name":null,"in_reply_to_user_id":null,"user":{"profile_background_image_url":"http:\/\/a3.twimg.com\/profile_background_images\/47193661\/curses_.png","description":"Degree在建筑和与网络的工作,位置:阿雷格里港, Brasil","profile_sidebar_fill_color":"bed3d4","profile_image_url":"http:\/\/a3.twimg.com\/profile_images\/554722981\/fabianome_normal.png","profile_background_tile":false,"statuses_count":2602,"profile_sidebar_border_color":"8cbdba","screen_name":"FabianoMe","lang":"en","profile_use_background_image":false,"created_at":"Thu 03月27日21点07分○四秒+0000 2008","followers_count":1807,"contributors_enabled":false,"friends_count":191,"geo_enabled":true,"profile_background_color":"1a1107","following":true,"favourites_count":9,"protected":false,"verified":false,"profile_text_color":"25140d","name":"Fabiano Meneghetti","time_zone":"Brasilia","url":"http:\/\/fabiano.me","id":14238754,"notifications":false,"utc_offset":-10800,"profile_link_color":"d1242a"},"place":null,"geo":null,"id":18153403793,"text":"Beautiful房屋:悬崖屋在印度喀拉拉邦的http:\ / \ / bit.ly \ / aAGjcb - 通过@GisMullr},文:RT @FabianoMe:美丽的房子:悬崖屋在印度喀拉拉邦的http:\ / \ /bit.ly\/aAGjcb - 通过@GisMullr,百分比:25}]

推荐答案

如果你使用JSON,你就不能删除键,仅返回JSON数据?这是什么使我更有意义。

If you're using JSON, can't you just drop the key and the return only the JSON data? This is what makes more sense to me.

从你的动作code,你可以加载数据设置的URLLoader dataFormat属性,以URLLoaderDataFormat.TEXT和解析响应数据作为JSON。

From your actionscript code, you could load the data setting the URLLoader dataFormat property to URLLoaderDataFormat.TEXT and parse the response data as JSON.

否则,也许rawurlen code()可以帮助你ghave邻的键/值的方法因为某些原因:

Otherwise, maybe rawurlencode() could help if you ghave to o with the key/values approach for some reason:

$json_data = ''; // your current data goes here
echo 'c3po=' . rawurlencode($json_data);

这篇关于在AS3键值对的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆