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

ActionScript Syntax Error

New Here ,
Mar 10, 2015 Mar 10, 2015

I'm making a project for my online class, and my script is having errors in 2 lines. I need some help. Can anyone figure out what's wrong with this?

Import Flash.events.Event; Stop();

This.addEventListener (Event.ENTER_FRAME, loading);

Function Loading (e:Event)

    Var total: Number = this.stage.loaderInfo.bytesTotal;

Var loaded: Number = this.stage.loaderInfo.bytesLoaded;

  Loading_bar.scaleX = loaded/total;

Loading_text.text =Math.floor ((loaded/total)*100) + "%";

If (total == loaded) { play ();

                           

    Play():                   

        This.removeEventListener (Event.ENTER_FRAME, loading);

}

}

If you can find the problem, I'll be grateful. And do hurry, I have until tomorrow to post my animation video.

TOPICS
ActionScript
352
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 ,
Mar 10, 2015 Mar 10, 2015

When you get error messages and want help solving them you should include the complete messages.  Looking at your code I would say the problem might lie in your use of capital letters for terms like: import,  this,  var,  function,

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 ,
Mar 10, 2015 Mar 10, 2015

It helps.

Thanks so much!

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 ,
Mar 10, 2015 Mar 10, 2015

You're welcome

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 ,
Mar 10, 2015 Mar 10, 2015

Wait, sorry.

Now the line 'function loading (e:Event) is the only one having syntax error. Any ideas?

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
Enthusiast ,
Mar 11, 2015 Mar 11, 2015
LATEST

At least in the code you show, you're missing an opening { after the function declaration. And you can get rid of 'this' - you're "in" this, so you don't need to use it.

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