PDA

View Full Version : flash array issue please help



wdaniel
12-03-2008, 08:14 AM
http://dabblewrench.dynalias.com/index.swf

look at link above or see attached zip.




problem,

if you scroll left and right it works the way i want it to.
now if you hit the center btn while display says (exit) it goes to the main screen, witch is great.
now if you hit the center btn while the display says (Main Menu Speed dial feature ?) it says (speaddial)typo , but at this point i need the left and right arrows to run through a different array witch says different things.
i guess my question is how do i switch to another array while using the same buttons.



i have a dynamic text field

Var name is myText




layer action script


var myArray = new Array();
myArray[0] = "Main Menu \nSpeed dial feature ?";
myArray[1] = "Main Menu \nMore features ?";
myArray[2] = "Main Menu \nView active features ?";
myArray[3] = "Main Menu \nCall Log ?";
myArray[4] = "Main Menu \nProgram/Service ? ";
myArray[5] = "Main Menu \nPhone settings ? ";
myArray[6] = "Main Menu \nExit ? ";
myNumber = 6;

var Check = new Array();
Check[0] = "maindate";
Check[1] = "speaddial";
Check[2] = "3";
Check[3] = "4";
myNumber2 = 3;



myText = "maidate";






left btn action script



// On release of the Mouse Button do the following...
on (release) {

// Subtract 1 from myNumber
myNumber = myNumber-1;
myText = myArray[myNumber];
if (myNumber < 0) {
// Display the following
myText = myArray[myNumber = 6];
}

}





right btn actionscript



// On release of the Mouse Button do the following...
on (release) {

// Subtract 1 from myNumber
myNumber = myNumber+1;
myText = myArray[myNumber];
if (myNumber > 6) {
// Display the following
myText = myArray[myNumber = 0];
}

}




center btn actionscript



// On release of the Mouse Button do the following...
on (release) {




if (myText == myArray[6]) {
// Display the following
myText = Check[myNumber2 = 0];
}

if (myText == myArray[0]) {
// Display the following
myText = Check[myNumber2 = 1];
}

}

wdaniel
12-04-2008, 07:40 PM
someone please

sunder
12-05-2008, 08:58 AM
I'll take a look at this when I can. Till then, if someone can assist that would be great.

sunder
12-05-2008, 04:11 PM
You should be able to use an if check with another variable to switch arrays based on a desired trigger like the center button.
So on release of the center button, set a value to 0 or 1 or a boolean to the not of itself. Then use this for checks on the left and right buttons.

wdaniel
12-06-2008, 07:16 PM
thanks I'll give it a shot