PlayBook 文本输入变量的 Flex 应用程序
我知道这可能是一个非常简单的问题,但是有人可以指导我如何将用户输入的内容作为:TextInput 并将其用作 JSON 数据请求中的变量吗?
基本上,我想让用户输入一个搜索词,例如“数学”,然后将其放入变量中,以便我可以在 JSON 请求中使用它。
像 public var q:String 之类的东西,除了我的搜索框(以及用户输入)位于应用程序的另一个“视图”上。
我刚刚开始使用 Flex Mobile 应用程序,可能还远远不够。有谁知道该怎么做?
I know this is probably a very simple question, but can someone please walk me through how to take what a user inputs into a s:TextInput and use that as a variable in a JSON data request?
Basically, I want to have a user enter a search term, like "math" and then have that placed into a variable so I can use it in a JSON request.
Something like public var q:String, except that my search box (and hence user input) is on another "view" of the application.
I've just started with Flex Mobile applications and I might be way out of my league. Does anyone know how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
包含视图应该仍然能够访问子视图的属性(以及控件);您只需要控件有一个唯一的 ID,然后该 ID 就成为属性名称。也就是说,我认为整个搜索功能是独立的,因此它有自己的控制器(用于处理操作的操作脚本类)连接到搜索按钮,并且有对其可以提取的视图的引用来自等的信息
The containing view should still be able to access teh child view's properties (and therefore controls); you just need the control(s) to have a unique ID, which then becomes a property name. That said, I would consider the whole search feature to be self-contained, so it'd have its own controller (action script class for handling actions) wired up to the search button, adn have a reference to the view that it can extract the info from, etc.