6 Replies Latest reply on Sep 9, 2009 12:55 AM by elrad screen name

    Long container scrolling wrapped in another long one

    elrad screen name

      Bug issue link: https://bugs.adobe.com/jira/browse/FP-2182

       

      As you can see on previous link i have found a bug on flex 4 when i try to create a long Canvas/Container in another long one.

      In this case the horizontal scrollbar disappears from the middle of its width and when i try to insert some other Canvas/Container child, it disappears too at some coordinates.

      They change according to width modifying. Then if the container canvas is 8000 px long the error will be at x px, on a longer one the error could be at (x + y ) px.

       

      I couldn't solve my problem using many narrower canvas and i couldn't use flex 3, because i need speex and other flex 4 features.

        • 1. Re: Long container scrolling wrapped in another long one
          elrad screen name Level 1

          I noticed that the canvas container width can be at most 4095 px. If wider than this width the horizontal scrollbar disappears and the contained objects aren't correctly displayed.

          • 2. Re: Long container scrolling wrapped in another long one
            elrad screen name Level 1

            I tried to rewrite my component using the new class Group in place of Canvas expecting to solve my problem with Canvas bugs.

            Now the most important one is that the children disappear if the container is longer than 4095 px.

             

            But if you leave the .clipAndEnableScrolling property with its default false value your solve the bugs although the children that have their area out of Group container control will be all visible(!). If you reset it with true value the Canvas bugs will be in Group object too(!!).

             

            Thanks you Adobe for these funny moments!

            And thanks you for your answers too!!

            • 3. Re: Long container scrolling wrapped in another long one
              elrad screen name Level 1

              New update!

              I've written a tiny example to let you show the bug using Group class/object:

               

              <?xml version="1.0" encoding="utf-8"?>
              <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="main()" backgroundGradientColors="[#ffffff,#ffffff]" backgroundColor="#ffffff">
              <mx:Script>
                      <![CDATA[
                              import flash.events.*;
                              import mx.controls.Alert;
                              import mx.containers.Canvas;
                              import mx.core.*;
                              import spark.components.Group;
                              import spark.components.Scroller;

               

                              private var group:Group = new Group();

               

                              private function main() : void {
                                      group.clipAndEnableScrolling = true;
                                      group.width = 32000;
                                      group.height = 300;
                                      this.group.graphics.beginFill(0xff0000);
                                      this.group.graphics.drawRect(0, 0, group.width, group.height);
                                      this.group.graphics.endFill();
                                      this.addElement(group);
                              }
                      ]]>
              </mx:Script>
              </mx:Application>

               

              Bug link: https://bugs.adobe.com/jira/browse/SDK-22823

              Now my problem is to find an another class/object that i can use to create my program.

               

              Will i find it?

              Will Adobe answer me?

              Will i can answer "Yes, my question has been answered"?

              • 4. Re: Long container scrolling wrapped in another long one
                Shongrunden Adobe Employee

                Hi elrad,

                 

                Thanks for filing a bug with your sample code.

                 

                The Group component manages its own DisplayObjects so calling beginFill, drawRect, endFill, etc. are not supported and will likely result in unexpected behavior.

                 

                I reduced your code sample to reproduce the problem without using those calls:

                 

                <s:Application
                    xmlns:fx="http://ns.adobe.com/mxml/2009"
                    xmlns:s="library://ns.adobe.com/flex/spark"
                    xmlns:mx="library://ns.adobe.com/flex/halo"
                    width="600" height="600">

                 

                    <s:Scroller width="500" height="500">
                        <s:Group>
                            <s:Group id="group1" width="20000" height="20000">
                                <s:Rect width="100%" height="100%">
                                    <s:fill><s:SolidColor color="0xFF0000" /></s:fill>
                                </s:Rect>
                            </s:Group>
                        </s:Group>
                    </s:Scroller>

                 

                </s:Application>

                 

                I believe this is running into the Flash Player limit on the maximum size of a component.  I believe that limit is roughly 8192x8192 pixels.  Anything bigger than that size may act unpredictably.

                 

                Do you have a specific use case in mind for where you need such large components?

                • 5. Re: Long container scrolling wrapped in another long one
                  elrad screen name Level 1

                  > I reduced your code sample to reproduce the problem without using those calls

                   

                  But you have written your code using mxml and i have a big program all written in pure actionscript.

                  I couldn't write it in mxml, it's too complex and i need many different classes.

                   

                  > I believe this is running into the Flash Player limit on the maximum size of a component.

                  > I believe that limit is roughly 8192x8192 pixels.

                   

                  In your documentation i found that the 8191x8191 limit is on BitmapData class.

                   

                  > [...] unexpected behavior.

                  > [...] may act unpredictably.

                   

                  Maybe i misunderstand what are you trying to tell me with these your expressions, but do you mean that you don't know what your code/product could do? (!)

                   

                  > Do you have a specific use case in mind for where you need such large components?

                   

                  YES!

                  (...and i couldn't code it in a different way).

                  • 6. Re: Long container scrolling wrapped in another long one
                    elrad screen name Level 1

                    Maybe i found an usefull solution by myself.

                    I tried to use UIComponent as base class for my own and now the objects aren't disappearing anymore.

                     

                    But i hope Adobe will solve these their bugs because UIComponent doesn't have limits on contained ojects visualization and i had to rewrite many part of my code.