简体   繁体   English

如何将数据从视图传递到Flex中的标注组件(反之亦然)

[英]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.

相关问题 如何在Flex中将数据从一个组件传递到另一个组件 - How to pass data from one component to another component in flex 将数据从视图传递到Flex中的自定义组件 - passing data from view to custom component in flex 在Flex中的视图中关闭标注 - Close a Callout inside a View in Flex Flex Mobile 4.6,如何在主视图中将数据(selectedItem)从主视图传递到详细视图 - Flex Mobile 4.6, How to pass data (selectedItem) from master to detail view in splitview 如何在Flex中将值数组从一个mxml组件传递到另一个? - how to pass an array of values from one mxml component to another in Flex? 如何在Flex应用程序中从Excel查看数据? - How to view data from excel in flex app? 如何在不使用事件的情况下将数据从一个组件传递到另一组件 - how to pass data from one component to other component without using events 如何将数据从一个Flex应用程序传递到另一个? - How to pass data from one flex application to another? 如何将数据从Google App Engine(Python)传递到Flex 4应用程序 - How to pass data from Google App Engine(Python) to Flex 4 application 在Flex中为当前组件内联调用函数时,是否可以传递“ self”或“ this”? - Is there a way to pass 'self' or 'this' when calling a function inline in Flex for current component?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM