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.
Copy link to clipboard
Copied
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.