Question

I am trying to implement StageText in and AIR/AS3 app and when I use something like:

private var txtField:StageText = new StageText();
txtField.stage = stage;
txtField.viewPort = new Rectangle(200, 150, 400, 35);

for example I get the error:

1067: Implicit coercion of a value of type starling.display:Stage to an unrelated type flash.display:Stage.

I have no idea why this is happening as I have followed the documentation.

Was it helpful?

Solution

Note the difference between starling.display:Stage and flash.display:Stage - these are different types. Starling uses its own implementation of display list and this often seems to cause some misunderstanding among developers. So, what you really want to assign to txtField.stage is your Starling Stage, not the Flash native one.

OTHER TIPS

Starling has it's own stage, to access the Flash stage use "Starling.current.nativeStage".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top