• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Objects

Don’t worry, the broken script in the “09_objects.fla” file doesn’t have much to do with objects. Instead, it deals with a common problem that arises when using objects. In this movie, I want a representation for each wheel of each vehicular homemade object that gets instantiated. In the first frame, you can see that I’m trying to put instances of my vehicle object in the variables bicycle, car, unicycle, and truck. Then I want to use attachMovie() to both place an instance of the Vehicle Shell symbol for each vehicle and, inside each vehicle, place an instance of the Wheel symbol for each wheel in that vehicle.

Just to see how the movie is working (or not working), I created a generic object (clickObj) onto which I assigned an onClick callback function. That generic object gets passed as the fourth parameter of attachMovie for each wheel (line 25 of the code). The problem is that I seem to get only one wheel for each vehicle—but I want to see as many wheels as necessary (see Figure W18.4). The thing that kills me is that when I debug the movie, all my objects are instantiated properly (as Figure W18.4 shows). Please make the wheels appear to spread out horizontally. Consider peeking at the hint because you’ll still be left with a nice challenge; even when you know where the script has to be adjusted, there’s still a lot of work to do the adjusting.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint