Skip to main content
Known Participant
August 10, 2011
Question

How create an input form for iOS with variable number of fields? - Need scroll

  • August 10, 2011
  • 1 reply
  • 1462 views

Hello

I'm trying to create an App for iOS (iphone or iPad) and need to create an input form with varible list of fields, so the length of the list is variable and I will need to scrool the screen ... which is the best way to do this?

Thank you?

This topic has been closed for replies.

1 reply

Inspiring
August 11, 2011

Add a scroller with a TileGroup or a VGroup in it.

The next part depends of your needs. Is it completely dynamic (you render a form from an external XML file) or you just want to hide some fields sometimes?

The latter is easy to implement... You can declare all your fields and add them to the VGroup (vGroup.addElement()) in the creationComplete handler.

If it's a dynamic form, you will have to parse the file in the creationComplete handler and create fields in AS3 and add them to the vGroup. To save the user answers, you will have to look at the VGroup elements, note their class and their ID and interpret the answer.

I did an app that can render huge forms from XML files and it works. Of course, it's a bit slower (parse the file and render the form (my forms are complex) can take 1 or 2 seconds on a real device).

If you can be more precise and have more questions, I can help you for this

Known Participant
August 11, 2011

Hi

Thanks for your help, I've done a Big MC with all the frames and Text input fields, 23 in total, all this I made it in the stage in design time, then I sellect all the fields and convert it in a MC. (called FORM1)

Then (always in design time) I added a ScrollPane to the Stage (called PANEL)

By ActionScript 3, in code i use:

PANEL.source=FORM1 // to assign the MC with the input text fields to the scroll, works fine

My problem now is that when I try to reach one of the input text fields inside FORM1 (called FIELD_Name) I use

FORM1.FIELD_Name.text = sysName

This give me a error 1119

Do you know how can I reach (reference) a input text field that is in a MC that is a source for a Scroll pane?

Thanks a lot