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

Trying to change alpha value.

New Here ,
Apr 22, 2014 Apr 22, 2014

Copy link to clipboard

Copied

I'm trying to change the alpha value when you click on the green circle, when I put this code into the timeline it works perfectly. But when I put it into an as file it wont work, can anyone tell me what I'm doing wrong?

Thanks

package  {

 

          import flash.display.MovieClip;

          import flash.events.MouseEvent;

 

          public class Circle extends MovieClip {

 

 

                    public function Circle() {

                              // constructor code

 

 

myGreenCircle.addEventListener(MouseEvent.CLICK, doClick);

                    }

 

                    function doClick(e:MouseEvent):void

                    {

                              myGreenCircle.alpha = .5;

                    }

                    }

          }

TOPICS
ActionScript

Views

317

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 ,
Apr 22, 2014 Apr 22, 2014

Copy link to clipboard

Copied

is the Circle class being callled?  (use the trace function to confirm.)

if it is, are you seeing any errors?

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
New Here ,
Apr 22, 2014 Apr 22, 2014

Copy link to clipboard

Copied

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
Community Expert ,
Apr 22, 2014 Apr 22, 2014

Copy link to clipboard

Copied

LATEST

you'll need to wait for someone else to download and correct your files if you can't use forum help.

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