[英]How to pass data from view to a callout component in flex (not the other way around)
I have a callout and I want to get data from the View that will be passed to the callout. 我有一个标注,我想从视图中获取将传递给标注的数据。 My callout is not inline, it is in a separate mxml file.
我的标注不是内联的,而是在单独的mxml文件中。
Like for example, I have a string in my View and when I click a button, my callout will open and the string from the View will be displayed inside the callout. 例如,我的视图中有一个字符串,当我单击按钮时,标注将打开,视图中的字符串将显示在标注中。
I hope someone can help. 我希望有人能帮帮忙。 My problem is much bigger but I think with that simple example, I can get any idea on how to pass an object from a View to a Callout.
我的问题要大得多,但是我认为通过一个简单的示例,我可以对如何将对象从视图传递到标注的方法有所了解。
If you have an instance to the Callout; 如果您有一个Callout实例; just set a variable.
只需设置一个变量。
Inside your CallOut component, do something like this: 在您的CallOut组件中,执行以下操作:
public var myValue : MyValueType;
After the callout is created, from within your view, you can do this: 创建标注后,您可以在视图中执行以下操作:
myCallout.myValue = theValueIWantToSendIn;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.