need help (need identifier before dot error) on animate cc

New Here ,
Dec 03, 2021 Dec 03, 2021

Copy link to clipboard

Copied

import.flash.events.MouseEvent;

 

function ClickStop(Event: MouseEvent) {
stop();
}


StopButton.addEventListener(Mouse.Event.MOUSE_UP, ClickStop);

function ClickPlay(Event: MouseEvent) {
play();
}

PlayButton.addEventListener(Mouse.Event.MOUSE_UP, ClickPlay);

thats the code the one that gets the error is this 
import.flash.events.MouseEvent;

Views

47

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
community guidelines
Adobe Community Professional ,
Dec 03, 2021 Dec 03, 2021

Copy link to clipboard

Copied

Hi.

 

There are a few errors on your code.

// there's no dot between import and flash
import flash.events.MouseEvent;

function ClickStop(event:MouseEvent):void // event should be lowercase
{
	stop();
}

StopButton.addEventListener(MouseEvent.MOUSE_UP, ClickStop); // there's no dot between Mouse and Event

function ClickPlay(event:MouseEvent):void // it's a good practice to indicate that the function doesn't return any value
{
	play();
}

// you should use camel case in AS3. It means, for example,
// that the first word of instance names should be lowercase
// and the other words should start with uppercase letters.
// The same goes for functions and variables.
PlayButton.addEventListener(MouseEvent.MOUSE_UP, ClickPlay);

 

I hope this helps.

 

Regards,

JC

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
community guidelines
New Here ,
Dec 03, 2021 Dec 03, 2021

Copy link to clipboard

Copied

tyyy for the answer
I did it all but still the error pop up
the same one

Miguel22069219j94q_0-1638530106423.png

Iam a Student last activity so I can go to college
tyy for the answers again:))

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
community guidelines
Adobe Community Professional ,
Dec 03, 2021 Dec 03, 2021

Copy link to clipboard

Copied

You didn't fix all the errors.

 

In you screenshot you're writing Mouse.event instead of MouseEvent, for example.

 

Please double-check the syntax.

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
community guidelines
New Here ,
Dec 03, 2021 Dec 03, 2021

Copy link to clipboard

Copied

darn I did
still that error still and higlighting 
frame 1 line 1 column 1

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
community guidelines
Adobe Community Professional ,
Dec 03, 2021 Dec 03, 2021

Copy link to clipboard

Copied

Have you tried just copying and pasting my code?

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
community guidelines
New Here ,
Dec 03, 2021 Dec 03, 2021

Copy link to clipboard

Copied

LATEST

No but I just did rn
what it worked tyysmm

I just wanna learn it in my own pace but holy that worked
tyyyyysmmmmmm:)

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
community guidelines