3 Replies Latest reply on Mar 31, 2009 1:10 PM by FrancoisLionet

    List object not showing

    FrancoisLionet
      Hello,

      I am trying to open a List object in Flex (in an .as source, not in mxml), and the object does not show on the display. Can anyone tell me what I have forgotten? Here is the source :

      // Creates the list
      list=new List();
      list.width=400;
      list.height=300;
      list.dataProvider=array; // Array of strings
      var s:String="0x"+listFontBack.toString(16); // Color of the background
      list.setStyle("opaqueBackground", s);
      list.verticalScrollPolicy=ScrollPolicy.ON;
      planeSprites.addChild(list); // Add to display list (I'm sure it is OK)
      list.x=100;
      list.y=100;
      list.visible=true;
      list.enabled=true;

      It seems to be OK, but it does not show.
      Thanks for your help.

      Francois
        • 1. Re: List object not showing
          Peter Hahmann Level 1
          Francois,

          In first place I would recommend you to place the addChild method at the very end. This may be one problem, but if you don't mind posting the full code, it would help me trying to answer your question.

          Regards,
          Peter
          • 2. Re: List object not showing
            _Natasha_ Level 4
            Francois,
            Do you have any try/catch block around? May be you have any runtime errors.
            Where have you seen style "opaqueBackground" for List? If it's a number you showld put a number there, not string.
            • 3. List object not showing
              FrancoisLionet Level 1
              I have stepped through the code and there is no error generated.
              The source code of my program is far to big to be posted here. I am sure that the plane I to an addchild to is displayed (it is a Sprite, and I have other objects on it, which are displayed). The code I listed here is the code I use to open the List.
              Maybe you could point me to an example that works?

              Thanks, Francois

              PS: opaqueBackground is a style, not defined in the List object itself, but in one of its parent class. Cant remember which one. Anyhow, even if this style is not correct, I should see the strings of text displayed.