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

Scene 1, Layer 'actions', Frame 1, Line 1, Column 14 1086: Syntax error: expecting semicolon before leftbrace.

New Here ,
May 23, 2015 May 23, 2015

Trying to change colour of an object using buttons.

this is my code

on (release) {

  var object = new Color (_root.object) ;

  object.setRGB(0x0066CC) ;

}

but then the error comes up and object doesnt change colour..!!!!

TOPICS
ActionScript
734
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
Community Expert ,
May 23, 2015 May 23, 2015

that's (incorrect) as2 code.

are you publishing for as3 or as2?

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 ,
May 23, 2015 May 23, 2015

as3

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
Community Expert ,
May 23, 2015 May 23, 2015

delete the code you showed.

assign your button an instance name (eg, btn1) and attach to the first keyframe that contains btn1:

btn1.addEventListener(MouseEvent.CLICK,btn1F);

function btn1F(e:MouseEvent):void{

var ct:ColorTransform=btn1.transform.colorTransform;

ct.color=0x0066cc;

btn1.transform.colorTransform=ct;

}

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 ,
May 23, 2015 May 23, 2015

ok so i changed my button to blue_btn because it is blue. i put the code in but the image i want doesnt change to blue.

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 ,
May 23, 2015 May 23, 2015

The code has no errors which is good but the object i want to change colour isnt changing

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
Community Expert ,
May 24, 2015 May 24, 2015
LATEST

copy and paste the code you used.

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