|
|
||||||||||
| Ultrashock Tutorials > Flash 8 > Alt Captions | ||||||||||
|
||||||||||
|
|
Alt Captions |
|
||||||||
Library ClassThis class is used to fix object scope using the apply function. Its functionality is the same as Macromedia’s Delegate Class except it enables you to pass parameters to the callback method. For example, say your trying to access a property called “score” inside an onEnterFrame event in a class, without either delegating or storing a local variable to path with you wouldn’t be able to access the property. Valid - Delegate: private function phone():Void Valid, but repetitious – Local Property: private function phone():Void Invalid private function phone():Void For these reasons this class has been made to fix the problem. class Library return function () Save this file in the base directory as “Library.as”. ConclusionOver the process of this article you have learned how to setup class paths, create instances of classes, define class properties, setup a constructor method, implement methods, and fix scope issues. Hopefully you not only better understand the theory behind this technique, but also more about coding with OOP. Demo:
|
||||||||||
©2006 Ultrashock.com - All rights reserved |