我制作了一个游戏,允许用户装扮我公司的标志。问题是我是一个完全的编码新手,我被困在一个对我来说相当困难的任务上。
我只想导出徽标和用户放置在其上的项目。每个项目都绑定到一个特定的框架。每个项目都在一个单独的页面中,当用户单击第 1 页上的选项卡时,该页面会移动。徽标上项目所在的每个关键帧也有一个单独的命名层,以便于编目和检索。
以下是通用代码:
var myWindowArray = [neckWindow1, eyesWindow1, hatsWindow1, hatsWindow2, accessoriesWindow1, accessoriesWindow2, colorsWindow1, faceWindow1];
function hideAllWindows(){
for each (var window in myWindowArray){
window.x=950
}
}
neckButton1.addEventListener(MouseEvent.CLICK, showneckWindow1);
eyesButton1.addEventListener(MouseEvent.CLICK, showeyesWindow1);
hatsButton1.addEventListener(MouseEvent.CLICK, showhatsWindow1);
accessoriesButton1.addEventListener(MouseEvent.CLICK, showaccessoriesWindow1);
colorButton1.addEventListener(MouseEvent.CLICK, showcolorsWindow1);
faceButton1.addEventListener(MouseEvent.CLICK, showfaceWindow1);
accessoriesButton2.addEventListener(MouseEvent.CLICK, showaccessoriesWindow2);
hatsButton2.addEventListener(MouseEvent.CLICK, showhatsWindow2);
function showneckWindow1 (event:MouseEvent):void{
hideAllWindows();
neckWindow1.x=387.95
}
function showeyesWindow1 (event:MouseEvent):void{
hideAllWindows();
eyesWindow1.x=387.95
}
function showhatsWindow1 (event:MouseEvent):void{
hideAllWindows();
hatsWindow1.x=387.95
}
function showaccessoriesWindow1 (event:MouseEvent):void{
hideAllWindows();
accessoriesWindow1.x=387.95
}
function showaccessoriesWindow2 (event:MouseEvent):void{
hideAllWindows();
accessoriesWindow2.x=387.95
accessoriesWindow2.y=121.10
}
function showcolorsWindow1 (event:MouseEvent):void{
hideAllWindows();
colorsWindow1.x=387.95
}
function showfaceWindow1 (event:MouseEvent):void{
hideAllWindows();
faceWindow1.x=387.95
}
function showhatsWindow2 (event:MouseEvent):void{
hideAllWindows();
hatsWindow2.x=387.95
hatsWindow2.y=121.10
}
然后该代码链接到各个窗口代码,如下所示:
import flash.events.MouseEvent;
var myNeckArray = [glasses1, glasses2, glasses3, glasses4, glasses5, glasses6, glasses7, glasses8, glasses9, glasses10, glasses11, glasses12];
for each (var neck in myNeckArray) {
neck.addEventListener (MouseEvent.CLICK, onNeckClick);
}
function onNeckClick (event:MouseEvent):void {
MovieClip(parent).eyes_MC.gotoAndStop(event.target.name);
}
如何访问标记的关键帧并导出图像?另外,如果我想让用户在导出时自动发布到 Facebook,这个过程和代码是否相似?