So, you now have all this data into your Flex application from PHP, you would want to use this data. How do you do it? Well, in this part of the series, I will explain how to use text from PHP in your flex application.
First off: using plain text. Lets say that all that the PHP script returns is a big paragraph of text. To do this, you just make the PHP script print the text. Easy enough. Lets also say that the text is the classic:
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam feugiat augue eu ligula. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla vitae nisl. Ut fringilla. Nunc tincidunt nunc non magna. Duis vestibulum euismod ipsum. Praesent consequat. In ultricies, massa vitae consectetur accumsan, purus nunc adipiscing magna, nec gravida ipsum enim at quam. Nam in arcu. Donec id mauris in dolor gravida faucibus."
Since this is your text, and you are receiving it through an HTTPService in Flex, (Discussed Here) you have it easy. All you have to do is to access the result of your HTTPService, (lets say it's called dataService) by saying dataService.lastResult. You can use this snippet of code several ways. To get it to display in a text field, you just have to make the Text property of the label or text box this: {dataService.lastResult}. The control will now show the text that you fed it.
this can be used on all kinds of controls all over your application.
I know I previously said that this entry would be longer. This was an outright fabricated lie. I have broken the entry up into two entries, one today, and one later on in the week about parsing Image data in your application from the PHP script.
Hang on till then.

Leave a comment