Highlighted

Syntax Error Adobe Animate Scene Actions

New Here ,
Jun 15, 2020

Copy link to clipboard

Copied

hello, i'm new using adobe animate and i tried to use adobe animate 2019 to make a quiz. there are some errors:

  • Scene 15, Layer 'Actions', Frame 1, Line 68, Column 7 1083: Syntax error: else is unexpected.
    • Scene 15, Layer 'Actions', Frame 1, Line 63, Column 47 1084: Syntax error: expecting semicolon before rightparen. Scene 15, Layer 'Actions', Frame 1, Line 62, Column 53 1084: Syntax error: expecting identifier before logicaland.

Here's my code:

 

import flash.events.MouseEvent;
 
//melakukan inisialisasi posisi awal dari object
//fungsi ini dibuat terutama untuk keperluan "me-reset posisi object"
function inisialisasi_posisi():void{ //
      benar_mc.visible = false;
      salah_mc.visible = false;
 
//posisi ayah
ayah_mc.x = posisiawal_ayah_mc.X;
ayah_mc.y = posisiawal_ayah_mc.Y;
 
//posisi kakak
kakak_mc.X = posisiawal_kakak_mc.X;
kakak_mc.Y = posisiawal_kakak_mc.Y;
 
//posisi ibu
ibu_mc.X = posisiawal_ibu_mc.X;
ibu_mc.Y = posisiawal_ibu_mc.Y;
 
//posisi adik
adik_mc.X = posisiawal_adik_mc.X;
adik_mc.Y = posisiawal_adik_mc.Y;
 
} //
 
inisialisasi_posisi();
 
//DRAG & DROP OBJECT
function dragdrop(object_mc:MovieClip):void
{
      object_mc.addEventListener(MouseEvent.MOUSE_DOWN, startdrag);
      object_mc.addEventListener(MouseEvent.MOUSE_UP, stopdrag);
}
 
function startdrag(e:MouseEvent):void
{
      e.currentTarget.startDrag();
}
function stopdrag(e:MouseEvent):void
{
      e.currentTarget.stopDrag();
}
 
//set dragdrop
dragdrop(ayah_mc);
dragdrop(kakak_mc);
dragdrop(ibu_mc);
dragdrop(adik_mc);
 
//result
test_btn.addEventListener(MouseEvent.CLICK, test);
 
function test(e:MouseEvent):void
{
      //jika semua object berada pada tempat yang benar
      if(ayah_mc.hitTestObject(ayahTarget_mc)== true &&
         kakak_mc.hitTestObject(kakakTarget_mc)== true &&
         ibu_mc.hitTestObject(ibuTarget_mc)== true) &&
adik_mc.hitTestObject(adikTarget_mc)== true) &&
      { //
            benar_mc.visible = true;
            salah_mc.visible = false;
      } //
      else
      {
            benar_mc.visible = false;
            salah_mc.visible = true;
      }
}
 
//reset object ke posisi awal
reset_btn.addEventListener(MouseEvent.CLICK, reset);
 
function reset(e:MouseEvent):void
{
      inisialisasi_posisi();
}
 
/* Click to Go to Scene and Play
Clicking on the specified symbol instance plays the movie from the specified scene and frame.
 
Instructions:
1. Replace "Scene 3" with the name of the scene you would like play.
2. Replace 1 with the frame number you would like the movie to play from in the specified scene.
*/
 
button_nextquiz1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_16);
 
function fl_ClickToGoToScene_16(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Scene 16");
}
 
/* Click to Go to Previous Scene and Play
Clicking on the specified symbol instance moves the playhead to the previous scene in the timeline and continues playback in that scene.
*/
 
button_previousquiz1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToPreviousScene_17);
 
function fl_ClickToGoToPreviousScene_17(event:MouseEvent):void
{
MovieClip(this.root).prevScene();
}
 
stop();
 
thank you so much
TOPICS
ActionScript, Error

Views

86

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

Syntax Error Adobe Animate Scene Actions

New Here ,
Jun 15, 2020

Copy link to clipboard

Copied

hello, i'm new using adobe animate and i tried to use adobe animate 2019 to make a quiz. there are some errors:

  • Scene 15, Layer 'Actions', Frame 1, Line 68, Column 7 1083: Syntax error: else is unexpected.
    • Scene 15, Layer 'Actions', Frame 1, Line 63, Column 47 1084: Syntax error: expecting semicolon before rightparen. Scene 15, Layer 'Actions', Frame 1, Line 62, Column 53 1084: Syntax error: expecting identifier before logicaland.

Here's my code:

 

import flash.events.MouseEvent;
 
//melakukan inisialisasi posisi awal dari object
//fungsi ini dibuat terutama untuk keperluan "me-reset posisi object"
function inisialisasi_posisi():void{ //
      benar_mc.visible = false;
      salah_mc.visible = false;
 
//posisi ayah
ayah_mc.x = posisiawal_ayah_mc.X;
ayah_mc.y = posisiawal_ayah_mc.Y;
 
//posisi kakak
kakak_mc.X = posisiawal_kakak_mc.X;
kakak_mc.Y = posisiawal_kakak_mc.Y;
 
//posisi ibu
ibu_mc.X = posisiawal_ibu_mc.X;
ibu_mc.Y = posisiawal_ibu_mc.Y;
 
//posisi adik
adik_mc.X = posisiawal_adik_mc.X;
adik_mc.Y = posisiawal_adik_mc.Y;
 
} //
 
inisialisasi_posisi();
 
//DRAG & DROP OBJECT
function dragdrop(object_mc:MovieClip):void
{
      object_mc.addEventListener(MouseEvent.MOUSE_DOWN, startdrag);
      object_mc.addEventListener(MouseEvent.MOUSE_UP, stopdrag);
}
 
function startdrag(e:MouseEvent):void
{
      e.currentTarget.startDrag();
}
function stopdrag(e:MouseEvent):void
{
      e.currentTarget.stopDrag();
}
 
//set dragdrop
dragdrop(ayah_mc);
dragdrop(kakak_mc);
dragdrop(ibu_mc);
dragdrop(adik_mc);
 
//result
test_btn.addEventListener(MouseEvent.CLICK, test);
 
function test(e:MouseEvent):void
{
      //jika semua object berada pada tempat yang benar
      if(ayah_mc.hitTestObject(ayahTarget_mc)== true &&
         kakak_mc.hitTestObject(kakakTarget_mc)== true &&
         ibu_mc.hitTestObject(ibuTarget_mc)== true) &&
adik_mc.hitTestObject(adikTarget_mc)== true) &&
      { //
            benar_mc.visible = true;
            salah_mc.visible = false;
      } //
      else
      {
            benar_mc.visible = false;
            salah_mc.visible = true;
      }
}
 
//reset object ke posisi awal
reset_btn.addEventListener(MouseEvent.CLICK, reset);
 
function reset(e:MouseEvent):void
{
      inisialisasi_posisi();
}
 
/* Click to Go to Scene and Play
Clicking on the specified symbol instance plays the movie from the specified scene and frame.
 
Instructions:
1. Replace "Scene 3" with the name of the scene you would like play.
2. Replace 1 with the frame number you would like the movie to play from in the specified scene.
*/
 
button_nextquiz1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_16);
 
function fl_ClickToGoToScene_16(event:MouseEvent):void
{
MovieClip(this.root).gotoAndPlay(1, "Scene 16");
}
 
/* Click to Go to Previous Scene and Play
Clicking on the specified symbol instance moves the playhead to the previous scene in the timeline and continues playback in that scene.
*/
 
button_previousquiz1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToPreviousScene_17);
 
function fl_ClickToGoToPreviousScene_17(event:MouseEvent):void
{
MovieClip(this.root).prevScene();
}
 
stop();
 
thank you so much
TOPICS
ActionScript, Error

Views

87

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
Jun 15, 2020 0
Adobe Community Professional ,
Jun 15, 2020

Copy link to clipboard

Copied

Hi.

 

You have an extra parenthesis on line 59:

ibu_mc.hitTestObject(ibuTarget_mc)== true) &&

 

It should be:

ibu_mc.hitTestObject(ibuTarget_mc)== true &&

 

I hope this helps.

 

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...
Jun 15, 2020 0
New Here ,
Jun 16, 2020

Copy link to clipboard

Copied

Hello JC, thank you for replying my question. I still got an error said: 

  • Scene 15, Layer 'Actions', Frame 1, Line 22, Column 17 1120: Access of undefined property posisiawal_adik_mc.
  • Scene 15, Layer 'Actions', Frame 1, Line 23, Column 17 1120: Access of undefined property posisiawal_adik_mc.

 

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...
Jun 16, 2020 0