3 Replies Latest reply on Aug 18, 2008 8:52 AM by Newsgroup_User

    Render event doesn't fire until mouse event

    sg1959
      Hello all, I'm brand new to Flex, and trying to implement a pretty standard click-to-enlarge deal. I got all the basic stuff working fine, but now I want to resize the TitleWindow after it's popped up, based on the image size. A forum search tipped me off to using a render listener to wait for the image to be drawn in order to get the size, but the render listener won't fire until I mouse over the window's close button.

      IOW I want setSize() to be executed when the image is done rendering, but it doesn't run until I roll over the close button. I've also tried a progress listener, with the same results, and messed with the listener priorities etc., so I suppose the close button listener is somehow blocking other events, but I can't quite find the reason. Thanks for any advice.

      Steve
        • 1. Re: Render event doesn't fire until mouse event
          Level 7

          "sg1959" <webforumsuser@macromedia.com> wrote in message
          news:g89ptf$ina$1@forums.macromedia.com...
          > Hello all, I'm brand new to Flex, and trying to implement a pretty
          > standard
          > click-to-enlarge deal. I got all the basic stuff working fine, but now I
          > want
          > to resize the TitleWindow after it's popped up, based on the image size. A
          > forum search tipped me off to using a render listener to wait for the
          > image to
          > be drawn in order to get the size, but the render listener won't fire
          > until I
          > mouse over the window's close button.
          >
          > IOW I want setSize() to be executed when the image is done rendering, but
          > it
          > doesn't run until I roll over the close button. I've also tried a progress
          > listener, with the same results, and messed with the listener priorities
          > etc.,
          > so I suppose the close button listener is somehow blocking other events,
          > but I
          > can't quite find the reason. Thanks for any advice.

          Just set the minimum width and height on the TitleWindow instead of its
          actual width and height.


          • 2. Re: Render event doesn't fire until mouse event
            sg1959 Level 1
            quote:

            Originally posted by: Newsgroup User
            Just set the minimum width and height on the TitleWindow instead of its
            actual width and height.



            Ah, so simple. Thank you!
            • 3. Re: Render event doesn't fire until mouse event
              Level 7

              "sg1959" <webforumsuser@macromedia.com> wrote in message
              news:g8c5ca$7tv$1@forums.macromedia.com...
              >
              quote:

              Originally posted by: Newsgroup User
              > Just set the minimum width and height on the TitleWindow instead of its
              > actual width and height.
              >

              >
              > Ah, so simple. Thank you!

              You're welcome :-)