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.

⇒ animation ⇐

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.


Member of the Anti Hacker Alliance

Select a language if you need :

Page chargée en 0.001 sec.

Dernière Modification : Mer 29 Avril 2020 10:57
Copyright © 1999-2020 Jean-Paul Molina Tous droits réservés.

to Google