Share this Page URL
Help

Chapter 4. Flash and Generator > Nesting Symbol Commands - Pg. 66

Flash and Generator 10. Save the text file and test your Generator template. Now the company name should be a muted green, and the tag line should be bright green. 66 Nesting Symbol Commands Having the company name and tag line always on the left side of the screen is somewhat limiting. Why not add in the capability to reposition the text? If you try to apply a new symbol command to the existing instances of the movie clips on the Stage, you overwrite the previous symbol commands. Remember, you can apply only one symbol command to each instance of a symbol on the Stage. Fortunately, there is an easy workaround--you can nest symbols inside symbols. Procedure 4-9. Exercise 4.9 Using the Symbol Commands with Nested Symbols Nesting symbols inside other symbols is a simple process. All you have to do is select an existing symbol, press F8 (Insert > Convert to Symbol), and give the symbol a new name. You haven't changed your old symbol; you've just wrapped it inside a new symbol. 1. 2. Continue working in banner8.fla or load it from the CD-ROM. Use the Arrow tool to select the Company movie clip instance on the Stage. Embed the Com- pany movie clip in another movie clip by pressing F8 (Insert > Convert to Symbol) on your keyboard. In the Symbol Properties dialog box, type transform_company for the name of the symbol and accept the default movie clip behavior. With the transform_company movie clip selected, choose the Transform symbol command from the Generator panel. Change the values for the X Offset and the Y Offset to {comp_xoffset} and {comp_yoffset}, respectively. Save your file as banner9.fla. Open your data source file, data.txt, and add the following name/value pairs: comp_xoffset, 100 comp_yoffset, 0 You'll be moving the instance of transform_company on the Stage 100 pixels to the right. You won't be making any changes to the vertical position. Positive X Offset values move symbol instances to the right, and negative values move them to the left. Positive Y Offset values move symbols down and negative values move them up. Remember that the registration point for a Flash movie, which is the point where X and Y are both equal to zero, is the upper-left corner of the Stage. 8. Save your text file and test your Flash movie. The company name should be offset by 100 pixels to the right of the tag line, assuming you had both aligned at the left side of the Stage in your template. 9. Repeat Steps 3 through 7 for the Tag movie clip. Use transform_tag as the new symbol name. You'll need to set up the offset variables in the Generator panel. Use {tag_xoffset} and {tag_yoff- set}. Finally, don't forget to add those variables to your data source. 10. Save your data source. Save your Flash file as banner9.fla. Test away. By now, you should have a good feel for how you can use Generator text variables to add dynamic text to a page. You've also seen how you can convert text variables to symbols and apply the Generator symbol commands to them. Note 3. 4. 5. 6. 7.