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

1120: Access of undefined property p1.

New Here ,
Jun 16, 2020 Jun 16, 2020

Copy link to clipboard

Copied

here is the code I used :

 

 

import flash.events.MouseEvent;

stop();

var p1StartX: int = 56
var p1StartY: int = 112
var p1EndX: int = 368.15
var p1EndY: int = 162.05

p1.buttonMode = true;
p1.addEventListener(MouseEvent.MOUSE_DOWN,startDragging);
p1.addEventListener(MouseEvent.MOUSE_DOWN,startDragging);


function startDragging(e:MouseEvent):void
{e.currentTarget.startDrag();}
function stopDragging(e:MouseEvent):void

{e.currentTarget.stopDrag();}

 

and compiling this I get error:

play, Layer 'Actions', Frame 2, Line 10, Column 1 1120: Access of undefined property p1.
play, Layer 'Actions', Frame 2, Line 11, Column 1 1120: Access of undefined property p1.
play, Layer 'Actions', Frame 2, Line 12, Column 1 1120: Access of undefined property p1.

 

Guess instance name is alright.It would be very nice if anyone can help me out.

Capture.PNG

 

Views

130

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 ,
Jun 17, 2020 Jun 17, 2020

Copy link to clipboard

Copied

LATEST

no, it is not.

 

the "instance name" needs to be p1.  the library name p1 can by used many times to create many different instances.  each instance is a distinct object (though they all look the same when first created/added from the library or with code) that can have different behaviors.

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