Read-Write Text File


A SwishMax1 tutorial, needed a browser Refresh ( F5 ) to get the content of the text file been displayed.
It sounds like running in frame 10 the reading of the text file was too early.

So let's see the changes I made to this example.

Copying a button.

1 - Reproduce all objects as described in previous example.

2 - Copy and Paste the button Envoyer (Send).
Put it on the right side.
Edit each text, replace text with Lire (Read).
( we 'll see the script further )

PHP Script

... unchanged ...

Text file

... unchanged ...

SwishMax Scripts

In Scene_1 script, we copy the text placed between { } in onFrame(10) and paste it in button Lire (Read) :

on (release) { content.loadVariables("file2write.txt"); }

in replacement of the script we got when button Envoyer (Send) was pasted. Then cut script onFrame(10) of Scene_1

'Et voil', that's it.


Page chargée en 0.001 sec.

Dernière Modification : Jeu 12 Mai 2022 10:33
Copyright © 1999-2022 Jean-Paul Molina Tous droits réservés.


to Google