interactive scripting - CGR C/092 - fall 2004
Philip van Allen - v a n a l l e n @ a r t c e n t e r . e d u

room 142, Monday 4:00pm-7:00pm
all materials on this web site © copyright 2004, Philip van Allen
 
week 06a - project 2 assignment, dynamically created clips

project 2 : 


due week 7:

Read chapter 11 - Arrays

Project 2 Assignment: This is a quick project to force you to solve some programming problems. As such, I am not providing the .FLA versions of the examples. However, we will go over the necessary concepts in class, and there are code fragments to do most of the features somewhere in the course notes. After the project is due, I will release my versions of the simple and extra credit .FLAs.

Create a Flash movie with an object that moves back and forth on the screen, automatically turning around when it reaches the left or right hand side of the screen. When you click on the object, a loop should duplicate the object three times, and place the new objects in random locations. The new objects should have the same behavior. You need to create code to solve the following problems:

  • at initialization, set the current direction of travel (e.g. by setting a variable to 10 to right or -10 to go left)
  • move the clip in the direction every frame (the direction variable can be added to this._x)
  • when the clip gets to the right side of the screen, change direction (change the direction variable to -10)
  • when the clip gets to the left side of the screen, change direction (change the direction variable to 10)
  • when the user clicks on the clip
    • duplicate this clip three times
    • change the position of the new clips to random locations

For additional credit, add the following features:

  • make the object with a head and tail, so it has to turn around when it changes direction (hint: put head & tail images in the object movieclip, and tell the clip to gotoAndStop to the appropriate image)
  • increment a global counter for each new object duplicated, so each every generation gets its own name and level
  • make the objects have random left and right turn-around points
  • make the objects disappear after a certain number of frames (hint: use variable and increment it every enterframe to count frames frame)

simple version (directionSimple.fla)


extra credit version (directionComplex.fla)



web accounts : 

instructions

All of your assignments should be uploaded to the server before class the day the assignment is due. Use an FTP program to do this. An easy one is RBrowserLite, which can be obtained at www.rbrowserlite.com.

FTP Information:

  • Host: web-edu.artcenter.edu
  • UserId: vanallenstudents
  • Password: ask the instructor

Once you connect to the server, open scripting2003fall, and inside that, open the folder with your name. Copy your HTML, SWF, and FLA files up your directory on the server, naming them appropriately (e.g. project1.html, project1.swf, project1.fla).

 

 

all materials on this web site © copyright 2004, Philip van Allen

top