This content has been marked as final. Show 10 replies
* HTTPService protocol
* e4x resultFormat
* ViewStack as a main container
* HBox with buttons for navigation
would be my advice.
Tracy, what is "e4x resultFormat"???
E4X: A new approach to XML processing
Until now, the ECMAScript edition 4 draft language specification (also known as ECMA-262), which is the basis for the core ActionScript 3.0 language, had no way of working with XML data. Earlier versions of ActionScript (from ActionScript 1.0 in Flash 5 and later) had classes and methods for working with XML data, but they were not based on the ECMAScript standard.
The new ECMAScript for XML specification defines a new set of classes and functionality for working with XML data. These classes and functionality are known collectively as E4X. ActionScript 3.0 includes the following new E4X classes: XML, XMLList, QName, and Namespace.
The methods, properties, and operators of the E4X classes were developed with the following goals:
* Simplicity--Where possible, E4X makes it easier to write and understand code for working with XML data.
* Consistency--The methods and reasoning behind E4X are internally consistent and consistent with other parts of ActionScript.
* Familiarity--You manipulate XML data with well-known operators, such as the dot (.) operator.
Tracy is referring to the resultFormat property of the HTTPService. Setting the resultFormat to e4x will have Flex parse the XML returned from the service. You can read more about HTTPService here:
I stumbled upon the viewStack component probably around the same time you posted your response... thanks! :)
I have jumped in with both feet, building the UI first before trying to figure out how I'm going to collect this information and store it on the server... not even a database design yet, which I'm fine with for now.
A related question at this point: My MXML file is getting really big, because the survey is quite large with a lot of questions and a lot of choices per question. It would be great if each Canvas in my ViewStack could be in a separate MXML file, separating them somewhat so they are less cumbersome. Is it possible to somehow put them in their own MXML files, and then "include" them in the master MXML file? Should I be considering a different solution?
You should build a UI that retrieves that stuff from the backend, mabye a few different "template" question layouts and then depending on what step you are on the backend loads the data for that step, you app reads whats needed and sets the template to visible and then adds the needed text to the template and waits for the next step to be acivated by the user.
In short, try to do everthing on the backend that you can, you dont need anything other then the UI and functionality in your flex app, all the data should be handled by your backend.
I'm sorry to bug you with a non-technical discussion, but I am a recruiter in San Diego. My client is in need of 3 Senior Flex Developers for their project. I have had an extremely rough time finding someone for this position. Would you be interested in this position, or do you know of anyone that might be? We do pay referral fees. This position may be open to telecommuting.
They are in the midst of a major re-architecting of their Corporate Management system utilizing many cutting edge technologies. As it relates to the position they are using Flex as their UI.
This is either a contract, or a full-time position.
Pay: Market Rate
Thanks for your help!
Thanks for your response. I agree with your statement in theory (certainly!), but since this is my first real project with Flex, and it's a tight deadline, I need to be careful not to take on too much at once. For now, the UI is implemented using a ViewStack with between one and four questions per canvas. Yes, it's making for a larger MXML file, but right now this is the only way I can conceive of doing this without burying myself in more unknowns. A little at a time... if I can't find a way to break it up, I'll just leave it whole for now. The app itself is not slow at all, so things are going okay so far.
There is one benefit to doing it this way - the survey downloads in full, and doesn't need to communicate with the server again until the user completes it in full and submits. This has an added benefit, I *think*, if I can get it to do it - the internet connection doesn't come into play as the person completes the survey, and perhaps I can detect an error when the survey is submitted, and ask the user if they'd like to submit the survey via an XML file containing their answers instead... so that they never lose their work no matter what happens with their internet connection. The app could check to make sure the connection to the server is valid upon final submit, and if for some reason it's not, it could ask them if they want to save a "special" (XML) file to their system for later submission once their internet connection is working again.
Is something like this possible, and if so, where should I start looking?
The UI is nearly done, at which point I need to move on to validation, and finally, storage of the survey-taker's answers.
The app could check to make sure the connection to the server is valid upon final submit, and if for some reason it's not, it could ask them if they want to save a "special" (XML) file to their system for later submission once their internet connection is working again.
I love this function, however, how do u save the data? Use the shareObject of Flash?? or Ask the user click "save my data" button?
Flash Player can export text data directly? (Since you can't use web program like php to export the data)
Here's an update to how I'm considering putting this survey app together:
-- An MXML file that contains entire UI
-- A separate mxml file, and the use of the mx:Model source="separateFileName.mxml" tag, to create an object called "Survey", that contains MXML representing the Questions and Answers in the survey, data-bound to the UI components and making it possible to do validation at each step/ViewStack canvas
-- A CFC that accepts the Survey object upon submit of the survey, and parses it/stores it as I see fit.
Is this a reasonable, simple course of action that has any chance of success?
I am trying to build a similar application. However, I want the questions to be loaded from an external XML file. That way the same application can be used to deploy many surveys.
The problems I have are:
Each question has an attribute startPage (= yes or no). So, if yes, how do I create a new page?
Each question can be of a different type (or not). For instance questions can be open ended, multiple choice w/one or with multiple answers, matrix format, etc. Also, a question type could be drag and drop the corresponding elements, assigning priorities and more.
Thus, How I can render the different questions?
I can make a component for each type, but how I tell the program to show / not show a question.