Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

So I have the code for all of this except for one thing. A list of buttons appears with how many players are playing on the android game.. When an amount is clicked, all visibility on "frame1" switches to false and all visibility on "frame2" switches to true (given the amount of players selected of course. 2 = player 1 and player 2 are visible, 5 = player 1,2,3,4,5 are visible, etc..) Here is my code and a picture to epxplain what I've got.

In this example, 10 players were selected obviously.

arrayhelp

stop()

import flash.events.Event;
import flash.text.TextFormat;
import flash.text.TextFormatAlign;



var list:TextFormat = new TextFormat();
list.align = TextFormatAlign.CENTER;
list.size = 40;

quantityList.setRendererStyle("textFormat", list);



answerBoxes.visible = (false);
submitbtn.visible = (false);
plyrs.visible= (true);
names.visible= (false);


quantityList.setStyle("contentPadding", 5);
quantityList.rowHeight = 64;




quantityList.addItem({label:"2", data:2});
quantityList.addItem({label:"3", data:3});
quantityList.addItem({label:"4", data:4});
quantityList.addItem({label:"5", data:5});
quantityList.addItem({label:"6", data:6});
quantityList.addItem({label:"7", data:7});
quantityList.addItem({label:"8", data:8});
quantityList.addItem({label:"9", data:9});
quantityList.addItem({label:"10", data:10});

quantityList.addEventListener(Event.CHANGE, changeHandler);





function changeHandler(event:Event):void
{

quantityList.visible = (false);
answerBoxes.visible = (true);
submitbtn.visible = (true);
plyrs.visible= (false);
names.visible= (true);

var tinput:TextFormat = new TextFormat();
tinput.align = "center";
tinput.size = 21; 

answerBoxes.answer1.setStyle("textFormat", tinput);
answerBoxes.answer2.setStyle("textFormat", tinput);
answerBoxes.answer3.setStyle("textFormat", tinput);
answerBoxes.answer4.setStyle("textFormat", tinput);
answerBoxes.answer5.setStyle("textFormat", tinput);
answerBoxes.answer6.setStyle("textFormat", tinput);
answerBoxes.answer7.setStyle("textFormat", tinput);
answerBoxes.answer8.setStyle("textFormat", tinput);
answerBoxes.answer9.setStyle("textFormat", tinput);
answerBoxes.answer10.setStyle("textFormat", tinput);

var numberOfQuestions = event.target.selectedItem.data as int;

answerBoxes.answer1.visible = (numberOfQuestions > 0 ? true : false);
answerBoxes.answer1.text=("PLAYER 1")
answerBoxes.answer2.visible = (numberOfQuestions > 1 ? true : false);
answerBoxes.answer2.text=("PLAYER 2")
answerBoxes.answer3.visible = (numberOfQuestions > 2 ? true : false);
answerBoxes.answer3.text=("PLAYER 3")
answerBoxes.answer4.visible = (numberOfQuestions > 3 ? true : false);
answerBoxes.answer4.text=("PLAYER 4")
answerBoxes.answer5.visible = (numberOfQuestions > 4 ? true : false);
answerBoxes.answer5.text=("PLAYER 5")
answerBoxes.answer6.visible = (numberOfQuestions > 5 ? true : false);
answerBoxes.answer6.text=("PLAYER 6")
answerBoxes.answer7.visible = (numberOfQuestions > 6 ? true : false);
answerBoxes.answer7.text=("PLAYER 7")
answerBoxes.answer8.visible = (numberOfQuestions > 7 ? true : false);
answerBoxes.answer8.text=("PLAYER 8")
answerBoxes.answer9.visible = (numberOfQuestions > 8 ? true : false);
answerBoxes.answer9.text=("PLAYER 9")
answerBoxes.answer10.visible = (numberOfQuestions > 9 ? true : false);
answerBoxes.answer10.text=("PLAYER 10")
}

So anyway, the thing I need help with is after the players have entered their names on "frame2" and click submit, I need the visible text input fields that were used, to add to an array and display at the top of the next frame I've shown here. When the "Next turn" button is hit, I need it to display the next name, then hit again, the next name in order frame by frame.

arrayhelp2 Here's the kicker.. Each frame displayed when the "Next Turn" button is hit.. Is a random frame.. So I need the array to display the names in order when "Next Turn" is hit. But the frames will not. I've already got the random frame code, I don't need that or anything..

Anyway, sorry about this LOONGG explanation but I figured provided pictures, code, and the issue may help me out more..

Thank you everyone so much in advance..

share|improve this question
When the user selects Submit after entering the names of x amount of players, are you starting a new Activity? Do you need the actual EditText or just the text that was entered? If you need the text that was entered and that's what you want to display at the top of the screen in your next frame/activity, then why don't you just use EditText.getText.toString() and store them in an array that way? Maybe I'm confused as to what you're looking for exactly – Jade Byfield Nov 5 '12 at 20:59
I just need the text that was entered, it will display in a dynamic text box on the next frame. And I'm fairly new to Actionscript so I'm not exactly sure the best way to use arrays/strings.. :( – johnscott1989 Nov 5 '12 at 21:15

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.