0 Replies Latest reply on Jan 10, 2011 6:12 AM by Kywhod

    get the relatedObject of a tabbar event

    Kywhod

      Hi all,

       

      I Have a tabbar which dataprovider is linked to a viewstack.

      The viewstack contain some custom component of the following form :

       

      <s:NavigatorContent xmlns:fx="http://ns.adobe.com/mxml/2009"

      xmlns:s="library://ns.adobe.com/flex/spark"

      xmlns:mx="library://ns.adobe.com/flex/mx"

      implements="views.editors.IEditor">

      As you can see it implements IEditor

       

       

      And this what i'm trying to do :

       

      private function tabbarChangeHandler(event:IndexChangeEvent):void {

      var item:NavigatorContent = event.target.selectedItem; // This works

      var it:IEditor = event.target.selectedItem; as IEditor; // This doesn't work

      objectBrowser.tabbarChange(item.label);

      it.launch();

      }

      var it isn't of the type IEditor I mean I can't access any variable or function.

      I tried also tabbar.selectedItem or viewstack.selectedChild but same thing ...

       

       

      Thanks for any help,

      Ky