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

Can we extend document class with custom class in flash as3?

New Here ,
Feb 21, 2016 Feb 21, 2016

Hi,
Can we extend document class with custom class in flash as3?

Thanks,
Amisha

TOPICS
ActionScript
498
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

correct answers 1 Correct answer

Community Expert , Feb 21, 2016 Feb 21, 2016

try:

amishap67776642 wrote:

package

{

     public class accessories extends ScreenBase

     {

          public function accessories()

          {

            super();

            addEventListener(Event.ADDED_TO_STAGE,onAddedTostageHandler)

          }

          private function onAddedTostageHandler(e:Event):void

          {

              super.init();

          }

     }

}

/* class ScreenBase*/

package

{

     public class ScreenBase extends MovieClip

     {

          public function ScreenBase

...
Translate
Community Expert ,
Feb 21, 2016 Feb 21, 2016

yes

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
New Here ,
Feb 21, 2016 Feb 21, 2016

package

{

     public class accessories extends ScreenBase

     {

          public function accessories()

          {

            super();

            addEventListener(Event.ADDED_TO_STAGE,onAddedTostageHandler)

          }

          private function onAddedTostageHandler(e:Event):void

          {

              super.init();

          }

     }

}

/* class ScreenBase*/

package

{

     public class ScreenBase extends MovieClip

     {

          public function ScreenBase ()

          {

            super();

          }

          public function init():void

          {

               tutorialBox_mc.visible = true;

          }

     }

}

Getting error that I can't access "tutorialBox_mc" in Base class.
tutorialBox_mc is the movieclip that I placed on stage and that fla link to document class "accessories"

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 ,
Feb 21, 2016 Feb 21, 2016
LATEST

try:

amishap67776642 wrote:

package

{

     public class accessories extends ScreenBase

     {

          public function accessories()

          {

            super();

            addEventListener(Event.ADDED_TO_STAGE,onAddedTostageHandler)

          }

          private function onAddedTostageHandler(e:Event):void

          {

              super.init();

          }

     }

}

/* class ScreenBase*/

package

{

     public class ScreenBase extends MovieClip

     {

          public function ScreenBase ()

          {

            super();

          }

          public function init():void

          {

              MovieClip(this).tutorialBox_mc.visible = true;

          }

     }

}

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