Skip navigation
myszakf1
Currently Being Moderated

AS3 air project.. nested button in a movie clip .. trying to use a class script

May 21, 2012 6:30 PM

Tags: #problem #air #as3

I have been tring to have a button in a nested movie clip move the timeline along using a class script attached to the nested movie. I can get the buttons to work on the main timeline with another similar class script, but when I have a button within a nested movie and attach similar code to the movie, it doesn't seem to want to work. This is the class code attached to the nested clip.... I guess can an active listener be called if the button isn't yet being visible yet, and should this be done on the Main class script page for the main timeline? Any help would be great!! Thanks

 

package  {

   

    import flash.display.MovieClip;

    import flash.events.MouseEvent;

   

    public class Animation extends MovieClip {

       

        public function Animation() {

            gotoAndStop(1);

           

            negBackground_btn.addEventListener(MouseEvent.MOUSE_UP, buttonPressedNegBackground);

        }

 

        private function buttonPressedNegBackground(e:MouseEvent):void {

   

            negBackground_btn.visible = false;

            gotoAndStop("negChar");

        }

    }

}

 
Replies
  • Currently Being Moderated
    May 21, 2012 11:06 PM   in reply to myszakf1

    Hi,

     

    Your question is bit confusing, try to explain it. According to what I unsrestand you should use the particular movieClip name with the code to make it happen properly.

     

    Like :

     

    (movieClip_Instance).gotoAndStop("negChar");

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (1)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points