Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to reach functions in the Document Class

Participant ,
Oct 30, 2008 Oct 30, 2008
Hi,
I have this Class:

package {
import flash.display.MovieClip;
public class MainClass extends MovieClip {
public function MainClass() {
trace("The main document class is Running.");
}
public function Sum(Number1:Number,Number2:Number):Number {
return Number1 + Number2;
}
}
}

I had used it as a document class, when I call the sum function from the main time line it works, but I need to call it from inside a movieclip.

thanks
TOPICS
ActionScript
561
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 30, 2008 Oct 30, 2008
Try making the function public static.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 30, 2008 Oct 30, 2008
In the movieClip's time line you might use this:

MovieClip(parent).Sum(60,40);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 30, 2008 Oct 30, 2008
LATEST
thanks Joergen N you solved it
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines