Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
giao diện. Khái niệm này là như nhau cho các tập tin lớp học AS3 và sẽ không được thảo luận thêm trong phần đó. Tiếp theo chúng ta sẽ viết các tập tin lớp học cho các cơ sở dữ liệu cơ bản, hiển thị dữ liệu. Sau đó chúng tôi sẽ thảo luận về cấu trúc của giao diện. | Flash XML Applications renewArray . The DataBase class will call this function when a new search is initiated. Then the array will be renewed before being filled with data during execution of the DisplaySearch class as shown in Figure 14.3. Additions to Other Classes We first need to place the nextModul MovieClip on stage. We add one line in the script for the class Ar rangeStage this._parent.attachMovie nextModul nextModul 5 _x 72 _y 105 To connect the NextModul class to the search engine we have to call the main function of the NextModul class from the DisplaySearch class. Basically this is also one line which we place within the listener in which all data is added to the display units. The main function name is showNextFive . homeDisplay._parent._parent._parent.nextModul.showNextFive homeDisplay We are not yet finished and need to add some lines to the DataBase class. We want to renew the array every time a new search is initiated. We will call the static function of the NextModul class renewAr ray . Therefore we need to import the class first. Add an import statement in the DataBase class import scripts.DataBase.NextModul Then somewhere where we load the XML data we call the static function renewAr ray using the class name NextModul.renewArray This will make sure that when a new search is initiated a new array instance is created to collect all displays. Within the displaySelection function we need to add a few lines. We want to display the results in groups of five house displays. We count from 0 to 4 and then use the value of count05. All displays will be or iented to be under the mask. All others will be or iented to be on the right side of the mask and will be hidden. if count03 5 homeDisplay._y count03 110 5 if count05 5 homeDisplay._x 0 else Chapter 14 Creating the Database Part 2 homeDisplay._x this.mask._width else if count03 5 count03 0 homeDisplay._y count03 110 5 homeDisplay._x this.mask._width We are now ready to write the NextModul class. The .