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

1084:syntax error

New Here ,
Apr 19, 2012 Apr 19, 2012

I am getting  the following errors at the end  the three last curly brackets when executing my swf file :-

expecting identifier before rightparen

(ii) expecting rightbrace before end of program

(iii)  expecting rightbrace before end of program

Here is my as codes :-

package  rakesh_fla

{

import flash.display.*;

import flash.events.*;

import flash.media.*;

import flash.net.*;

import flash.text.*;

import flash.ui.*;

public var default_volume:Number;

public var sound_control:MovieClip;

public var percent:Number;

public var fm_bar_bg:MovieClip;

public var music_volume:SoundTransform;

public var loader_info:TextField;

public var rakesh_background:MovieClip;

public var rakesh_fullscreen:SimpleButton;

public var total_bytes:Number;

public var loaded_bytes:Number;

public var fm_bar:MovieClip;

public var bg_music:Sound;

public var music_channel:SoundChannel;

public dynamic public class MainTimeline extends MovieClip

{

public function MainTimeline()

{

super();

addFrameScript(0, frame1, 1, frame2);

return;

}// end function

public function switch_screen_mode(event:MouseEvent)

{

if (stage.displayState == StageDisplayState.NORMAL)

{

stage.displayState = StageDisplayState.FULL_SCREEN;

}

else

{

stage.displayState = StageDisplayState.NORMAL;

}

return;

}// end function

function frame2()

{

stop();

rakesh_fullscreen.visible = true;

sound_control.visible = true;

stage.addEventListener(Event.RESIZE, resize_listener);

stage.dispatchEvent(new Event(Event.RESIZE));

rakesh_fullscreen.addEventListener(MouseEvent.CLIC  K, switch_screen_mode);

default_volume = 0.5;

bg_music = new rakesh_music();

music_channel = bg_music.play(0, 10000);

music_volume = new SoundTransform();

music_volume.volume = default_volume;

music_channel.soundTransform = music_volume;

sound_control.stop();

sound_control.addEventListener(MouseEvent.CLICK, play_pause);

return;

}// end function

public function play_pause(event:MouseEvent) : void

{

music_volume.volume = default_volume;

if (event.target.currentFrame == 1)

{

music_volume.volume = 0;

}

music_channel.soundTransform = music_volume;

event.target.play();

return;

}// end function

public function goto_music(event:MouseEvent) : void

{

navigateToURL(new URLRequest("song"), "_blank");

return;

}// end function

public function load_progress(event:Event) : void

{

loaded_bytes = stage.loaderInfo.bytesLoaded;

total_bytes = stage.loaderInfo.bytesTotal;

if (total_bytes == 0)

{

total_bytes = 1;

}

percent = Math.round(loaded_bytes / total_bytes * 100);

fm_bar.scaleX = percent * 0.01;

loader_info.text = "Loading... " + percent + "%";

if (percent >= 100)

{

fm_bar.removeEventListener(Event.ENTER_FRAME, load_progress);

play();

}

return;

}// end function

function frame1()

{

stop();

stage.scaleMode = StageScaleMode.NO_SCALE;

stage.align = StageAlign.TOP_LEFT;

fm_bar.addEventListener(Event.ENTER_FRAME, load_progress);

return;

function resize_listener(event:Event) : void

{

rakesh_background.x = stage.stageWidth * 0.5;

rakesh_background.y = stage.stageHeight * 0.5;

rakesh_fullscreen.x = stage.stageWidth - 22;

rakesh_fullscreen.y = stage.stageHeight - 22;

sound_control.x = stage.stageWidth - 65;

sound_control.y = 20;

return;

}// end function

}

}

}

please  help

rakesh

TOPICS
ActionScript
3.0K
Translate
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

correct answers 1 Correct answer

LEGEND , Apr 20, 2012 Apr 20, 2012

The errors I get don't show any missing braces, just missing functions. I moved the function you make inside the other frame1() function outside of that because there's no reason you should define a function inside another function, it will die at the end of the function and be invalid.

Here's the code:

http://pastebin.com/MTU4kQ2M

It's easier to paste this amount of code there with formatting and updatability.

edit:

Changed it, you had public declared twice in your class definition.

Translate
Guest
Apr 19, 2012 Apr 19, 2012

Looks like your frame1 function is missing a closing brace.

Translate
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
LEGEND ,
Apr 19, 2012 Apr 19, 2012

Your programs appears to have the correct indentation when I import it into a code formatting utility (Flash Builder).

How about the lines of code you're getting errors on and printing those lines of code for us so we can take a look.

Translate
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 ,
Apr 20, 2012 Apr 20, 2012

thanks for your  reply.

here  are the errors

expecting identifier before rightparen

(ii) expecting rightbrace before end of program

(iii)  expecting rightbrace before end of program

Translate
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
LEGEND ,
Apr 20, 2012 Apr 20, 2012

The errors I get don't show any missing braces, just missing functions. I moved the function you make inside the other frame1() function outside of that because there's no reason you should define a function inside another function, it will die at the end of the function and be invalid.

Here's the code:

http://pastebin.com/MTU4kQ2M

It's easier to paste this amount of code there with formatting and updatability.

edit:

Changed it, you had public declared twice in your class definition.

Translate
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 ,
Apr 20, 2012 Apr 20, 2012

thanks.

you are  genius man

Translate
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
LEGEND ,
Apr 20, 2012 Apr 20, 2012

Glad you got your issue resolved

Translate
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 ,
Apr 22, 2012 Apr 22, 2012

Hi Sinious

Actually i am getting  a sound problem with  my sound. The sound is not  working.

can i email  you  my  fla,  and  actionscript  please.

Can't  attach files on abode.

By the  way what is your email  address.

Please help me.

Thanks/regards

rakesh

Translate
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
LEGEND ,
Apr 22, 2012 Apr 22, 2012

Send me a priv msg plz

Translate
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 ,
Apr 25, 2012 Apr 25, 2012
LATEST

i have sent u  private  msg

Translate
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