[LEFT][FONT=Fixedsys][SIZE=3]Hi[/SIZE][/FONT][/LEFT]
[FONT=Fixedsys][SIZE=3]This is the script that I use to load data from 2 txt files to a dynamic text:[/SIZE][/FONT]
[LEFT][FONT=Times New Roman][SIZE=3]myData = new LoadVars ()[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]myData.onLoad = function () {[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]myText.html = “true”[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]myText.htmlText = this.var1[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]}[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]btn1.onRelease = function () {[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]myData.load(“file1.txt”)[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]}[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]btn2.onRelease = function () {[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]myData.load(“file2.txt”)[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]}[/SIZE][/FONT][/LEFT]
[FONT=Fixedsys][SIZE=3]How to make btn2 load var2 from the txt file1, I know that I can make it if I attached a script on each button, but this is not what I want to do . [/SIZE][/FONT]
[FONT=Fixedsys][SIZE=3]can I create a function that call the specific peace of data relating to the btn name from one txt file ?[/SIZE][/FONT]
[FONT=Fixedsys][SIZE=3]so btn1 call var1 from txtfile1, btn2 call var2 from the same txt file1 and so on …? [/SIZE][/FONT]
[FONT=Fixedsys][SIZE=3]i tried to make like this :[/SIZE][/FONT]
[FONT=Fixedsys][SIZE=3]
[FONT=Times New Roman][SIZE=3]btn2.onRelease = function () {[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]myData.load(“file1.txt”)[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]myText.htmlText = this.var2[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]}[/SIZE][/FONT]
but it didn’t work .
i hope that you can help me .
[/SIZE][/FONT]
[FONT=Fixedsys][SIZE=3]Thank you for your help in advance.[/SIZE][/FONT]