Goal: Make a slideshow that loads files saved outside the project.
Vocabulary: ct (cleartext), insert, count, pictlist, announce, stopall
The computer can save your designs outside of the project with the click of a button when you teach it how to create new file names automatically.
- Create a text box, name it picture.name, and make it invisible. (Put the eye tool on it to open its dialog box, then click the check next to visible to uncheck it.)
This text box will be used to build each file name when you save your designs. Each file name will begin with the word "design," followed by a number, and then the extension (.png).
- In the save_design procedure, ct means "clear text" and erases the contents of a text box.
- Insert means, "Place the next word (or group of words) into a text box."
- 1 + count pictlist means, "Count how many picture files are in the folder and add 1 to that number." So when the folder has no picture files, the first picture will be named design1.png and then the next will be named design2.png (and so on).
- Savepict picture.name means, "Save a picture file, and use the contents of the picture.name text box to name the picture file."
- Announce makes an announcement box pop up, containing the message inside the brackets.
- If your project is in a folder that already contains graphics files (GIF or JPEG images), then they will become part of your slideshow. So you should save your project in a folder that does not have any graphics files before you start making your designs.
- Make a button named save_design, draw a design, and test your save_design procedure.
- In the see_slideshow procedure, loadpict "design1.png means, "Load the picture file called design1.png."
- Make a button with see_slideshow as instruction and set it to Forever, so the slideshow runs continuously. You can click this button again to stop it, or you can use stopall to stop all processes running in the project.
Try clicking the save_design button after creating each layer of a design, to save a series of pictures of your design being built, layer by layer.
Add more commands in the see_slideshow procedure to include all of your designs in the slideshow.
On Your Own - Project Ideas
Can you change the save_design procedure so that your own name will be automatically in the name of the picture? Can you add a text box for writing the user's name and adapt the save_design procedure to include the contents of that text box?