[FONT=Calibri][SIZE=3]Okay, so I’m trying to get a button when pressed to display text from an external .txt file (which I’ve done so far), but (1) I want it to only display certain paragraphs (the actual dialogue) of this text and ***(2) ***every time I click the button it should replace the old text with the new (like in any RPG). Now I asked a former lecturer for help and he gave me a link to a website and gave me a hint of what to do, but seeing as I was recently voted #48 on Forbes worst 100 programmers of all time (actually I haven’t’ used AS for 5 years) so I thought someone could explain it to me in a much clearer fashion? Please help. Thank you in advance.[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]PS: My lecturer said: “[/SIZE][/FONT][FONT=Courier New]When you click the button to add text to the textfield but you ewant the previous text to be cleared the first thing you do is empty the box ( myText.text = “”) then fill the box again with your new text…[/FONT]
[FONT=Courier New]MyText.text = whateverYouWant[/FONT][FONT=Calibri][SIZE=3]”[/SIZE][/FONT]
[FONT=Cambria][SIZE=4][COLOR=#4f81bd]My code[/COLOR][/SIZE][/FONT]
[SIZE=3][FONT=Calibri]var Dialogue_txt:TextField = new TextField();[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]var externalReq:URLRequest = new URLRequest(“MySQL script.txt”);[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]var externalLoad:URLLoader = new URLLoader();[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]externalLoad.load(externalReq);[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]externalLoad.addEventListener(Event.COMPLETE, textReady);[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]FastForward_Btn.addEventListener(MouseEvent.CLICK, onClick);[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]Dialogue_txt.x = 92.70 ;[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]Dialogue_txt.y = 46.70;[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]Dialogue_txt.border = false;[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]Dialogue_txt.width = 372.20;[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]Dialogue_txt.height = 220.75;[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]Dialogue_txt.wordWrap = true;[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]function textReady(event:Event):void[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]{[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]Dialogue_txt.text = event.target.data;[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]}[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]function onClick(event:MouseEvent):void[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]{[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]addChild(Dialogue_txt);[/FONT][/SIZE]
[SIZE=3][FONT=Calibri]}[/FONT][/SIZE]