Hi issanasr13,
What timeline have you written the code on? This will determine what path you need to use to load the 'pages'. I suggest placing all your code on the _root timeline in frame 1.
You also need to use the correct parameters when using attachMovie(idName, instanceName, depth)
e.g. If your code is on the _root timeline, the code below will attach a movieClip from the library, with a linkage ID name of 'home' to the _root timeline. It will have an instance name of 'home_mc' and a depth relevant to the next highest available depth.
Code:
// Set up pages array
var pages_array:Array = new Array();
pages_array[0] = "home";
pages_array[1] = "about";
pages_array[2] = "links";
// initialise page number and name
var pageNum:Number = 0;
var pageName:String;
// function to handle the new page
function setPage():Void {
pageName = pages_array[pageNum];
var instanceName:String = pageName + "_mc";
this.attachMovie(pageName, instanceName, this.getNextHighestDepth());
}
// call the setPage function
setPage();
Regards
Paul