0
[編輯] 請參閱代碼。 我可以加載圖像,我可以加載影片剪輯。圖像放大和平移到用戶輸入。但影片剪輯(mcInfo)需要「附加」到圖像上的某個點,以確保它能夠縮放和平移圖像。 原因是因爲圖像是由大量不同產品組成的大型灌溉設施。信息圖標(mcInfo)應該是可點擊的動畫片段,以顯示該產品的信息。 圖像上會有很多這些圖標。但它必須與用戶想要查看的產品相關聯。您可以將動畫片段鏈接到Actionscript 3中外部加載的圖像上的某個點嗎?
var spImage:Sprite = new Sprite(); //load image to sprite "I think"
board.addChild(spImage);
function initPic(e:Event):void {
infoBox.text = "";
infoBox.visible = false;
image = Bitmap(loader.content);
minScale = boardWidth/image.width;
image.scaleX = minScale;
image.scaleY = minScale;
spImage.addChild(image);// the loaded image
spImage.addChild(mcIn); // custom zoom in cursor
spImage.addChild(mcOut); // custom zoom out cursor
spImage.addChild(mcInfo); //information icon. This is the movieclip that I need to set at a point
spImage.addEventListener(MouseEvent.MOUSE_DOWN, startDragging);
stage.addEventListener(MouseEvent.MOUSE_UP, stopDragging);
loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, initPic);
loader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, updateInfo);
loader = null;
board.filters = [ new DropShadowFilter() ];
spImage.addEventListener(MouseEvent.CLICK, zoom);
}
var spImage:Sprite = new Sprite(); board.addChild(spImage); – Deon
請參閱修訂後的問題 – Deon
您能否提出問題陳述?在最後?:) 我不完全明白你的問題是什麼。 – SzRaPnEL