Hi. I have a flex project with a mx:Text. i have a class that is loaded at the beginning of my project and i want this class to enter text in that text element. the id of the text element is "messagePanel" but when i try to type messagePanel.text i get 'Access of undefined property'. how do i resolve the issue?
example
general.FMS3Connect class connects to an adobe flash media server, when it completes connecting i want it to display the even info code of the connection inside a mx:Box, it's id is messageBox.
on my main mxml file i have the following:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientColors="[0xFFFFFF,0xAAAAAA]"
xmlns:local="*">
<mx:Script>
<![CDATA[
import general.FMS3Connect;
private var conn:FMS3Connect= new FMS3Connect();
]]>
</mx:Script>
<mx:Text id="messageBox" color="black" text="trying to connect to server..." creationComplete="conn.connect()" >
</mx:Application>
the function connect() for now just has "messageBox.text='test'";
when i execute the application i get the following error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
how do i resolve the issue?
thanks!