2
votes

In my flex application, I have a custom TitleWindow that pops up in modal fashion. When I resize the browser window, I get this warning:

Warning: Filter will not render. The DisplayObject’s filtered dimensions (1286, 107374879) are too large to be drawn.

Clearly, I have nothing set with a height of 107374879.

After that, any time I mouse over anything in the Flash Player (v. 10), the CPU churns at 100%. When I close the TitleWindow, the problem subsides. Sadly, the warning doesn't seem to indicate which DisplayObject object is too large to draw. I've tried attaching explicit height/widths to the TitleWindow and the components within, but still no luck.

[Edit]

The plot thickens: I found that the problem only occures when I set the PopUpManager's createPopUp modal parameter to "true." I don't see the behavior when modal is set to "false." It's failing while applying the graying filter to other components that comes from being modal. Any ideas how I can track down the one object that has not been initialized but is being filter during the modal phase?

Thanks for reading.

5
Do you have a simple reproducible test case for this? Also you might want to file a bug: bugs.adobe.comJames Ward

5 Answers

3
votes

This might not be the case in your application, but I have come across similar cases where a height or width of an object has been set to some unreasonable big number as the result of misuse of an unsigned integer in calculations for positioning, height or width.

Schematic code for such a scenario could be like this:

var offset:uint = 30;
var position:uint = txt.textHeight - offset;
divider.y = position;

The code wrongfully assumes that txt.textHeight will always be bigger than 30. If it is not, txt.textHeight - offset will be a negative number, that when stored in an uint will instead become a very large number.

Let's say for example that the text in txt, presumed to be a long multiline text, instead is a single line that is 20 pixels heigh. The result will then be -10, and when stored in the uint var position, the value of position will be 4294967286.

The above is crappy code, an example, but in a real world situation the uint problem can occur in some more complex way, that might be harder to spot right away. I guess it is seldom a good idea to use an unsigned integer for stuff like x and y positions, that can have negative values.

3
votes

You could write some code to recursively step down the hierarchy of DisplayObjectContainer and DisplayObject objects and check for the large height.

Should be pretty simple to write. A function something like this should do the trick:

function RecurseDisplayObjects(DisplayObject obj):void
{
    //check for height and do a trace() or whatever here

    if(obj is DisplayObjectContainer)
    {
        var container:DisplayObjectContainer = obj as DisplayObjectContainer;
        for(var i:int=0; i<container.numChildren; i++)
        {
            RecurseDisplayObjects(container.getChildAt(i);
        }
    }
}

You would need to start this off by passing it the top level DisplayObject in your application. (possibly obtained with DisplayObject.root)

The other option you have is to get the Flex framework source and modify it to give you a more meaningful error.

1
votes

The problem is probably not in your TitleWindow, but in objects below it. The filter failing to render is probably the blur filter flash applies over everything below the modal dialog. If one of the objects on the stage is too big to apply blur on it in real time, you get the error you mentioned.

I solved that problem by applying a mask to the object below the titlewindow, set to the size of the stage. That will probably solve your problem but you should definitely look into why something gets to that size, doesn't sound healthy. :-)

0
votes

Sadly I have no idea, but we're trying to track down a similar issue in ours. Maybe this will help?

http://www.mail-archive.com/[email protected]/msg48091.html

0
votes

I had a similar issue, tracked it down to an alpha filter applied to an object scaled to -0.23453422334. Once I rounded the scale to 2 significant digits everything worked fine. A difficult error to track down however.