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.

 


Si vous aimez le site

 

Select a language if you need :


Page chargée en 0.003 sec.

Dernière Modification : Mer 25 Janvier 2017 8:56
Copyright © 1999-2017 Jean-Paul Molina Tous droits réservés.

to Google