3 Replies Latest reply on Feb 25, 2009 1:16 PM by Newsgroup_User

    Canvas ignoring x, y & size properties of child

    BobFromTheYear5K Level 1
      Ok, this is an act of pure desperation. I generally like to figure this stuff out on my own, but I'm stumped on this one. It may be worth noting that I'm fairly new to Flex.... :-)

      I've built a Home Screen for a kiosk app I'm working on. There's a nav bar along the bottom of the screen with some buttons. One of which is supposed to display a custom Options Menu.

      So to get started along this path, I added a Panel to the main Canvas containing the Home Screen and gave it "0,0" coordinates and a size of 100% x 100%. I set the 'z' property to "999", the idea being that it would sit on top of and cover the entire Home Screen.

      However, the x, y, height & width properties are all being completely ignored. The Panel is always drawn centered on the Canvas and is only about 25% as large as it should be. Though oddly it's height & width are correctly proportioned.

      Has anyone encountered anything like this? Is there something obvious I'm just not seeing or am forgetting to do?

      Here's the code if it helps and thanks!

        • 1. Re: Canvas ignoring x, y & size properties of child
          run,ryan! Level 3
          is there a z property for panel?
          • 2. Re: Canvas ignoring x, y & size properties of child
            BobFromTheYear5K Level 1
            I had to actually go and look to be sure, but yes there is. :-)

            And to answer my own question:

            It was that 'z' property that was causing me problems. I'd assumed 'z' functioned in pretty much the same way as the CSS 'z-index'. This, as I've just discovered, is not the case. By setting z=999 I was totally distorting the Panel's size & location by changing the camera perspective from which it was being viewed.

            I was able to get the behavior I wanted by setting z=1.

            • 3. Re: Canvas ignoring x, y & size properties of child
              Level 7

              "BobFromTheYear5K" <webforumsuser@macromedia.com> wrote in message
              news:go40au$f1q$1@forums.macromedia.com...
              > Ok, this is an act of pure desperation. I generally like to figure this
              > stuff
              > out on my own, but I'm stumped on this one. It may be worth noting that
              > I'm
              > fairly new to Flex.... :-)
              >
              > I've built a Home Screen for a kiosk app I'm working on. There's a nav
              > bar
              > along the bottom of the screen with some buttons. One of which is
              > supposed to
              > display a custom Options Menu.
              >
              > So to get started along this path, I added a Panel to the main Canvas
              > containing the Home Screen and gave it "0,0" coordinates and a size of
              > 100% x
              > 100%. I set the 'z' property to "999", the idea being that it would sit
              > on top
              > of and cover the entire Home Screen.
              >
              > However, the x, y, height & width properties are all being completely
              > ignored.
              > The Panel is always drawn centered on the Canvas and is only about 25% as
              > large as it should be. Though oddly it's height & width are correctly
              > proportioned.
              >
              > Has anyone encountered anything like this? Is there something obvious I'm
              > just not seeing or am forgetting to do?
              >
              > Here's the code if it helps and thanks!

              Could you boil it down and provide a more simple example? I don't want to
              mentally construct your component from your code, and because you have used
              custom components, it's not possible to physically copy and paste your code
              and get something that will work.