5 Replies Latest reply on Mar 3, 2009 4:26 PM by kglad

    Need help with a Complicated listener

    W_Bell Level 1
      I would like to use the same listener but it won't change the text when I change to a new List.

      The text is only the ADDITIONAL TEXT I ADD (only the bottom portion of code).
      Not sure how to best approach this. If I should remove the litener and add it again each time.
      (Which I have tried and it won't seem to do it)
        • 1. Re: Need help with a Complicated listener
          kglad Adobe Community Professional & MVP
          if it's a different list instance, it will need its own addEventListener statement (defined no sooner than the frame where the list is instantiated), though it can use the same listener object.
          • 2. Need help with a Complicated listener
            W_Bell Level 1
            It's the same List instance. It uses a Load List Method to update the XML List's file.
            The name stay's the same. Only the content changes. Anyway's even then it still uses a List ID count
            that also does not change since it is only a Linear sequence. There is no reason to use a new Listener.

            Even then, why wuld I not have to remove the listener first before re-applying it?
            The Title and Description stuff works fine using the same Listener, It is the dynamic
            content that is the problem here.

            It just seems to keep the first assignment of dynamic text from the second portion of code and will not refresh it.
            If I apply it as a new listener object it still keeps the first batch of text from the second portion of the code:

            if (objEvt.target.id == 1) {//***ADD List Item and More Text***
            _root.NoteBox.myList_item.text = "List Item: 01";//Item 1 Number
            _root.UserNotes.text = "A BUNCH OF TEXT 1 GOES HERE";
            }


            If that's the case then I may as well use another dynamic text feild for each one and I have many.
            Hmm, this is not what I want, there must be a way to update this listener to refresh the content of the new list.
            • 3. Re: Need help with a Complicated listener
              kglad Adobe Community Professional & MVP
              if it's the same instance, you don't need a new listener.
              1 person found this helpful
              • 4. Need help with a Complicated listener
                W_Bell Level 1
                It's the same list and the same textArea. Only it loads a new XML file from another Layer KeyFrame and the dynamic text won't update.

                I see what is going on here now, I can filter the Listener with a variable "if" and then cancel the var that last applied until it returns to hat area. This seems to work and will let me use only the 2nd portion of the Listeners which is also good because it stills runs the top portion of the original Listener. This will be easier to manage although it is still al little bit overkill with variables for each catagory. I am thinking if I can just assign the "if" var = new var then it may save me cancelling each var everytime I go anywhere but then again, that won' due as it 's becomes a padoras box wthout control. I'll just cancell as I go and see how things progress through the first 6 catagories.

                I will update the results once applied.

                Thanks Kglad for pushing me along the way again.
                • 5. Re: Need help with a Complicated listener
                  kglad Adobe Community Professional & MVP
                  you're welcome.