Cutting Image Control Deletes src file

I’m not sure I understand the reasoning for AS IDE to delete an image from the hard drive when a control is deleted. And I understand even less why it is deleted when I cut the control (as usually a cut is succeeded by a paste).

The real problem comes in when you do paste the image back, as the src still points to the deleted file (and hopefully you kept a copy of it elsewhere as it’s not recycled either).

Which control are you seeing this with? Image?

I tried it again this morning without error at first. But now I know the key that causes the src file to delete. Here’s the process. I’m using a BS4 image, but I’m sure it happens with common control images as well.

  1. Create a new javascript project
  2. On the default form add a BS4 image control
  3. save the project.
  4. add a common controls container to the form
  5. cut the image control from the form
  6. save the project
  7. go to your image folder and notice the image file has been deleted. However, the CUT image control still points to that file.
  8. paste the control back onto the form.
  9. you’ll get the error about the bad source.
  10. paste the control into the container.
  11. no error about the bad src.

It’s the project save that is deleting the files. And why I missed it for so long is that it was the save on deploy that was getting me. I cut an image, started on desktop browser, then pasted the image back.

We’re on it.

Fixed in 8.0.2