|
From: WarDemonZ on 15 Apr 2008 19:19 Hey everyone, iv really been having trouble working with File IO, im 99% complete on my project, everything works but it doesnt save to file like i need it to, iv got a test file off deansdirectortutorials.com or something like that, which just has a simple interface allowing u to write to, append, and open a file that gets saved. iv literally copied the code word for word from his (made changes where appropriate) and mine just doesnt work. does anyone know a nice simple method of doing them, i really need to learn how to do it asap. any help you guys could give would be fantastic. also a little less important thing, when entering info in from the code, i want to change the text of a sprite, so i put in sprite(x).member.text = " etc etc, is there a way of doing a 'return' in the code, as in, like hitting the enter key so it puts the remainder of the text on a new line? thanks everyone
From: Dave C on 15 Apr 2008 20:47 What is on Dean's tutorial is about as simple as it gets. If you used that to work with, then you are probably very close to making it work. Can you post your code or give a clue as to where it is failing? To insert a return in a text member: sprite(x).member.text = "This is line 1" & RETURN & "This is line 2" RETURN is a key word that represents a new line character and the ambersand (&) is the string concatentor. WarDemonZ wrote: > Hey everyone, iv really been having trouble working with File IO, im 99% > complete on my project, everything works but it doesnt save to file like i need > it to, iv got a test file off deansdirectortutorials.com or something like > that, which just has a simple interface allowing u to write to, append, and > open a file that gets saved. iv literally copied the code word for word from > his (made changes where appropriate) and mine just doesnt work. does anyone > know a nice simple method of doing them, i really need to learn how to do it > asap. any help you guys could give would be fantastic. > > also a little less important thing, when entering info in from the code, i > want to change the text of a sprite, so i put in sprite(x).member.text = " etc > etc, is there a way of doing a 'return' in the code, as in, like hitting the > enter key so it puts the remainder of the text on a new line? > > thanks everyone >
From: Dave C on 15 Apr 2008 20:58 Summarizing Dean's tutorial, to create a file and save text to it you need to issue the following commands: scribe = new (xtra "FileIO") createFile (scribe, the moviePath&"Multimedia.txt") openFile (scribe, the moviePath&"Multimedia.txt", 0) writeString (scribe, "Exporting text in Director is easy!") closeFile(scribe) scribe=0 Line 1 creates an instance of the FileIO xtra and assigns a reference to it to the variable named scribe Line 2 using the instance created in Line 1 to create a file named "Multimedia.txt" which is created in the same folder that the movie is saved in. Line 3 opens the file for writing Line 4 writes text to the open file Line 5 closes the file Line 6 disposes on the instance created in Line 1
From: rafa on 16 Apr 2008 08:32 Hey WarDemonZ: I am not the greatest in Director, but I ran into a similar problem in a project a few moths ago, it turned out that I forgot to set my "movie script" code. I just wanted to throw that in there...maybe thats what you are missing. global myFile on startMovie() myFile = new(xtra "fileio") end on stopMovie myFile = 0 -- Dispose of the instance end Hope it works!
From: WarDemonZ on 18 Apr 2008 19:58 hey guys, im still having ridiculous troubles with it, i just cant get it to work for the life of my, iv followed the deans tutorial thing down to a tee, but everytime i try to read from the file i just get <void> it does the same when i copied wot u guys have written and when i try to copy the code from the pre built file on the website, any suggestions?
|
Next
|
Last
Pages: 1 2 Prev: AS3 vs Lingo Next: Director Podcast # 40 Posted - A Job, An AdobeExplanation and a Boycott? |