Trying to fix a library tutorial for my school. NEED HELP ASAP!
Navigation through tutorial is created using labels (dialog1, dialog2, ...etc) and NEXT button. I really need to add BACK button, but I bump into an issue of unloading some movie clips that played in a previous dialog. So the back button that I created works...
back_btn.addEventListener(MouseEvent.CLICK, mDHb3);
function mDHb3(event:MouseEvent):void {
gotoAndPlay("dialog2");
}
...but the old movie is still on the screen when I go BACK. I played around with code for a while trying to unload, but can't get it to work. If I write something for unloading a movie in Dialog2 when the movie plays from the start it doesn't understand the code for obvious reasons.
---------------------------------------------------------------------
ORIGINAL CODE from Dialog3:
stop();
//slide portrait character out
portraitTeacherSlide = new Tween(portrait_holder_mc, "x", Back.easeOut, portraitTeacher.x + 606, portraitTeacher.x + 786, 15);
//load portrait character
var portrait_loader2:Loader = new Loader();
//load the boy portrait
portrait_loader2.load(new URLRequest("library_boy.swf"));
portrait_holder2_mc.addChild(portrait_loader2);
//set original position for portrait character
var portraitBoy
oint = new Point(-440, 48);
portrait_holder2_mc.x = portraitBoy.x;
portrait_holder2_mc.y = portraitBoy.y;
var portraitBoySlide:Tween;
//slide portrait character in
portraitBoySlide = new Tween(portrait_holder2_mc, "x", Back.easeOut, portraitBoy.x, portraitBoy.x + 456, 15);
//mouse down handler for dialog box
dialog3.addEventListener(MouseEvent.CLICK, mDHd3);
function mDHd3(event:MouseEvent):void {
gotoAndPlay("dialog4");
}
flash.media.SoundMixer.stopAll();
var dialog3_speech:Sound = new Sound(new URLRequest("sound/dialog3.mp3"));
var sc_dialog3:SoundChannel;
sc_dialog3 = dialog3_speech.play();
//mouse down handler for MOUSE IN
repeat.addEventListener(MouseEvent.CLICK, mDHrepeat3);
function mDHrepeat3(event:MouseEvent):void {
flash.media.SoundMixer.stopAll();
sc_dialog3 = dialog3_speech.play();
}
//mouse down handler for dialog box
next_btn.addEventListener(MouseEvent.CLICK, mDHn3);
function mDHn3(event:MouseEvent):void {
gotoAndPlay("dialog4");
}
//------------------------
//mouse down handler for MOUSE IN
repeat.addEventListener(MouseEvent.MOUSE_OUT, mDHOrepeat);
//mouse down handlers for the answers
next_btn.addEventListener(MouseEvent.MOUSE_OUT, next_mDHO);
-------------------------------------------------------------------------
Navigation through tutorial is created using labels (dialog1, dialog2, ...etc) and NEXT button. I really need to add BACK button, but I bump into an issue of unloading some movie clips that played in a previous dialog. So the back button that I created works...
back_btn.addEventListener(MouseEvent.CLICK, mDHb3);
function mDHb3(event:MouseEvent):void {
gotoAndPlay("dialog2");
}
...but the old movie is still on the screen when I go BACK. I played around with code for a while trying to unload, but can't get it to work. If I write something for unloading a movie in Dialog2 when the movie plays from the start it doesn't understand the code for obvious reasons.
---------------------------------------------------------------------
ORIGINAL CODE from Dialog3:
stop();
//slide portrait character out
portraitTeacherSlide = new Tween(portrait_holder_mc, "x", Back.easeOut, portraitTeacher.x + 606, portraitTeacher.x + 786, 15);
//load portrait character
var portrait_loader2:Loader = new Loader();
//load the boy portrait
portrait_loader2.load(new URLRequest("library_boy.swf"));
portrait_holder2_mc.addChild(portrait_loader2);
//set original position for portrait character
var portraitBoy
oint = new Point(-440, 48);portrait_holder2_mc.x = portraitBoy.x;
portrait_holder2_mc.y = portraitBoy.y;
var portraitBoySlide:Tween;
//slide portrait character in
portraitBoySlide = new Tween(portrait_holder2_mc, "x", Back.easeOut, portraitBoy.x, portraitBoy.x + 456, 15);
//mouse down handler for dialog box
dialog3.addEventListener(MouseEvent.CLICK, mDHd3);
function mDHd3(event:MouseEvent):void {
gotoAndPlay("dialog4");
}
flash.media.SoundMixer.stopAll();
var dialog3_speech:Sound = new Sound(new URLRequest("sound/dialog3.mp3"));
var sc_dialog3:SoundChannel;
sc_dialog3 = dialog3_speech.play();
//mouse down handler for MOUSE IN
repeat.addEventListener(MouseEvent.CLICK, mDHrepeat3);
function mDHrepeat3(event:MouseEvent):void {
flash.media.SoundMixer.stopAll();
sc_dialog3 = dialog3_speech.play();
}
//mouse down handler for dialog box
next_btn.addEventListener(MouseEvent.CLICK, mDHn3);
function mDHn3(event:MouseEvent):void {
gotoAndPlay("dialog4");
}
//------------------------
//mouse down handler for MOUSE IN
repeat.addEventListener(MouseEvent.MOUSE_OUT, mDHOrepeat);
//mouse down handlers for the answers
next_btn.addEventListener(MouseEvent.MOUSE_OUT, next_mDHO);
-------------------------------------------------------------------------





Linear Mode

