Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

assign a value for Object type??

Status
Not open for further replies.

marks416

IS-IT--Management
Oct 24, 2007
39
0
0
CA
Hi,

I try to assign a value to Object like the following code.

<mx:Script>
<![CDATA[

public var emailData:Object;

public function sendEmaildata():void {

emailData.email="abc@hotmail.com";

}

]]>
</mx:Script>

But I get a error like this " Cannot access a property or method of a null object reference."

I confuse how to set a value to Object,Please help me.

Thanks

M
 
Your problem is that emailData is null.

Before the line "emailData.email="abc@hotmail.com";", initialize emailData like this:
emailData = new Object();



-------------------------
Matt Grande
C# Master.
Ruby on Rails Admirer.
ActionScript Student.
JavaScript Hate-Monger.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top