我在一個MC上有一段代碼,當拖動鼠標時,它通過該影片剪輯進行播放,產生360旋轉的產品。
在這個360度旋轉的不同增量的影片剪輯裏,我有各種其他動畫的兒童影片剪輯與產品的每個角度相關。
EXP ..
場景1> spinY_mc> AWComplete_mc
我的自旋代碼在SCENE1的行動中寫入和控制spinY_mc但一旦AWComplete_mc即時我不希望你能拖動鼠標並旋轉?
我確定這很簡單,但我很小心,並且正在接受一個龐大的項目!
這裏是movieclip(spinY_mc)上使用的代碼我不希望此代碼在其子mc(AWComplete_mc)內部工作。
// Rotation of Control Body Y
spin_Y.stop();
spin_Y.buttonMode = true;
var spin_Y:MovieClip;
var offsetFrame:int = spin_Y.currentFrame;
var offsetY:Number = 0;
var percent:Number = 0;
spin_Y.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
spin_Y.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
function startDragging(e:MouseEvent):void
{
// start listening for mouse movement
spin_Y.addEventListener(MouseEvent.MOUSE_MOVE,drag);
offsetY = stage.mouseY;
}
function stopDragging(e:MouseEvent):void
{
// STOP listening for mouse movement
spin_Y.removeEventListener(MouseEvent.MOUSE_MOVE,drag);
// save the current frame number;
offsetFrame = spin_Y.currentFrame;
}
// this function is called continuously while the mouse is being dragged
function drag(e:MouseEvent):void
{
// work out how far the mouse has been dragged, relative to the width of the spin_Y
// value between -1 and +1
percent = (mouseY - offsetY)/spin_Y.height;
// trace(percent);
// work out which frame to go to. offsetFrame is the frame we started from
var frame:int = Math.round(percent * spin_Y.totalFrames) + offsetFrame;
// reset when hitting the END of the spin_Y timeline
while (frame > spin_Y.totalFrames)
{
frame -= spin_Y.totalFrames;
}
// reset when hitting the START of the spin_Y timeline
while (frame <= 0)
{
frame += spin_Y.totalFrames;
}
// go to the correct frame
spin_Y.gotoAndStop(frame);
}
其實目前還不清楚你想要達到的目標。你可以更具體嗎? – Teejay 2013-03-25 11:49:33
spinY_mc內有35個電影剪輯1-35每個mc是一個產品的不同角度。我寫了一些代碼,當拖動鼠標時,它會播放這些影片剪輯,並給出產品旋轉的印象,以便您可以看到所有角度。 – Danielle 2013-03-25 15:18:52
其中兩個角度說1_mc和35_mc我有更多的動畫,你可以與之交互。但是,當我在電影剪輯的這一部分內im我不想能夠拖動我如何刪除我的孩子movieclip內的父級動畫片段的功能? – Danielle 2013-03-25 15:22:12