I don't think you have a clear grasp of the way objects work.
PHP Code:
temp.obj = new TStaticVar();
obj.test = "foo";
echo(obj.test); // echoes foo
obj.test = 1;
echo(obj.test); // echoes 1
obj.destroy(); // destroys the object
You can also do it with global names
PHP Code:
temp.obj = new TStaticVar("MyObject");
MyObject.test = "foo";
echo(MyObject.test); // echoes foo
The same works for GUI controls
PHP Code:
new GuiShowImgCtrl("MyGuiImage") {
image = "block.png";
x = 32;
y = 64;
width = 32;
height = 32;
}
then in another script you can call
PHP Code:
MyGuiImage.image = "bcalarmclock.png";
MyGuiImage.x = 16;
or change any other variables, as long as you know the object name; you can also use dynamic object names:
PHP Code:
for (temp.i = 0; i < 5; i ++) { // make 5 images
new GuiShowImgCtrl("MyGuiImage_" @ i) {
image = "block.png";
x = 32 + (i * 33);
y = 64;
width = 32;
height = 32;
}
}
then you could do something like this:
PHP Code:
MyGuiImage_0.image = "bcalarmclock.png";
which would change only the first image's image. If you wanted to change all the images, you could do:
PHP Code:
for (temp.i = 0; i < 5; i ++) {
(@ "MyGuiImage_" @ i).image = "bcalarmclock.png";
}
However, in your case, I don't think you will need to use dynamic objects. I think you mistakenly used them in your initial post, though I could be wrong.