2

I'm transitioning a flex 3 application to flex 4. There was AS code in the flex 3 app that worked:

var myCurrentSelectedChild:String = myViewStack.selectedChild.id;

Now, in flash builder and flex 4.5, it throws the error - "-1119: Access of possibly undefined property id through a reference with static type mx.core:INavigatorContent". I'm trying to get the viewStack's selected child's id.

ketan
  • 19,129
  • 42
  • 60
  • 98
Steven
  • 1,949
  • 2
  • 17
  • 30

3 Answers3

3

Try to cast the myViewStack.selectedChild to some UI Object type. core:INavigatorContent has no ID property.

So use:

(myViewStack.selectedChild as Container).id
Adrian Pirvulescu
  • 4,308
  • 3
  • 30
  • 47
1

The following links may be helpful:

Cosmin
  • 21,216
  • 5
  • 45
  • 60
josef
  • 11
  • 1
0
var myCurrentSelectedChild:String = myViewStack.selectedChild.getChildAt(0).id;
Florian F
  • 8,822
  • 4
  • 37
  • 50