
Insert and position controls 207
The documentation describes a method called getMostPopularPosts. The method returns a
number of posts with the most clicks in the last 30 days. For each post returned, the following
information is provided: postId, clicks, dateTimeAggregated, feedId, feedName, postTitle,
postExcerpt, postLink.
The method takes two required numeric parameters:
■ daysBack specifies the number of days you want to go back.
■ limit specifies the total number of posts you want returned; the number can’t exceed 50.
With this information, you can use an RPC service component called WebService to consume
the web service and retrieve the data you want—a list of the most popular posts in the last 30
days.
Insert and position controls
In this section, you create the layout of your reporting application. You decide to use a
ComboBox control to let the users set the number of top posts to list, and a DataGrid to
display the top posts.
1. With your Lessons project selected in the Navigator view, select File > New > MXML
Application and create an application file called Services.mxml.
2. Designate the Services.mxml file as the default file to be compiled by right-clicking
(Control-click on Macintosh) the file in the Navigator view and selecting Set As Default
Application from the context menu.
3. In the MXML editor’s Design mode, drag a Panel container into the layout from the
Layout category of the Components view, and then set the following Panel properties in
the Properties view:
■ Title: Most Popular Posts
■ Width: 475
■ Height: 400
■ X: 10
■ Y: 10
NOTE
For the purpose of these lessons, several application files are used in a single Flex
Builder project. However, it’s good practice to have only one MXML application file
per project.
Comentarios a estos manuales