Question

I have a class with name com.me.Async,when I start async unit test,unfortunately flexunit's library has same class org.flexunit.async.Async ,so flashbuild show error -1120: Access of undefined property org. .
how to solve this type of issue ? thanks !

Was it helpful?

Solution

When you have two classes with the same name, but different packages used together in the same scope, you have to use the full class path for at least on of the uses. So if I want to use a flash.display.Sprite and a starling.display.Sprite together in the same class I would choose to use the full class path for one, and let the import handle the others.

import flash.display.Sprite
class Example extends Sprite {
public function example():void
{
   var myflashSprite:Sprite = new Sprite();
   var myStarlingSprute:starling.display.Sprite = new starling.display.Sprite();
}
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top