Hi,
The locking and unlocking of objects is achieved using .access.
imageField1.access = "readOnly"; // locked
imagefield1.access = "open"; // unlocked
Now the imageField has the inbuilt clickability for adding images to the object. You could try the following in the click event of the imageField, but you may need to move it around to a different event - it just depends on when the image is loaded.
var nButton = app.alert({
cMsg: "Warning: You are about to lock this image. \n\nAre you sure that this is the correct image?",
cTitle: "Uploading images",
nIcon: 1, nType: 2
});
if (nButton == 4)
{
this.access = "readOnly";
}
else
{
this.access = "open";
}
The response from the app.alert is assigned to the nButton variable and then the if statement is checking which button the user selected in the dialogue - 'Yes' or 'No'.
Hope that helps,
Niall