Groups | Blog | Home
all groups > flash actionscript > november 2006 >

flash actionscript : Drag not working in Flashplayer 7


raylaur
11/9/2006 11:22:20 PM
I have a movie that uses drag & drop actions. It works fine when published for
Flashplayer 6 but breaks with 7. When the drag object is pressed it jumps to
the 0,0 location on the stage and does not drag. I need Flashplayer 7 so that
I can use the lockroot property so the move can be loaded into another movie
and preserve its _root references.

on (press) {
//turn off any previous feedback
tFeedback.text = "";
if (moved !== true) {
_global.DragPosX = this._x;
//capture current location
_global.DragPosY = this._y;
}
// enable drag and constrain to area within document
Rx = stage.width;
Ry = stage.height;
startDrag(this, false, 0, 0, Rx, Ry);
_global.dragHit = false;
moved = true;
}
on (release) {
this.stopDrag();
dragObject = this;
//get drag object name
targetObject = (eval(this._droptarget));
//get target object name
_root.judgePair(dragObject, targetObject);
}
Rothrock
11/9/2006 11:31:33 PM
Capitalization maters in 7. So I would start with:

Rx = Stage.width;
Ry = Stage.height;

AddThis Social Bookmark Button