Skip to main content
Participating Frequently
July 1, 2009
Question

So I have an Error 1009: Cannot access a property, blah, blah, blah too.

  • July 1, 2009
  • 1 reply
  • 419 views

I'm assuming the experts here will be able to identify the problem immediately.  I'm sure where the problem is, I just don't know how to address it.  Here's what I'm looking at:

========================================================

bttn2.addEventListener(MouseEvent.CLICK, checkZips);
function checkZips(e:Event):void {
   
    var azipcode:* = new RegExp("(0-9){5}", "g");

    var thebigstring:String = xmlEPG.toXMLString();

//so here is the array of all the zip codes
    var allzipcodes:* = thebigstring.match(azipcode);

for (var i:* = 0;i<allzipcodes.length;i++)
{
if (inputField.text == allzipcodes)
    {responseText.text="Please enter a valid 5-digit zip code.";break;} 
        else 
    {responseText.text = "Yes! You may drop off this package at the later drop-off time.";
        break;}
}

}

========================================================

I'm 99.9% positive that the error is coming from line 8, which is:

    var allzipcodes:* = thebigstring.match(azipcode);

This is the second tab of my app, 3rd frame.  The xml is loaded in frame 1 and that tab works perfectly.  Any clues?

Thanks in advance!!

Brad

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
July 1, 2009

click file/publish settings/flash/ and tick permit debugging.  retest to confirm the line number causing the error.   then use the trace() function to see what you're doing.

Participating Frequently
July 1, 2009

ok here's the output:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at zipFinder2_fla::MainTimeline/checkZips()[zipFinder2_fla.MainTimeline::frame3:8]

oh- by the way, the function of this code is to test a user inputted field to ensure that they have entered a 5 digit zip code, or at least entered 5 digits.

kglad
Community Expert
Community Expert
July 1, 2009

and, what's the trace() function reveal?