开发者

How come a swf can not reference mxml components on an event?

开发者 https://www.devze.com 2023-01-05 10:37 出处:网络
this piece of code is being placed inside a swf which is then being placed inside a mxml swfloader. The ProductDesigner is the name of the application and the selectRed is a HSlider mxml component. Th

this piece of code is being placed inside a swf which is then being placed inside a mxml swfloader. The ProductDesigner is the name of the application and the selectRed is a HSlider mxml component. The error that I receive is that "Access of undefined property ProductDesigner" in the Flash CS5 when testing the swf. Yes I am able to pick up the intellisense to know that it knows that there is a ProductDesigner in the whatever it's called.

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.tabC开发者_如何学编程ontentColor.selectBlue.value;            
   this.transform.colorTransform=new ColorTransform(0,0,0,1,red,green,blue,1);
}

If this can't be done, is there a way to create a custom event that returns the forementioned data?


Sure, it can be done using SWFLoader you can access every public Class, Component or any other part of the application.

When are you trying to access it? are you waiting for the Complete Event?

0

精彩评论

暂无评论...
验证码 换一张
取 消