Quantcast
Channel: Adobe Community: Message List - FlexUnit Development
Viewing all articles
Browse latest Browse all 104

Re: flexunit stage null reference

$
0
0

Okay, a few things.

 

If you are using Flex, you don't need to set the visualDisplayRoot. That is for ActionScript only projects.

 

Second, display objects in Flash don't have access to the stage until they are on the display list. So, saying

 

new Image() won't add that item to the display list.

 

I am not sure what Control.initApp() does, but in one of your unit tests, they way you get something on the display list is to use the UIImpersonator:

 

UIImpersonator.addChild( someImage );

 

After that someImage would have access to the stage. However, bigger problem. Unit tests are about isolation and if you components need to get out to the stage or if Control.initApp() somehow adds the item directly to the display list you are going to continue to have different issues as you won't be able to keep things in isolation to test.

 

Hope that clarifies a little bit,

Mike


Viewing all articles
Browse latest Browse all 104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>