Which line does the null pointer error occur on? 

Not that this is you problem, but I always check for null when casting with 
'as'. 

Sunil

--- In flexcoders@yahoogroups.com, Tom McNeer <tmcn...@...> wrote:
>
> In the function below, I begin by testing to see if a particular object is
> null (the array of ComboBoxes that represent the children of a Repeater,
> which may or may not exist). The element is defined in MXML, though of
> course it may be null.
> 
> But if it *is *null, a null object reference error is thrown. Could someone
> please explain this for me? (SDK 3.5, by the way).
> 
>             public function handleFilterChange():void{
>                 if(filterCombo!=null){
>                     for(var i:int=0;i<filterCombo.length;i++){
>                         for(var j:int=0;j<filterCombo[i].length;j++){
>                             var cb:ComboBox = filterCombo[i][j] as
> ComboBox;
>                             cb.selectedItem=null;
>                         }
>                     }
>                 }
>             }
> 
> -- 
> Thanks,
> 
> Tom
> 
> Tom McNeer
> MediumCool
> http://www.mediumcool.com
> 1735 Johnson Road NE
> Atlanta, GA 30306
> 404.589.0560
>


Reply via email to