JHaywood
06-20-2008, 12:19 AM
What's the best way to create a self-updating CA? I want to add one to a scene so that when it's opened stuff happens. But I want it to be updatable so that if the file containing the CA is changed, it will get updated on file load.
So let's say file, "testCA.ms" contains the following, and that this CA is applied to the rootNode of a scene.
ca = attributes testCA
(
on load do
(
fileIn "testCA.ms"
print "doing something"
)
)
So now whenever I open the file it prints "doing something" in the listener. That's all good. But now I want to change the "testCA.ms" file to this...
ca = attributes testCA
(
on load do
(
fileIn "testCA.ms"
print "doing something else"
)
)
I save the CA file and reload the scene. It still prints "doing something" on open, but now the CA on the rootNode has been updated. If I then save the file and open it again it now prints "doing something else" as it should because of the updated CA.
The problem is that I want the CA to not only update on file open, but execute the updated version and not the have to wait until the file is save and reloaded to use the new definition.
So let's say file, "testCA.ms" contains the following, and that this CA is applied to the rootNode of a scene.
ca = attributes testCA
(
on load do
(
fileIn "testCA.ms"
print "doing something"
)
)
So now whenever I open the file it prints "doing something" in the listener. That's all good. But now I want to change the "testCA.ms" file to this...
ca = attributes testCA
(
on load do
(
fileIn "testCA.ms"
print "doing something else"
)
)
I save the CA file and reload the scene. It still prints "doing something" on open, but now the CA on the rootNode has been updated. If I then save the file and open it again it now prints "doing something else" as it should because of the updated CA.
The problem is that I want the CA to not only update on file open, but execute the updated version and not the have to wait until the file is save and reloaded to use the new definition.
