Go Back   kirupaForum > Flash > Flash IDE

Reply
 
Thread Tools Display Modes
Old 12-21-2009, 05:41 PM   #1
islandlaura
Registered User
back button problem, need to unload movie

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 portraitBoyoint = 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);

-------------------------------------------------------------------------
islandlaura is offline   Reply With Quote

Sponsored Links (Guests Only) - Register | Need Help?

Reply

Tags
back button, unload movieclip


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:25 AM.

SHARE:

SUPPORTERS:

cdn
content delivery network (cdn)

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. Copyright 2010 - kirupa.com Copyright 2010 - kirupa.com