6 Replies Latest reply on Jul 13, 2006 7:30 PM by doug777

    Child Objects don't appear

    doug777 Level 1
      So I have my accordion and have added four VBoxs to it each with a label and all appear correctly.

      Now I have added HBoxs to the first VBox and some Tiles to each HBox.

      Every object reports the correct parent and the correct numChildren.

      I have set heights and widths for the HBox and Tile components, but nothing further appears.

      I have tried setting border colors, background colors, labels, text components with text for the HBox and Tiles, but no matter what I do nothing else appears.

      What essential step have I missed out?

      Doug
        • 1. Re: Child Objects don't appear
          doug777 Level 1
          Finally managed to get some text to appear in the tiles. Now I can see that the problem is the way I've set the styles for the tiles.

          At their initial appearence the tiles should all be identical, so I thought I could do this:

          import mx.styles.StyleManager;
          StyleManager.getStyleDeclaration("Tile").setStyle("height", 150);

          and so on, but the new tiles do not pick up these styles.

          How then do you preset the styles required?

          Doug

          • 2. Re: Child Objects don't appear
            inlineblue Level 1
            I don't know what other styles you're setting, but "height" is not a style, it's a property on each component. You have to set it when you create the component. eg. mytile.height = 150;

            Otherwise, setting styles the way you described works fine for me.
            • 3. Re: Child Objects don't appear
              doug777 Level 1
              Yes you're right, the problem is the heights and widths are set as styles and so don't work.

              I've set them as properties and now they work fine, but I still can't get the Tiles to pick up the styles correctly. As a test I've set cornerRadius to 8, but all the tiles have square corners. On the other hand, I've set borderStyle to outset and this produces a plain gray line all around the tile with a scrollbar inside the bottom.

              StyleManager.getStyleDeclaration("Tile").setStyle("cornerRadius", 8);
              StyleManager.getStyleDeclaration("Tile").setStyle("borderStyle", "outset");

              All the tiles are created after this line.

              I am testing to see what strange effects are produced by the other styles.

              Doug
              • 4. Re: Child Objects don't appear
                doug777 Level 1
                Okay the scrollbar was my fault, but how can I make the outset look more natural?

                And I still don't get rounded corners.

                Doug
                • 5. Re: Child Objects don't appear
                  inlineblue Level 1
                  Is your background white? Then the default outset border might look like a grey line cause the white highlights don't show up. Try setting borderColor to something else. And rounded corners work only when borderStyle="solid".
                  • 6. Re: Child Objects don't appear
                    doug777 Level 1
                    Oh yes you're right. Pity I have to choose between rounded corners and outset. It would have looked best with both.

                    Thanks again for all your help.

                    And now that a lot of the basic stuff is working, I just must say that the results with Flex and AS3 are just totally stunning. Absolutely unbelievable. This is brilliant stuff. Anyone who is designing stuff for the web and not using Flex is missing out on some pure magic.

                    Doug