Button script help

I have the following code on a button that i am using to load movies into content_mc:

on (release) {
if (_root.section != “link1”) {
_root.content_mc.gotoAndPlay(“unload”);
_root.section = “link1”;
_root.loader.gotoAndPlay(“load”);
}
}

I want the content_mc to fully finish the exit transition before loading in the new section. Maybe an if statement would work

on (release) {
if (_root.section != “link1”) {
_root.content_mc.gotoAndPlay(“unload”);
}
if (_root.content_mc == the last frame—frame label “end”) *help with syntax
_root.section = “link1”;
_root.loader.gotoAndPlay(“load”);
}
}

im just having trouble with syntax, any ideas?

on the last frame of the content_mc have it set a variable in the root equal to true. Then just look for the variable.
Would look like this:
[AS]
//on last frame of content_mc
_root.done = true;
//whereever the heck your other code is
on (release) {
if (_root.section != “link1”) {
_root.content_mc.gotoAndPlay(“unload”);
}
if (_root.done){
_root.done = false;
_root.section = “link1”;
_root.loader.gotoAndPlay(“load”);
}
}
[/AS]

Hope that helps,
Shawn