the error
Code:
ArgumentError: Error #1063: Argument count mismatch on Pin$iinit(). Expected 0, got 2.
at Timeline0_7b8041c17f3c8a4aa76550e9fbfc4735/::frame1()
i can get the mc to the stage if i leave out the pX,pY parameters. However, i can not interact with the mc and the trace does not work. The mc in the library, has the class set to Pin. My Pin class (nested in com.website directories) looks like this
Code:
package com.website{
import flash.display.MovieClip
import flash.events.EventDispatcher
import flash.events.Event
class Pin extends MovieClip{
var mc:MovieClip
var pX:Number
var pY:Number
public function Pin(pX,pY){
this=mc
trace(mc)
mc.x=pX
mc.y=pY
mc.buttonMode=true
mc.addEventListener("mouseDown",mDown)
mc.addEventListener("mouseUp",mUp)
}
private function mDown(ev:Event){
mc.startDrag()
}
private function mUp(ev:Event){
mc.stopDrag()
}
}
}
in flash,
Code:
import com.website.Pin
var holder:Sprite= new Sprite();
holder.x=300
holder.y=300
this.addChild(holder)
var pin:Pin= new Pin(50,50)
holder.addChild(pin)