2 Replies Latest reply on Nov 13, 2009 1:20 AM by fisad

    How to Restric custom component to container boundary

    fisad

      Hey:

       

      I have a problem width a graphics component, when I use the component (like coverflow) in a flex application how unique member, the component is displayed to application boundary but, when I use the same component inside the one container (like canvas or box), the component is displayed outside the container.

       

      Correct Example: The component was loaded from flex application inside another flex application, all is ok, the component is displayed inside the container boundary, the container is a canvas where was the swf loaded.

      Image1.png

       

      Problem Example: The component was loaded from a flex application inside a module loader, the component is displayed inside the module container but outside the container boundary, All worng.

       

      Image2.png

       

      Any suggestion will be great.

       

      Thanks in advance,

       

      Fisad.

        • 1. Re: How to Restric custom component to container boundary
          Flex harUI Adobe Employee

          Which version of Flex?  A custom component must report its correct height/width otherwise the container won't know to clip it.  In Flex 4 with Spark, container clipping is not on by default and you have to use a Scroller or set clipAndEnableScrollbars

           

          Alex Harui

          Flex SDK Developer

          Adobe Systems Inc.

          Blog: http://blogs.adobe.com/aharui

          • 2. Re: How to Restric custom component to container boundary
            fisad Level 1

            Thanks for your suggestion.

             

            The version of flex is 3 with the last sdk release.

             

            I solved the problem utilizing a mask. The coverflow components calculated the final width based in the stage witdh, is impossible set the height at the beginnig, the component layout is dynamic and I make a application layout than it resized with the browser events.

             

            The solution was: create a Shape element and add to the container before to create the component, set resize event of coverflow to function what fill the shape transparent and set width and height of shape to coverflow measure. This restric the grow of custom component to shape form.

             

            Thanks for your help.