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

When preview swf getting error, 1086: syntax error: expecting semicolon before b1

New Here ,
Apr 21, 2020 Apr 21, 2020

Copy link to clipboard

Copied

I am making a puzzle with scoreboard with error addressed in subject.

Pasting part of the code:

var  textfont: TextFormat = new TextFormat();
       textfont.size = 40;
       textfont = "Showcard Gothic";
       1b1.setStyle("textFormat", textfont);       /*error line in compiler*/
       1b2.setStyle("textFormat", textfont);

 

Hopefully someone can help me.

I am new to this kind of forum so if i forgot something please let me know.

 

 

 

TOPICS
ActionScript , Code , Error

Views

529

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 ,
Apr 22, 2020 Apr 22, 2020

Copy link to clipboard

Copied

Hi.

 

Properties and variables names cannot start with numbers. So you're gonna have to rename 1b1 to something else.

 

Naming limitations for variables in ActionScript 3
• Variable names cannot be a reserved word or keyword. For more information, see ActionScript 3 fundamentals: Syntax
• Variable names must start with a letter, an underscore, or a dollar sign
• Variable names cannot use special characters (except
_
and
$
in certain situations)
• Variable names must be unique

 

More details here:

https://www.adobe.com/devnet/actionscript/learning/as3-fundamentals/variables.html

 

 

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 ,
Apr 22, 2020 Apr 22, 2020

Copy link to clipboard

Copied

Thank you for the quick answer, changed it to kb1 and the error disappeared. I will read the variable page to learn more about as3. After the changes the compiler has the following error: 1172: Definition com.adobe.tvsdk.mediacore.TextFormat could not be found.

When i click on it this line is selected: import com.adobe.tvsdk.mediacore.TextFormat;

What am i doing wrong now? Thanks in advance.

 

 

 

 

 

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 ,
Apr 22, 2020 Apr 22, 2020

Copy link to clipboard

Copied

LATEST

Nice!

 

Yeah. Because that's probably not the TextFormat class you want to use.

 

Instead of:

import com.adobe.tvsdk.mediacore.TextFormat;

 

Write:

import flash.text.TextFormat;

 

Please let us know if this fixes the issue.

 

 

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