Need help using _level script for pages

Hi,

I have attached a zip file which has a main.fla and a folder pages which contains 2 fla’s p1.fla and p2.fla

The main page loads the first page which is p1 and as the main page has 2 buttons i am using _level script to know which page to load, actually i wanted to create 3 buttons. Since i have already created 2 buttons the first page automatically loads but when i click on the 2nd button it does’nt the p1 page goes but it comes back again.

In the main there is a movie clip which has an instance name of page_mc and the code inside it is:


 
nextpage="pages/p1.swf";
loadMovieNum(nextpage,1);
b1.onRelease = function() {
 if (nextpage!="pages/p1.swf") {
  nextpage="pages/p1.swf";
  _root._level1.page_mc.gotoAndPlay("close");
 }
}
b2.onRelease = function() {
 if (nextpage!="pages/p2.swf") {
  nextpage="pages/p2.swf";
  _root._level1.page_mc.gotoAndPlay("close");
 }
}
 

Please if someone can help me with this, I would appericiate it.

Thanks,
Regards,
Ibrahim.