我对包裹非常陌生,所以请原谅我的简单问题。如何初始化 docTwo 类和构造函数?我想出了如何从主类调用静态函数而不是初始化另一个类。谢谢
myDocClass.as
package {
import flash.display.MovieClip;
import docTwo;
public class myDocClass extends MovieClip
{
var Hello:String = "Hi there";
public function myDocClass ()
{
trace("And all the people said... " + Hello);
docTwo.docTwo(); /// Does NOT WORK. How do I call this or init class?
thisWorks();
// Below call Works
docTwo.docTwoFunction();
}
public function thisWorks()
{
trace("Cool Beans! This one worked");
}
}/// end of Class
}
docTwo.as
package {
import flash.display.MovieClip;
public class docTwo{
public function docTwo()
{
trace("Trying to get this to work!");
docTwoFunction(); // How do I call this from here?
}
static public function docTwoFunction()
{
trace("I am inside docTwo. Woo hoo!");
}
}
}