Ở đây mình chọn hình chữ F xoay có sẵn và đưa vào 1 mc, đặt instance name cho mc đó là "mc" và viết code sau lên frame:
Code:
_root.onLoad();
var totalFrames:Number = _root.mc._totalframes;
_root.onMouseDown = function() {
regPoint = _root._xmouse;
origFrame = _root.mc._currentframe;
dragging = true;
};
_root.onMouseMove = function() {
if (dragging) {
frame = Math.ceil(origFrame+(_root._xmouse-regPoint)/5);
if (frame>totalFrames) {
regPoint = _root._xmouse;
origFrame = 1;
} else if (frame<0) {
regPoint = _root._xmouse;
origFrame = totalFrames;
}
_root.mc.gotoAndStop(frame);
updateAfterEvent();
}
};
_root.onMouseUp = function() {
dragging = false;
};
FLA: http://www.vietdetroit.com/dantopaz/Dantopaz/3D/3D.flaLưu ý: Các bạn có thể dùng vào việc trình bày sản phẩm cho trực quan Ko quan trọng đoạn frame by frame của bạn dài bao nhiêu, miễn frame cuối giống frame đầu là ổn!
Theo vnfx