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

How to reach functions in the Document Class

Participant ,
Oct 30, 2008 Oct 30, 2008

Copy link to clipboard

Copied

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

Views

509

Translate

Translate

Report

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

Copy link to clipboard

Copied

Try making the function public static.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

In the movieClip's time line you might use this:

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST
thanks Joergen N you solved it

Votes

Translate

Translate

Report

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