top banner

Lab 10: Simple Site - Pt III

Assigned: Oct 28th, 2009

Due: Oct 28th, 2009

Description:

Students will build on the foundations of a constructing a simple Flash web site from the previous lab. By following the directions below...students should be able to integrate programmatic tweens, optimization, and basic XML.

Project Example Graphic

Programmatic Tweens:

Programmed tweens are excellent not only for saving on file size, but also for handling all sorts of dynamic interactions where a reaction to an event may require an item on the screen to move in a number of unspecified directions.

These next steps will only cover a very basic use of tweens. Keep in mind that if you move on to advanced actionscripting, it may be helpful to look into more advanced methods of tweening, as Adobe's own tweening engine is quite slow.

  1. Open up your lab 9 file and name it xxx_Lab10_1.fla, with the XXX being your initials.
  2. Clear all the frames after the first on the button layers
  3. On frame 1 of the actions layer, add this code

Content on this page requires a newer version of Adobe Flash Player.

Get Adobe Flash player

Optimization:

Assuming your graphics have been optimized following the material covered in lecture, and that you are loading in external swfs in logical places, optimization is a simple matter of tweaking final export settings on the file. These next steps will show you how to optimized our current file.

  1. Click file -> publish settings
  2. In the window that pops up, click 'flash'
  3. Under options, check 'Omit trace actions'. This will speed up any flash file that is tracing out information in large amounts.
  4. Also click 'Protect from import' and specify a password beneath the options list.
  5. Finally click 'generate size report'.
  6. Publish the movie.
  7. You will be presented with output detailing the size output on different frames. Pay special attention to where there are especially large numbers - these are the ones you will want to double-check and try to pair down the data contained in the frame.

Some ways to cut down on other size problems are detailed in the lecture material. Pay attention to the settings applied to your images and sounds - these can have a huge effect on the final size of your file, and can usually be tweaked to smaller sizes without a huge loss in quality.

XML:

XML is a great way to pass data into flash. Thankfully, getting it into flash is just as easy as loading in an external file ( although some extra parsing is needed ), so here is an example of how to load in some XML info for your about page.

  1. Download info.xml to the same folder as your lab 9 folder.
  2. Open it up and change some of the values within the tags, so you understand the structure of the XML file.
  3. Return to your lab 10 file.
  4. Select the actions on the first frame of the page1 section.
  5. Replace the code currently there with this.

For questions or comments concerning the course or web site contact Ronald J. Glotzbach.

College of Technology Homepage | Purdue University | Admissions | Purdue Directory

CGT 353 - Useful Resources CGT 353 - Course Grades CGT 353 - Weekly Schedule CGT 353 -  Home Page CGT 353 - Course Information Purdue University Home Page