I’ve got a AS3 program with a Main.as custom class.
In this class I load an instance of a ‘menu’ movieclip which has simpleButton instances inside… How do I access the Main class public functions by the menu movieclip buttons?
I.e. Menu button -> gotoPage(5); (which is a Main public function)
If I try to access the Main function with the above statement, it gives
“1180: Call to a possibly undefined method gotoPage.
Create a static method called GetMain() on the Main class that would return the instance of Main (Main should be a singleton).
To refer to the instance of Main() from your Menu class, you could use: