I have searched the web and I can't find an answer to my problem. I'm building an air app that reads txt files and displays them in the air app but for a strange reason I get 2 errors on the same line.
errors:
-1067: Implicit coercion of a value of type void to an unrelated type Function.
-1067: Implicit coercion of a value of type Class to an unrelated type flash.events:Event.
The code:
public function init():void {
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
}
public function txtReeks1_creationCompleteHandler():void {
var url:String = "Files/Reeks1.txt";
var loadit:URLLoader = new URLLoader();
loadit.addEventListener(Event.COMPLETE, completeHandler(Event));
loadit.load(new URLRequest(url));
}
public function completeHandler(event:Event):void {
txtReeks1.text = event.target.data;
stripLinesFromTextArea(txtReeks1);
}
public function stripLinesFromTextArea(textArea:TextArea):void {
var txt:String = textArea.text;
var re:RegExp = /\n+/g;
txt = txt.replace(re,"");
textArea.text = txt;
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<mx:TabNavigator x="0" y="0" width="100%" height="100%">
<mx:Canvas id="Reeks1" width="100%" height="100%" label="Reeks1">
<mx:TextArea id="txtReeks1" x="0" y="0" width="100%" height="100%"
creationComplete="txtReeks1_creationCompleteHandler()"
fontFamily="Lucida Console" fontSize="20"/>
</mx:Canvas>
<mx:Canvas id="Reeks2" width="100%" height="100%" label="Reeks2">
</mx:Canvas>
<mx:Canvas id="Reeks3" width="100%" height="100%" label="Reeks3">
</mx:Canvas>
</mx:TabNavigator>
</mx:WindowedApplication>
I hope anybody can help me because I am searching the last 2 days for an answer