Ok thanks, that helps. I will look into it.

To: flexcoders@yahoogroups.com
From: aha...@adobe.com
Date: Tue, 6 Dec 2011 11:21:55 -0800
Subject: Re: [flexcoders] ArgumentError: Error #2004: One of the parameters is 
invalid@Graphics/drawRect


















 



  


    
      
      
      

This error occurs when a components gets drawn at a really small size and its 
constraints compute out to be invalid.  For example, if you have:



    <s:Rect left=”2” right=”2” />



Once the component containing this rect is only 3 pixels wide, the width will 
be computed as –1 since the left side will be at 2 and right side at 1 and 
(right – left) = -1.



We don’t check for these conditions for performance reasons, and try to get the 
minWidths to defend against it.



In the debugger, you should be able to double-click on the draw() in the stack 
trace then examine properties to determine which rect it is.





On 12/6/11 9:36 AM, "Csomák Gábor" <csom...@gmail.com> wrote:



 

 

 

   



yes, but you trigger it, because the drawing and other visual functions are not 
called instantly, but on every timer tick, and the timer's speed is 24 
ticks/sec by default. so at every tick spark askes every component if the 
visuals have changed, and if so, calls the redraw, and thats where it goes back 
to your code.. 



On Tue, Dec 6, 2011 at 6:30 PM, Philip Smith <loudj...@hotmail.com> wrote:

  

 

 

   



>> it depends on your code. 



The error is happening in the Spark code...



To: flexcoders@yahoogroups.com

From: csom...@gmail.com

Date: Tue, 6 Dec 2011 09:24:20 +0100

Subject: Re: [flexcoders] ArgumentError: Error #2004: One of the parameters is 
invalid@Graphics/drawRect





  

 

 

   

it depends on your code. 

error finding method: comment half of the block. If its still the same error, 
the mistake will be in the other half. if it stopped the error, the error is in 
the commented half. repeat for the half with the error. repeat until you found 
the problem..



the error is because: if you draw something, change a label, etc.. so anything 
with a visual change, it won't change immediately, but every 1/24 second (by 
default) there is a timer event in Flex to apply that changes. So this error 
comes when the program refreshes its view. (you know because of the last row of 
the error:   at flash.utils::Timer/tick(), and goes to flex sdk, not your 
code..) you get very similar error, when you want to addChild() to an Element 
for example..



hope I helped.. 



On Tue, Dec 6, 2011 at 2:24 AM, method_air <loudj...@hotmail.com> wrote:

  

 

 

   This error started appearing, (the stack trace only has information relating 
to flex sdk classes), anyone know how to fix it:



ArgumentError: Error #2004: One of the parameters is invalid.

at flash.display::Graphics/drawRect()

at 
spark.primitives::Rect/draw()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\primitives\Rect.as:463]

at 
spark.primitives.supportClasses::StrokedElement/updateDisplayList()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\primitives\supportClasses\StrokedElement.as:143]

at 
spark.primitives.supportClasses::GraphicElement/http://www.adobe.com/2006/flex/mx/internal::doUpdateDisplayList
 <http://www.adobe.com/2006/flex/mx/internal%3a%3adoUpdateDisplayList> 
()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\primitives\supportClasses\GraphicElement.as:3958]

at 
spark.primitives.supportClasses::GraphicElement/validateDisplayList()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\primitives\supportClasses\GraphicElement.as:3942]

at 
spark.components::Group/validateDisplayList()[E:\dev\4.5.1\frameworks\projects\spark\src\spark\components\Group.as:1087]

at 
mx.managers::LayoutManager/validateDisplayList()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\LayoutManager.as:736]

at 
mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\LayoutManager.as:819]

at 
mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1180]

at flash.utils::Timer/_timerDispatch()

at flash.utils::Timer/tick()





 

   

 





 

    

       

 

   

 



 

   







-- 

Alex Harui

Flex SDK Team

Adobe System, Inc.

http://blogs.adobe.com/aharui







    
     

    
    






                                          

Reply via email to