Using ASFunction to Call Class Methods
Tuesday 18 October 2005 @ 8:15 am
Filed under:

One of the problems with ASFunction is that it will not let you call class methods. This is inconvenient if you are using your own custom class that builds an interface, and you need to have clickable links within a text field. A couple of solutions that I have seen uses a homemade proxy class or the built-in Delegate class to do it, but there is another way to do it that uses the same technique that is used within the XML object and within event handlers to retain the handle to the class instance. When an ASFunction link is clicked, the text field automatically looks to the parent movie clip for the function to call. A proxy function is placed in the text field’s parent movie clip, then a “parent” variable is created to hold the reference to the class instance. That variable is visible within the proxy function, and allows the function to then “redirect” to the class method.
read more…


Blog Categories

Browse by Date
October 2005
M T W T F S S
« Sep   Dec »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Monthly Archives

Bloggers Area

XML Feeds Option