I want to change a property of the TextArea from my RichTextEditor. So i tried to do this:
textEditor.textArea.setStyle("backgroundColor", 0xff0000);
but i got an error message at run time. I am using Flash Player 10 and i got this error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at webSiteBuilder/private:main/paginaObjectTextDoubleClickHandler()[D:\lucru\Flex\webSiteBuilder\websiteBuilder\src\include\panouStanga\element.as:27]
“Cannot access a property or method of a null object” ??? ok so i said then:
mx.controls.Alert.show(String(textEditor.textArea));
And, yes, it said : “null” … why is this? in the Flex Help at the RichTextEditor’s class we have this:
To access one of the subcontrols, you can use syntax similar to the following: ***
*** myRTE.toolBar2.setStyle(“backgroundColor”, 0xCC6633);
So…what am i doing wrong?
By the way: i found this link: http://blog.flexexamples.com/2008/08/25/setting-the-background-color-of-the-richtexteditor-text-area-in-flex/
Still why doesn’t it work for me?