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

1084: Syntax error: expecting right brace before end of program.

New Here ,
Jun 06, 2021 Jun 06, 2021

Copy link to clipboard

Copied

Hello, im having trouble with my code. It keeps giving me 1084: Syntax error: expecting right brace before end of program. Can someone help find out what is the issue in my code. 

 

Here's my code:

 

import flash.utils.Timer();
import flash.display.MovieClip();
import flash.text.TextField();
import flash.events.MouseEvent();
import flash.events.TimerEvent();

var clockFace: MovieClip;
var timeDisplay: TextField;
var ticker: Timer = new Timer(250);

clockFace.addEventListener(MouseEvent.MOUSE_OVER, showDigital);
clockFace.addEventListener(MouseEvent.MOUSE_OUT, hideDigital);

ticker.addEventListener(TimerEvent.TIMER, onTick);
ticker.start();

function onTick(e: TimerEvent): void {
var currentTime: Date = new Date();
var seconds: uint = currentTime.getSeconds();
var minutes: uint = currentTime.getMinutes();
var hours: uint = currentTime.getHours();

clockFace.secondHand.rotation = 360 + (seconds * 6);
clockFace.minuteHand.rotation = 360 + (minutes * 6);
clockFace.hourHand.rotation = 360 + (hours * 30) + (minutes * 0.5);

var displayMinutes: String = minutes < 10 ? "0" + minutes : "" + minutes;
timeDisplay.text = hours + ":" + displayMinutes;

}

function showDigital(e: MouseEvent): void {
timeDisplay.visible = true;

 

function hideDigital(e: MouseEvent): void {
timeDisplay.visible = false;

var fl_TimerInstance:Timer = new Timer(1000, 40);
fl_TimerInstance.addEventListener(TimerEvent.TIMER, fl_TimerHandler);
fl_TimerInstance.start();

var fl_SecondsElapsed:Number = 40;

function fl_TimerHandler(event:TimerEvent):void
{
trace("Seconds elapsed: " + fl_SecondsElapsed);
fl_SecondsElapsed++;
}

TOPICS
ActionScript , Code , Error

Views

959

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 ,
Jun 06, 2021 Jun 06, 2021

Copy link to clipboard

Copied

Screen Shot 2021-06-06 at 5.36.58 AM.png

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 ,
Jun 06, 2021 Jun 06, 2021

Copy link to clipboard

Copied

you have, at least, two functions without closures:

 

function showDigital(e: MouseEvent): void {
timeDisplay.visible = true;

 

function hideDigital(e: MouseEvent): void {
timeDisplay.visible = false;

var fl_TimerInstance:Timer = new Timer(1000, 40);
fl_TimerInstance.addEventListener(TimerEvent.TIMER, fl_TimerHandler);
fl_TimerInstance.start();

var fl_SecondsElapsed:Number = 40;

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 ,
Jun 06, 2021 Jun 06, 2021

Copy link to clipboard

Copied

im having trouble with this Screen Shot 2021-06-06 at 5.57.12 AM.png

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 ,
Jun 06, 2021 Jun 06, 2021

Copy link to clipboard

Copied

LATEST

i just posted the answer.  you have two functions showDigital and hideDigital that have no closing brackets. eg,

 

function showDigital(e: MouseEvent): void {
timeDisplay.visible = true;

}

 

var fl_TimerInstance:Timer;

function hideDigital(e: MouseEvent): void {
timeDisplay.visible = false;

fl_TimerInstance = new Timer(1000, 40);
fl_TimerInstance.addEventListener(TimerEvent.TIMER, fl_TimerHandler);
fl_TimerInstance.start();

var fl_SecondsElapsed:Number = 40;

}

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