Using Multiple Actions in Flash CC
hello. new flash cc. trying hand @ simple dress doll game. have made doll base, different skin types in respective frames, , next , previous buttons move skin color skin color. code using next , previous buttons:
stop()
btn1prev.addeventlistener(mouseevent.click, backward);
btn2next.addeventlistener(mouseevent.click, forward);
function forward(event:mouseevent) {
if (this.currentframe == this.totalframes) {
gotoandstop(1);
}
else {
nextframe();
}
}
function backward(event:mouseevent) {
if (this.currentframe == 1) {
gotoandstop(this.totalframes);
}
else
{
prevframe();
}
}
then added 3 new layers, each different eye color on them (brown, blue, , green). want these dragged , dropped onto doll. started brown , added action layer:
browneyes.addeventlistener(mouseevent.mouse_down, dragbrowneyes);
function dragbrowneyes(eyt:mouseevent):void{
addchild(movieclip(evt.currenttarget));//to place above other content
evt.currenttarget.startdrag();
stage.addeventlistener(mouseevent.mouse_up, dropbrowneyes);
}
function dropbrowneyes(evt:mouseevent):void{
stopdrag();
stage.removeeventlistener(mouseevent.mouse_up, dropbrowneyes);
}
when try each of these codes on own, work fine. when try use them both in same file, none of them work. eyes cannot move , skin types flash instead of moving when press buttons.
here video of me adding drag , drop action pressing ctrl+enter play game (so can see how dragndrop not work , neither buttons, skin types flash by) :
this shows in compiled errors :
again, i'm new, don't understand these actions. found them online.
any , mucho appreciated. using flash through creative cloud on pc (windows 7), updated, , using action script 3.
i try attach screen shots. show
my timeline : showing layers , frames
my actions next , previous buttons
my whole screen : actions window minimized
*i plan on adding multiple items of clothing later on move it's place whne clicked on. appreciated well
show code you're trying use when coding 3 eye colors.
More discussions in ActionScript 3
adobe
Comments
Post a Comment