3 Replies Latest reply on Mar 2, 2009 1:56 PM by JeffryHouser

    Resizing Flexbook Component at Runtime

    CenturyMan1979
      I downloaded the Flexbook component online and have been messing around with it for a few days but still can't find out how to get this thing to resize during runtime. I did get it set up to size when Initializing the component by using the following code attached to this message. This is using embeded assets for the book. You can see my method I have been trying by looking at the resizeBook function. The resize does work but after a few resizes then things get slow or errors appear. So if someone that has done this can give me a few pointers on where I need to look or if anyone has any suggestions I would love to here it.

        • 1. Re: Resizing Flexbook Component at Runtime
          JeffryHouser Level 4
          Without drilling down to your code; this is conceptually how I'd approach it:

          1) Create a new component that extends Flexbook
          2) Overwrite the height and width properties to trigger an invalidatePropertes / invalidateSize invalidateDispayList . Also add variables (usually private) named "_heightChanged" or "_WidthChanged"
          3) in the commitProperties / measure / updateDisplayList check the "changed" variables and perform actions to do the resizing. You'll have to do some digging in the FlexBook code to figure it out what needs changing.
          • 2. Resizing Flexbook Component at Runtime
            CenturyMan1979 Level 2
            quote:

            Originally posted by: JeffHouser
            Without drilling down to your code; this is conceptually how I'd approach it:

            1) Create a new component that extends Flexbook
            2) Overwrite the height and width properties to trigger an invalidatePropertes / invalidateSize invalidateDispayList . Also add variables (usually private) named "_heightChanged" or "_WidthChanged"
            3) in the commitProperties / measure / updateDisplayList check the "changed" variables and perform actions to do the resizing. You'll have to do some digging in the FlexBook code to figure it out what needs changing.


            The digging in the Flexbook code to see what needs to be changed is the issue I am having. I have been working on a new resize function which seems to be getting closer but still has weird results where the book appears to have shrunk when you rollover certain areas but there is residual images of the larger version showing.

            • 3. Re: Resizing Flexbook Component at Runtime
              JeffryHouser Level 4
              I wouldn't write my own re-size function; I'd try to get this resize working by overriding the Flex Component LifeCycle methods (updateDisplayList, commitProperties, measure )

              I understand that it can be problematic drilling down into someone else's code, though. I don't have much of an answer beyond that though.