15. november 2000 - 10:55Der er
2 kommentarer og 1 løsning
FileIO
Er der nogen der ved, om det er muligt at skrive til HD fra Shockwave uden at skulle benytte en Xtra? FileIO kan så vidt jeg ved, kun benyttes når der eksisterer en Xtra! Jeg er godt klar over, at jeg kan sende til ASP og skrive til DB, men det kunne jo være meget smart, hvis man ikke behøvede at lave alt for meget kode!
du kan bruge set setPref / getPref komandoen. læs selv:
Syntax setPref prefName, prefValue Example Command; writes the string specified by prefValue in the file specified by prefName on the computer’s local disk. The file is a standard text file.
The prefName argument must be a valid file name. To make sure the file name is valid on all platforms, use no more than eight alphanumeric characters for the file name. After the setPref command runs, if the movie is playing in a browser, a folder named Prefs is created in the Plug-In Support folder. The setPref command can write only to that folder. If the movie is playing in a projector or Director, a folder is created in the same folder as the application. The folder receives the name Application Folder, where Application is the name of the application. For example, a projector named BigBand would have a folder named BigBand Folder.
Do not use this command to write to read-only media. Depending on the platform and version of the operating system, you may encounter errors or other problems. This command does not perform any sophisticated manipulation of the string data or its formatting. Any formatting or other manipulation must be performed in conjunction with getPref; the data can then be manipulated in memory and written over the old file via setPref. In a browser, data written by setPref is not private. Any Shockwave movie can read this information and upload it to a server. Confidential information should not be stored using setPref.
Example This handler saves the contents of the field cast member Text Entry in a file named “DayWare settings”:
on mouseUp setPref the text of member ¬ \"Current Preferences\", \"DayWare settings\"
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.