This content has been marked as final. Show 21 replies
> 1) I wonder if there is any way to make two MIAW to appear on top of the stage
> window in a full screen mode. Currently my two MIAW disappear in a full screen
> mode but work fine when i uncheck this option
If you make your 2 windows #tool type, they will float on top
> 2) I have the following script that write some data on the prefs.ini file
> baWriteIni("Performance","Time",""&the timer/60&"", the moviePath &
> baWriteIni("Question_asked","Questions",""&questions&"", the moviePath&
> I would like to expand this script to write the above data on a prefs.ini that
> will be unique for everytime that my application will run. For example, when
> the app rus for the first time to write the data on the prefs1.ini, the second
> time on the prefs2.ini, the third time on the prefs3.ini and so on.
You will need to scan the folder you are placing you ini files in, grab
the filename of the last file, make an integer of the last numerical
part of it, add 1 to this and create a new prefs file.
However, this is a lot of hoops to jump through. If your file was a
list, saved with vList, you could use a single file and append to the
list every time and write it back out to disk when appropriate. The
read/write functions to an external file are free, but you won't be able
to read it in a text editor.
Or you could purchase a copy of Buddy File and do much the same thing
with baReadList() and baWriteList()
and if you want to go with the new file each time in a numerical fashion, then you can go with the budapi command bafileexists to have the movie see if the file exists, and if it does, add one to the file name and try again and repeat until it finds a blank one. Also, you could set a pref that contains the last number used in the ini file (as in, in the same command that writes the ini, you could make it write the number that's attached to the prefs.ini) That way, if you want to write a new INI, you simply need read the pref file that contains the number and add one to it and create the ini (and then put that number in the pref mentioned before) I hope that makes sense... If not, I can make you a sample movie if you need me to.
<<If not, I can make you a sample movie if you need me to.>>
A demo movie would be great to demonstrate what you are saying.
While waiting for the demo movie may i ask if anyone knows why my MIAWs disappear in a full screen mode of my application? The solution that Sean Wilson suggested (to make them tool) doesn't seem to work. Any ideas will be appriciated
Which platform are you developing on and which Director version are you
I am using MX2004 on Windows XP Profesional
> I am using MX2004 on Windows XP Profesional
Are you testing as a projector? If so, I don't understand why your #tool
windows don't stay on top of your projector. Are you perhaps using Buddy
API to force the stage window on top?
Is your stage window of type #tool too? If so, try making it a #document
Yes, by making the MIAWs as tool and the stage as document works fine. Many thanks Sean. Now what about the first part of my question? JohnathonS offered to create a demo movie demonstrating his idea on how to accomplish what i want. Any idea where he may be?
Any ideas on the second part of my problem? Please help
" I have the following script that write some data on the prefs.ini file
baWriteIni("Performance","Time",""&the timer/60&"", the moviePath & "prefs.ini")
baWriteIni("Question_asked","Questions",""&questions&"", the moviePath& "prefs.ini")
I would like to expand this script to write the above data on a prefs.ini that will be unique for everytime that my application will run. For example, when the app rus for the first time to write the data on the prefs1.ini, the second time on the prefs2.ini, the third time on the prefs3.ini and so on. "
> Any ideas on the second part of my problem? Please help
Do you *have* to be able to read them in a text editor, or wil they only
be used by your projector?
If the latter, then it will be much easier to use vList like I suggested
vlXtra = xtra("vList").new(_movie.path & "prefs.ini")
tList = vlXtra.read()
lPrefs = [#performance: the timer/60, #question_asked: questions]
if listP(tList) then
tList = [lPrefs]
OK = vlXtra.write()
if vList_error() <> 0 then
-- error occurred:
alert "Error writing prefs:" &RETURN& vList_errorString()
vlXtra = VOID
I tried your script but it says "OK = vlXtra.write() wrong number of parameters". Any idea wht is wrong?
There must be somethign wrong int eh forum today. I am getting th esame message multiple time!!!
sorry about the wait, I got busy working on another project and didn't get a chance to check in again until now. Here's what I came up with: (Note: The only notable glitch I found is that it may cause a bit of lag after 800 or so login and logouts. Using the prefs one requires you to rely on a prefs file which is lost somewhere in the system when using Director MX2004, so that's the only downside to that. Both files are now included in the rar listed below. Enjoy!)
Your script does not seem to work. IS there anything that i am doing wrong?
Hmm, make sure that Buddy API is included in the projector.. What exactly happens when you try to run the script?
I didn't know that it is working only in a projector mode. It is working fine. I need it for max 32 inis so i guess it would be OK.
Many many thanks
No problem, has your other issue been resolved as well, or are you still looking for a solution to that one?
The issue with the MIAW yes, i converted them into tools and they now work OK in projector mode. Just one quick question about the iniwrite file. You are saying:
"Using the prefs one requires you to rely on a prefs file which is lost somewhere in the system when using Director MX2004,"
What exactly do you mean with that?
Many thanks again
IN Director MX2004 the prefs folder used in the getpref and setpref commands is burried in the user's computer somewhere (Exactly where I'm not sure) where as in older versions of Director the Prefs folder is in the same folder as the projector. It doesn't pose a problem unless the person were to try to copy a program with prefs folders from one system to another (because if they did it would lose the prefs file and overwriting of the ini files might occur)
So as long as the program remains on the initial system that it's placed on, there's no problem with using the getpref setpref version.
Sorry, the dangers of email lingo:
OK = vlXtra.write( tList )