Im storing the animation sequence in an array, but if I do it like this:
- Code: Select all
for (var i=imageCount-1;i>=0;i--) {
imageAnimSeq[i] = new TImage(WeBuilder);
imageAnimSeq[i].Parent = parentObj; // This line gives the error
imageAnimSeq[i].Picture.LoadFromFile(RegexReplace(imageFile, "\\.(?=[^.]*$)", _t(i) + ".", true));
imageAnimSeq[i].Visible = false;
imageAnimSeq[i].SetBounds(posx, posy, imageWidth, imageHeight);
}
I get an error "Compile error: Access violation at address 00493D19 in module 'webuild.exe'. Read of address 00000030"
But if I first store the TImage in a normal variable, and then copy that into the array like this. Then it works.
- Code: Select all
for (var i=imageCount-1;i>=0;i--) {
img = new TImage(WeBuilder);
img.Parent = parentObj;
img.Picture.LoadFromFile(RegexReplace(imageFile, "\\.(?=[^.]*$)", _t(i) + ".", true));
img.Visible = false;
img.SetBounds(posx, posy, imageWidth, imageHeight);
imageAnimSeq[i] = img;
}
Is this a bug or just one of the FastScript quirks?