Highlighted

Actionscript referencing Dynamic Text instance not working across multiple keyframes

Participant ,
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!

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".

TOPICS
Discussions

Views

119

Likes

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

Actionscript referencing Dynamic Text instance not working across multiple keyframes

Participant ,
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!

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".

TOPICS
Discussions

Views

120

Likes

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
Mar 14, 2019 0
Participant ,
Mar 22, 2019

Copy link to clipboard

Copied

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".

Likes

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
Reply
Loading...
Mar 22, 2019 0