
Код AS1/AS2:
class Mark
{
public var test:number;
public var container:movieclip;
public function set x(value:Number):Void
{
this.container._x = value;
}
public function set y(value:Number):Void
{
this.container._y = value;
}
/**
* Constructor.
* Creates new instance of <code>Mark</code>
*/
public function Mark() { super(); }
public function draw():Void
{
// Use MovieClipLoader instead
this.container = _root.createEmptyMovieClip("myClip" + test, test);
this.container.loadMovie("1.png");
// Вот тут надо привязать клик по точке
this.container.onRollOver = this.makeDelegate(this.mouseOverHandler);
}
private function makeDelegate(func:Function):Function
{
var context:Mark = this;
return function():Object
{
return func.apply(context, arguments);
}
}
public function mouseOverHandler():Void
{
trace ("+");
}
/**
* This method creates new <code>MovieClip</code> somewhere...
*/
public function addMark(id:Number, x:Number, y:Void):Void
{
this.test = id;
this.draw();
this.koordinat(x, y);
}
/**
* Функция изменяет местоположение клипа
*/
public function position(x:Number, y:Number):Void
{
if (!isNaN(x)) this.x = x;
if (!isNaN(y)) this.y = y;
}
}
Что понял, исправил, что не понял, оставил как есть. Если уж пишете в классах, то используйте MovieClipLoader, а не loadMovie