Hi all --
In the following script, the reference to Sony.Project at initialization time succeeds, but when the event handler is called a runtime error results from the attempt to reference Sony.Project. However, if you change the line "theForm.Show" to "theForm.ShowDialog" (which makes the form modal), the reference succeeds.
import System.Windows.Forms;
import Sony.Vegas;
MessageBox.Show(Vegas.Project.FilePath);
var theForm : tmpForm = new tmpForm();
theForm.Show();
class tmpForm extends Form {
function tmpForm() { // constructor
this.Width = 100;
this.Height = 100;
var btnName = new Button();
btnName.Location = new System.Drawing.Point(20,20);
btnName.Text = "See Project Name";
btnName.add_Click(btnNameClickHandler);
this.Controls.Add(btnName);
}
protected function btnNameClickHandler(o: Object, e : System.EventArgs) {
MessageBox.Show(Vegas.Project.FilePath);
}
}
In the following script, the reference to Sony.Project at initialization time succeeds, but when the event handler is called a runtime error results from the attempt to reference Sony.Project. However, if you change the line "theForm.Show" to "theForm.ShowDialog" (which makes the form modal), the reference succeeds.
import System.Windows.Forms;
import Sony.Vegas;
MessageBox.Show(Vegas.Project.FilePath);
var theForm : tmpForm = new tmpForm();
theForm.Show();
class tmpForm extends Form {
function tmpForm() { // constructor
this.Width = 100;
this.Height = 100;
var btnName = new Button();
btnName.Location = new System.Drawing.Point(20,20);
btnName.Text = "See Project Name";
btnName.add_Click(btnNameClickHandler);
this.Controls.Add(btnName);
}
protected function btnNameClickHandler(o: Object, e : System.EventArgs) {
MessageBox.Show(Vegas.Project.FilePath);
}
}