Apache flex 为什么swf不能在事件上引用mxml组件?

Apache flex 为什么swf不能在事件上引用mxml组件?,apache-flex,actionscript-3,components,flash,Apache Flex,Actionscript 3,Components,Flash,这段代码被放置在swf中,然后被放置在mxml swfloader中。ProductDesigner是应用程序的名称,selectRed是HSlider mxml组件。我收到的错误是在测试swf时Flash CS5中的“访问未定义的属性ProductDesigner”。是的,我能够拿起intellisense,知道它知道,无论它被称为什么,都有一个产品设计师 private function ChangeColor(event:MouseEvent):void { var red:uin

这段代码被放置在swf中,然后被放置在mxml swfloader中。ProductDesigner是应用程序的名称,selectRed是HSlider mxml组件。我收到的错误是在测试swf时Flash CS5中的“访问未定义的属性ProductDesigner”。是的,我能够拿起intellisense,知道它知道,无论它被称为什么,都有一个产品设计师

private function ChangeColor(event:MouseEvent):void 
{
   var red:uint = ProductDesigner.mainTabs.tabContentColor.selectRed.value;
   var green:uint= ProductDesigner.mainTabs.tabContentColor.selectGreen.value;
   var blue:uint= ProductDesigner.mainTabs.tabContentColor.selectBlue.value;            
   this.transform.colorTransform=new ColorTransform(0,0,0,1,red,green,blue,1);
}
如果不能这样做,有没有办法创建一个自定义事件来返回前面提到的数据?

当然可以 使用SWFLoader,您可以访问应用程序的每个公共类、组件或任何其他部分

您何时尝试访问它?
您在等待完整事件吗?

在鼠标单击事件中调用该函数。所以我想你可以说swf已经加载了。发布swf时,是否需要将发布位置指向flex应用程序文件夹?