4 Replies Latest reply on Apr 2, 2009 9:30 PM by Newsgroup_User

    Navigation Question

    released87
      Hi,

      I am trying to use the data from my LinkBar XMList Source to control navigation. I am basically storing the String of the clicked item data and trying to convert it o a DisplayObject to use with the ViewStack:

      private function navigation(event:ItemClickEvent):void {
      var selected_string:String= event.item.data;
      var selected_page:DisplayObject= selected_string;
      current_page.selectedChild= selected_page;
      }

      Obviously I cannot assign a String value to the DisplayObject, but I cannot assign the string to the selectedChild of the ViewStack. Is there anyway I can convert the string to a DisplayObject that will reference the Container I switch to using the ViewStack?
        • 1. Re: Navigation Question
          Peter Hahmann
          This should work:
          var selected_string:String= event.item.data;
          var selected_page:DisplayObject= getClassByAlias(selected_string);

          I'm not sure, but I think you'll need to have the package, for instance:
          com.vo.MyClass

          Regrads,
          peter
          • 2. Re: Navigation Question
            released87 Level 1
            Peter,

            Thank you for the response, however I tried that and I got a compiler error. I imported the class without any luck.

            Thank you again,
            Jesse
            • 3. Re: Navigation Question
              Gregory Lafrance Level 6
              What compile error are you getting?
              • 4. Re: Navigation Question
                Level 7

                "released87" <webforumsuser@macromedia.com> wrote in message
                news:gr2oj2$n6d$1@forums.macromedia.com...
                > Hi,
                >
                > I am trying to use the data from my LinkBar XMList Source to control
                > navigation. I am basically storing the String of the clicked item data and
                > trying to convert it o a DisplayObject to use with the ViewStack:
                >
                > private function navigation(event:ItemClickEvent):void {
                > var selected_string:String= event.item.data;
                > var selected_page:DisplayObject= selected_string;
                > current_page.selectedChild= selected_page;
                > }
                >
                > Obviously I cannot assign a String value to the DisplayObject, but I
                > cannot
                > assign the string to the selectedChild of the ViewStack. Is there anyway I
                > can
                > convert the string to a DisplayObject that will reference the Container I
                > switch to using the ViewStack?

                yourViewStack.selectedChild = this[someStringVar];

                HTH;

                Amy