• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Lesson 22. Optimizing Scripts > Using the Memory Inspector and Preloading Cast ...

Using the Memory Inspector and Preloading Cast Members

So far, you have focused on ways to optimize your scripts to make them easier to read, write, and edit. But optimization has another important meaning for programmers: you can optimize performance by making the animations and user responses execute as quickly as possible.

If you pay close attention to the arm movement when you first run the movie and extend the robot arm, you may notice that the arm moves slowest the first time you play the movie. That's because Director may need to load each cast member into memory the first time it uses it; after the movie has played once, the cast members are already in memory and are quickly available. When the movie is started, Director attempts to load cast members into memory in an intelligent manner. Cast members explicitly used in the score are loaded first, in the order that they are used in the score. When you are working with a large number of cast members, it is probable that Director will not be able to have all cast members loaded at one time. Director tries to anticipate when cast members will be needed and load those members, but this generally will require other cast members to be removed from memory to make room for the new ones. Because it is impossible for Director to anticipate all possibilities, especially when you are using cast members exclusively through Lingo, you may need to take control of the loading and unloading of cast members into memory yourself.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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