PHOTOGRAPHERSONLINEPROOFING.COM

portrait proofing - www.photographersonlineproofing.com

Menu


type Event. This may seem a little confusing, but each object must be identified with a type in ActionScript 3.0, and you're simply telling ActionScript


that the event is of the type Event. A function is always defined inside curly brackets. This function assigns variable text to the text area you named mineral_ta. You could type exact text within quotation marks after the equal sign, but for this project, the text will change, depending on which mineral graphic was clicked. The text is the data for the selected item in the event target, which is the tile list. 5. From the Actions panel menu, choose Word Wrap. Flash will wrap the text within the panel so you can see all of it, regardless of line endings in the text. [View full size image] 6. Add the information for the first image in the tile list, including the label and source. Type thumbnails_tl.addItem({label:"OBSIDIAN", source:"thumbnails/Obsidian.jpg" data:"."}); For each item in the list, you'll identify the grid (thumbnails_tl) and use the addItem() method. Everything else goes inside parentheses and curly brackets. The label appears as text on top of the box; include quotation marks around it, and type it in all capital letters so it will display that way. Following the comma is the source, which is the path to the image you want to display. The third property is called data; this is the text that will appear in the mineral_ta box. You'll paste that text in later. 7. Choose Control > Test Movie. The obsidian thumbnail should appear on the left. When you click it, a period appears in the text area on the right. If the movie doesn't play as expected, check for typos, spaces, or any other errors in your script. You can compare your file to the ActionScript in the 08End.fla file. [View full size image] 8. Copy the line you just typed, and paste it 14 times to create lines for each of the other minerals. 9. Substitute the appropriate mineral name for the label and source file in each line: Granite, Basalt, Scoria, Rhyolite, Shale, Breccia, Sandstone, Conglomerate, Limestone, Slate, Marble, Quartzite, Gneiss, Schist. [View full size image] 10. Open the text document called Minerals.txt in any text editor. Copy the text from the Obsidian section of the document. 11. In the Actions panel in Flash, select the period between the quotation marks after the word data in the first addItem() line, and press Ctrl+V (Windows) or Command+V (Mac OS) to paste the text. 12. Delete paragraph returns (line endings) from the obsidian text. Add \n where you want paragraph breaks to occur. Type \n\n where you want space to appear between the paragraphs. There should be no spaces between \n and the words that follow it. [View full size image] 13. Choose Control > Test Movie. Click the image of obsidian. The obsidian text should appear. If the movie flickers or returns an error, return to the Actions panel and confirm that you've typed everything correctly and removed all paragraph returns from the text. 14. Copy and paste the text for each of the other minerals, removing paragraph returns within the text.