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

currentLabel Problem

Community Beginner ,
Aug 30, 2012 Aug 30, 2012

Copy link to clipboard

Copied

I have written a package that I am importing with a public function that wants to use the currentLabel but I am getting a 1120 errror and I am not sure why. I am wanting to use it to get the label of the maintimeline in an FLA. Can anyone help or done this before? Thanks.

CODE:

//Get Frame Label

                    public function getcurrentFrameLabel():void

                    {

                              trace("Getting Label Name");

                              trace(currentlabelName);

                              currentlabelName = (currentLabel);

                              //Get Next Frame Label from labesArray

                              nextLabel = labelsArray.indexOf(currentlabelName) + 1;

                    }

TOPICS
ActionScript

Views

745

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 ,
Aug 30, 2012 Aug 30, 2012

Copy link to clipboard

Copied

you should copy and paste the complete error message after enabling "permit debugging" and indicate the problematic line number.  also, you'll need to post enough of the relevant code to evaluate 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
Community Beginner ,
Aug 30, 2012 Aug 30, 2012

Copy link to clipboard

Copied

package code

{

          import flash.display.MovieClip;

          import flash.display.Sprite;

          import flash.utils.*;

          import flash.text.TextField;

          import flash.events.MouseEvent;

          import flash.display.DisplayObject;

          import flash.display.FrameLabel;

          import flash.display.SimpleButton

          public class allActivities extends flash.display.Sprite

          {

//Current Label

                    public static var currentlabelName:String = "path";

//Choose Game Path Practice or Assessment;

                    public function choosePath():void

                    {

                              //Get Current Label

                              getcurrentFrameLabel();

                              //Game Path Button Listeners Frame 1

 

                              Practice.addEventListener(MouseEvent.CLICK,mouseClickPractice);

                              addEventListener(MouseEvent.CLICK,mouseClickAssessment);

                              //Admin Button;

                              addEventListener(MouseEvent.CLICK, mouseClickHandler);

                              trace("Listners Set");

                    }

                    //Get Frame Label

                    public function getcurrentFrameLabel():void

                    {

                              trace("Getting Label Name");

                              trace(currentlabelName);

                              currentlabelName = (currentLabel);

                              //Get Next Frame Label from labesArray

                              nextLabel = labelsArray.indexOf(currentlabelName) + 1;

                    }

}

}

The line that throws the error is




currentlabelName = (currentLabel);

Error 1120 Access of undefined property currentLabel.

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 ,
Aug 30, 2012 Aug 30, 2012

Copy link to clipboard

Copied

sprites don't have a timeline and therefore don't have currentLabel property.

if you're trying to retrieve the currentLabel of some movieclip (which is reasonable), you need to pass a reference to that movieclip to getcurrentFrameLabel and then use the currentLabel property of that movieclip.

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 Beginner ,
Aug 30, 2012 Aug 30, 2012

Copy link to clipboard

Copied

what if its the maintimeline of the FLA?

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 ,
Aug 30, 2012 Aug 30, 2012

Copy link to clipboard

Copied

LATEST

if your allActivities instances has been added to the display list, you can use MovieClip(root) to reference the maintimeline and use MovieClip(root).currentLabel to reference the main timeline's currentLabel property.

.

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