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

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

160

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

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
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:))

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

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

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 ,
Dec 03, 2021 Dec 03, 2021

Copy link to clipboard

Copied

Have you tried just copying and pasting my code?

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
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:)

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