Highlighted

Am I having a stroke? Access of undefined property error in SIMPLE movie.

Explorer ,
Feb 09, 2019

Copy link to clipboard

Copied

I have been working with Flash for 20 years but have only made presentation style movies in AS3.  I SWEAR on my love of dessert that I have created dozens and dozens of presentations using this exact method only now it doesn't work.

As a test of sanity I created a simple movie with 4 layers and a keyframe on frame 1 (layer 1), 5 (layer 2) and 10 (layer 3).  At each frame on an ACTIONS layer I have a stop(); action.

On frame 1 I draw a simple rectangle and convert to a symbol and name it button1.  I also give it an instance name of button1.  I click CODE SNIPPETS after selecting the button and tell it to got to frame 5 and stop.

stop();

button1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);

function fl_ClickToGoToAndStopAtFrame(event:MouseEvent):void
{
gotoAndStop(5);
}

I publish that and it works fine.

On layer 2, keyframe 5 I draw another rectangle, name it button2 and give it an instance name of button2.  I select it, apply CODE SNIPPET telling it to go to frame 10 and stop.

stop();

button2.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_2);

function fl_ClickToGoToAndStopAtFrame_2(event:MouseEvent):void
{
gotoAndStop(10);
}


I publish that and I get the access of undefined property error.  What is happening?  Have I completely forgotten how to create a simple AS3 movie?  Do I smell almonds?  What the hell am I missing? There is no logical reason for this error to happen, right?

EDIT: TURN OFF ADVANCED LAYERS.  I searched in the forum and found the answer.

Views

79

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

Am I having a stroke? Access of undefined property error in SIMPLE movie.

Explorer ,
Feb 09, 2019

Copy link to clipboard

Copied

I have been working with Flash for 20 years but have only made presentation style movies in AS3.  I SWEAR on my love of dessert that I have created dozens and dozens of presentations using this exact method only now it doesn't work.

As a test of sanity I created a simple movie with 4 layers and a keyframe on frame 1 (layer 1), 5 (layer 2) and 10 (layer 3).  At each frame on an ACTIONS layer I have a stop(); action.

On frame 1 I draw a simple rectangle and convert to a symbol and name it button1.  I also give it an instance name of button1.  I click CODE SNIPPETS after selecting the button and tell it to got to frame 5 and stop.

stop();

button1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);

function fl_ClickToGoToAndStopAtFrame(event:MouseEvent):void
{
gotoAndStop(5);
}

I publish that and it works fine.

On layer 2, keyframe 5 I draw another rectangle, name it button2 and give it an instance name of button2.  I select it, apply CODE SNIPPET telling it to go to frame 10 and stop.

stop();

button2.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_2);

function fl_ClickToGoToAndStopAtFrame_2(event:MouseEvent):void
{
gotoAndStop(10);
}


I publish that and I get the access of undefined property error.  What is happening?  Have I completely forgotten how to create a simple AS3 movie?  Do I smell almonds?  What the hell am I missing? There is no logical reason for this error to happen, right?

EDIT: TURN OFF ADVANCED LAYERS.  I searched in the forum and found the answer.

Views

80

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
Feb 09, 2019 0
kglad LATEST
Adobe Community Professional ,
Feb 09, 2019

Copy link to clipboard

Copied

disable advanced layers (modify>document>untick 'use advanced layers').

info about advanced layers: https://helpx.adobe.com/animate/using/timeline-layers.html#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...
Feb 09, 2019 0