Awesome, that did it. Thank you. I was having some trouble before, because even though the sprite is #6 in the cast list, it's somehow sprite(1). Does that number just come from the amount of sprites available in the entire cast instead of every cast member?
I ran into a different problem now, though. I had a script to open a file, and that worked perfectly. After solving the problem with the textInput, though, I went back to the this other script because I wanted to get the file name of the .w3d file separated from the entire path. Here's the script:
---------------------------------
on mouseUp
global modelFileName
global newModelFileName
tmpFileObj = new xtra("fileio")
modelFileName = tmpFileObj.displayOpen() -- select a File
if (modelFileName = "") then
-- user cancled - there is no File selected
-- TODO: Display a message to the user
nothing -- to do
else
-- ok - tempFileName is a file path
-- TODO: What if the user picks a file that is not a .w3d file????
-- TODO: -- Figure out how to tell if a file is a .w3d file
-- TODO: -- Test the file to make sure it is a .w3d file
-- TODO: -- Display a message to the user if it is not
-- Load the 3d model into cast member #1
member(1).importFileInto(modelFileName)
-- Loading the model from a file sets the cast member name
-- to the file name, so reset it. Other scripts depend on the
-- cast member name being "3d".
member(1).name = "3d"
newModelFileName = ""
currCount = length(modelFileName)
currChar = ""
repeat while currCount <> 0
currChar = chars(modelFileName, currCount, currCount)
if currChar = "." then
newModelFileName = ""
currCount = currCount-1
else if currChar = "\" then
currCount = 0
else
newModelFileName = currChar & newModelFileName
currCount = currCount-1
end if
end repeat
end if
end
------------------------
The repeat while section is the new addition. The problem is that even though this worked perfectly before, and up through most of the writing of the string manipulation, it won't work now. Just as I finished up the repeat while loop, I tried running the movie and opening a file. It's like Director inserted its own break at the " tmpFileObj = new xtra("fileio")" line. Whenever I hit this button, the debug window comes up with the arrow marking this line like I inserted a break, and then when I tell it to continue I get the error:
"Script error: Script cast member not found
tmpFileObj=new xtra("fileio")"
The other thing is that if I open a new movie, place a button in it, and copy and paste this exact script to the button, it works perfectly. Even the string manipulation works. I tried completely rebuilding the file by moving every cast member to a new file, but the same problem occured once I got it set up.
Any ideas would be amazing.
Thanks again,
Anthony