AS3 two arrays targeting same destination - how to?
I need help with arrays. I have a project like a book. Each table of content title is linked to a page. At the same time the user will have all page numbers available to navigate at will. I have been able to work links or pages, but not both together.
HERE IS MY CODE
stop();
PAGES ARRAY
var pagesArray:Array = [page1_1, page1_2, page1_3, page1_4, page1_5, page1_6, page1_7, page1_8, page1_9, page1_10,
page1_11, page1_12, page1_13, page1_14, page1_15, page1_16, page1_17, page1_18, page1_19,page1_20,
page1_21, page1_22, page1_23, page1_24, page1_25];
TABLE OF CONTENT ARRAY
var linksArray:Array = [link_1, link_2, link_3, link_4, link_5, link_6, link_7, link_8, link_9, link_10,
link_11, link_12,link_13, link_14,link_15, link_16, link_17, link_18, link_19,link_20,
link_21, link_22, link_23];
FRAME LABELS ARRAY
var paginationArray:Array = ["chap1_1", "chap1_2", "chap1_3", "chap1_4", "chap1_5", "chap1_6", "chap1_7", "chap1_8", "chap1_9", "chap1_10",
"chap1_11", "chap1_12", "chap1_13", "chap1_14", "chap1_15", "chap1_16", "chap1_17", "chap1_18", "chap1_19", "chap1_20",
"chap1_21", "chap1_21", "chap1_22", "chap1_23"];
var bothArrays:Array = [pagesArray, linksArray];
for (var q:int = 0; q < bothArrays.length; q++) {
bothArrays.buttonMode = true;
bothArrays.addEventListener(MouseEvent.CLICK, activeHandler60);
}
function activeHandler60(event:MouseEvent):void {
for (var q:int = 0; q < bothArrays.length; q++) {
if (event.currentTarget == bothArrays) {
this.gotoAndStop(paginationArray);
bothArrays.mouseEnabled = false;
bothArrays.alpha = 0.2;
page1_1.mouseEnabled=true;
page1_1.alpha=1;
} else {
bothArrays.mouseEnabled = true;
linksArray.alpha = 1;
}
}
}
// LABELING BUTTONS
page1_1.txt1.text="1"; page1_2.txt1.text="2"; page1_3.txt1.text="3"; page1_4.txt1.text="4"; page1_5.txt1.text="5";
page1_6.txt1.text="6"; page1_7.txt1.text="7"; page1_8.txt1.text="8"; page1_9.txt1.text="9"; page1_10.txt1.text="10";
page1_11.txt1.text="11"; page1_12.txt1.text="12"; page1_13.txt1.text="13"; page1_14.txt1.text="14"; page1_15.txt1.text="15";
page1_16.txt1.text="16"; page1_17.txt1.text="17"; page1_18.txt1.text="18"; page1_19.txt1.text="19"; page1_20.txt1.text="20";
page1_21.txt1.text="21"; page1_22.txt1.text="22"; page1_23.txt1.text="23"; page1_24.txt1.text="24"; page1_25.txt1.text="25";
Thanks for your help.
German