3 Replies Latest reply on Oct 27, 2010 12:14 AM by Kapil Waghe

    Error: Alert

    Kapil Waghe

      Hi,

       

      In my application when I tries to show a message box, it will raise an error.

       

       

      Error:

      TypeError: Error #1009: Cannot access a property or method of a null object reference.
          at mx.controls::Alert$/show()

       

      Please help me to come out from this headache.

       

      Any help would be appreciated.

       

      Thanks

        • 1. Re: Error: Alert
          Frank Stokes-Guinan Adobe Employee

          What does your code look like that calls show()?  Are you passing in any null values for either the 'text' or 'title' parameters?  If so, try passing empty strings instead.

          • 2. Re: Error: Alert
            Kapil Waghe Level 1

            Here is my code:

            <?xml version="1.0" encoding="utf-8"?>
            <mx:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                                    xmlns:s="library://ns.adobe.com/flex/spark"
                                    xmlns:mx="library://ns.adobe.com/flex/mx"
                                       xmlns:local="*"
                                       chromeColor="0xD8E1E9"
                                       backgroundColor="0xE6E6FA"
                                    layout="absolute"
                                       windowComplete="windowedapplication1_windowCompleteHandler(event)"
                                    width="1416" height="688">
                <fx:Script>
                    <![CDATA[
                        import mx.controls.Alert;
                        import mx.events.AIREvent;
                       
                        import myClasses.*;
                        <script src="AIRAliases.js" />
                        import flash.display.Loader;
                        import flash.display.Sprite;
                        import flash.events.*;
                        import flash.html.HTMLLoader;
                        import flash.net.FileReference;
                        import flash.net.URLRequest;
                        import flash.net.navigateToURL;
                        import flashx.textLayout.utils.CharacterUtil;
                       
                        import mx.controls.HTML;
                        import mx.controls.Text;
                        import mx.events.FlexEvent;
                        import mx.events.Request;
                        import mx.graphics.Stroke;
                        import mx.utils.StringUtil;
                        import mx.utils.URLUtil;
                                   
                        private var myHTML:String;
                        private var op:String;
                       
                        [Bindable]
                        public var myURLArr:Array = new Array();
                       
                        [Bindable]
                        public var myPRArr:Array= new Array("0","1","2","3","4","5","6","7","8","9");
                       
                        //Class Variables
                        private var OData:OptionsData = new OptionsData();
                        private var loadStyle_obj:Temp = new Temp();
                        private var tc:Test =  new Test();
                        private var sg:SearchGoogle = new SearchGoogle();

             

                        private function testIt():void
                        {
                            Alert.show("OK","Message");
                        }

             

                    ]]>
                </fx:Script>

             

            <s:Button id="btnTest1" click="testIt()" label="Test Array"  x="892" y="612" height="26"/>

            </mx:WindowedApplication>

             

            I am also using some .AS files.

            • 3. Re: Error: Alert
              Kapil Waghe Level 1

              Hello Frank.

               

               

              Thanks for your valuable time spent for me.

               

              A GOOD news is that, I have solved my problem by self.

               

              Actually I created a object of one application mxml. It was generating a that problem.

               

              Thanks A Lot.