Hi. I have an app where the user can select a note and opt to "pop"
the note into a child window that will float beside the main window. I
can create the window fine, and I can pass it its title. However, when
I try to pass the title and contents of the note, I get a "null object
reference" error.
The relevant code in the main file is this:
public var theNote:noteWindow;
//********** popup selected note
public function floatingNote():void{
var theNote:noteWindow = new noteWindow();
theNote.title = "Floating note";
//theNote.noteContents.text="contents";
//theNote.noteTitle.text = "title";
theNote.maximizable = false;
theNote.open();
}
if don't comment out those two lines, the code runs fine. At the
moment they are trying to pass static values; but eventually they will
take the relevant values from the selected item in the Notes datagrid.
The noteWindow component looks like this:
<?xml version="1.0" encoding="utf-8"?>
<mx:Window xmlns:mx="http://www.adobe.com/2006/mxml" width="300"
height="400" layout="absolute" backgroundColor="#FFFFFF"
transparent="false" systemChrome="standard">
<mx:TextArea x="10" y="10" width="278" height="62" id="noteTitle"
wordWrap="true" editable="false" fontWeight="bold" fontSize="12"
borderStyle="none" text="title"/>
<mx:TextArea x="10" y="89" width="278" height="289" id="noteContents"
wordWrap="true" editable="false" borderStyle="solid" fontSize="12"
text="The note"/>
</mx:Window>
Anybody see what I am missing?
Thanks in advance.
andrew