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

Actionscript referencing Dynamic Text instance not working across multiple keyframes

Participant ,
Mar 14, 2019 Mar 14, 2019

Copy link to clipboard

Copied

I've got a keyframe-by-keyframe animation (still frames) whereby I'd like each frame to have it's own set of AS3 commands to control dynamic text fields over each still frame. 

So, I've setup an ActionScript project and I've laid out each image as a separate keyframe in the timeline.  I've also added an Actions layer with each frame's actions abvove.

The issue I'm running into is with my dynamic text instances.  I'm using dynamic text to input text from a string with the user's keystrokes.  Works fine on the first frame as long as I don't add any additional keyframes to the timeline.  As soon as I add additional keyframes, the first frame dynamic text doesn't work nor do any other frames which also have their own dynamic text instances and strings.

My script for the first frame is below:

stop();

var userName:String = "AZal888";

var chars2:Number = 0;

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyHandler2);

function keyHandler2(event:KeyboardEvent):void {

    if (++chars2 === userName.length) {

        stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyHandler2);

    }

    accessName.text = userName.substr(0, chars);

}

When I add additional frames with similar scripting for their dynamic text fields, I get 'Undefined Property" errors for the instance names of each of the other Dynamic text fields.  I've checked over and over - the instance names referred to in the script are correct.

Any help you can lend is greatly appreciated!

Thank you!

Views

365

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

correct answers 1 Correct answer

Participant , Mar 22, 2019 Mar 22, 2019

I found a solution (maybe there are others). 

I found another forum post that suggested turning off or unchecking, "Use Advanced Layers".  You can make this modification from the menu - MODIFY - Document.  Uncheck "Use Advanced Layers".

Votes

Translate

Translate
Participant ,
Mar 22, 2019 Mar 22, 2019

Copy link to clipboard

Copied

LATEST

I found a solution (maybe there are others). 

I found another forum post that suggested turning off or unchecking, "Use Advanced Layers".  You can make this modification from the menu - MODIFY - Document.  Uncheck "Use Advanced Layers".

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