Actionscript 3 电影剪辑符号中的图像库。CS6,AS3

Actionscript 3 电影剪辑符号中的图像库。CS6,AS3,actionscript-3,flash-cs6,Actionscript 3,Flash Cs6,我在电影剪辑符号中设置了一个图库。当用户单击主舞台上的剪辑时,我希望它转到电影剪辑的第2帧,这是画廊的开始。这可能吗 这是我的密码: package { import flash.display.*; import flash.events.*; import flash.media.Sound; import flash.media.SoundMixer; import flash.net.URLRequest; public class Deftones extends MovieClip

我在电影剪辑符号中设置了一个图库。当用户单击主舞台上的剪辑时,我希望它转到电影剪辑的第2帧,这是画廊的开始。这可能吗

这是我的密码:

package {
import flash.display.*;
import flash.events.*;
import flash.media.Sound;
import flash.media.SoundMixer;
import flash.net.URLRequest;

public class Deftones extends MovieClip{

function Deftones() {

swerve1.addEventListener(MouseEvent.MOUSE_DOWN, dragStartS);
swerve1.addEventListener(MouseEvent.MOUSE_UP, dragEndS);
polt1.addEventListener(MouseEvent.MOUSE_DOWN, dragStartS);
polt1.addEventListener(MouseEvent.MOUSE_UP, dragEndS);
rd1.addEventListener(MouseEvent.MOUSE_DOWN, dragStartS);
rd1.addEventListener(MouseEvent.MOUSE_UP, dragEndS);
gauze1.addEventListener(MouseEvent.MOUSE_DOWN, dragStartS);
gauze1.addEventListener(MouseEvent.MOUSE_UP, dragEndS);
stop1.addEventListener(MouseEvent.CLICK, stopMusic);
var sound1:Sound= new Sound();
var sound2:Sound= new Sound();
var sound3:Sound= new Sound();
var sound4:Sound= new Sound();
sound1.load(new URLRequest("music/Swerve_City.mp3"));
sound2.load(new URLRequest("music/Poltergeist.mp3"));
sound3.load(new URLRequest("music/Romantic_Dreams.mp3"));
sound4.load(new URLRequest("music/Gauze.mp3"));

function dragStartS(e:MouseEvent){
    e.currentTarget.startDrag();
}
function dragEndS(e:MouseEvent){
    e.currentTarget.stopDrag();
    if (swerve1.hitTestObject(speaker1)){
            SoundMixer.stopAll();
            sound1.play(0);
            title.text="  Swerve City";
            swerve1.x= 218.30;
            swerve1.y= 135.10;
    }
    else if (polt1.hitTestObject(speaker1)){
            SoundMixer.stopAll();
            sound2.play(0);
            title.text="  Poltergeist";
            polt1.x= 217.55;
            polt1.y= 165.35;
    }
    else if (rd1.hitTestObject(speaker1)){
            SoundMixer.stopAll();
            sound3.play(0);
            title.text="Romantic Dreams";
            rd1.x= 217.55;
            rd1.y= 195.60;
    }
    else if (gauze1.hitTestObject(speaker1)){
            SoundMixer.stopAll();
            sound4.play(0);
            title.text="      Gauze";
            gauze1.x= 217.55;
            gauze1.y= 225.85;
    }
}
function stopMusic(e:MouseEvent){
        SoundMixer.stopAll();
    }
}
function photoGallery(){
    photos1.addEventListener(MouseEvent.CLICK, startGallery);
    photos1.next1.addEventListener(MouseEvent.CLICK, nextPhoto);
    photos1.prev1.addEventListener(MouseEvent.CLICK, prevPhoto);

    function startGallery(e:MouseEvent){
        photos1.gotoAndStop(2);
    }
    function nextPhoto(e:MouseEvent){
        photos1.nextFrame();
    }
    function prevPhoto(e:MouseEvent){
        photos1.prevFrame();
    }
}
} }


非常感谢您的帮助。

您的代码不是已经进入第2帧了吗?


photos1.gotoAndPlay(2)

没有。看,我有一段文字“乐队照片”,这是电影剪辑。当用户在主舞台上点击时,我希望movieclip的第二帧显示在舞台上。第二帧是画廊的起点。我可能把这一切都搞错了。以上只是其中gallery部分的代码。有完整的代码会有帮助吗?我认为这是个好主意。不过我还是不完全确定你的意思。编辑了我的代码,所以它就在那里。所以是的,电影剪辑基本上应该作为打开和启动我的画廊的链接。我认为我正在尝试做的是不可能的。基本上,我必须在这个项目的某个地方使用nextFrame()。我只是想增加一个画廊来完成这个。如果我试图做的是错误的,任何建议将不胜感激。睡着了,我明天早上再查。谢谢你的回复!你能告诉我你现在的产量是多少吗?一些截图会很方便。