Highlighted

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

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

402

Likes

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

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

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

403

Likes

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
Apr 21, 2020 0
Adobe Community Professional ,
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

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

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
Reply
Loading...
Apr 22, 2020 1
New Here ,
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.

 

 

 

 

 

Likes

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
Reply
Loading...
Apr 22, 2020 1
Adobe Community Professional ,
Apr 22, 2020

Copy link to clipboard

Copied

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

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

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
Reply
Loading...
Apr 22, 2020 0