MACROMEDIA FLEX-GETTING STARTED WITH FLEX Uživatelský manuál Strana 41

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 148
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 40
that the HTTPService generates. You can see this in Ex-
ample 3-5.
Example 3-5. The second import statement
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
]]>
</mx:Script>
4. Create a bindable private variable named photoFeed of
the ArrayCollection class after the import statement in
the mx:Script block. The photoFeed ArrayCollection is
populated with the HTTPService response data. Exam-
ple 3-6 shows the completed script.
Example 3-6. The completed script
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
[Bindable]
private var photoFeed:ArrayCollection;
]]>
</mx:Script>
With the bindable XML variable created, it’s time to create the
Submit button click handler, and send the HTTPService request
and keywords to the Flickr API:
1. Using the Outline view, locate the Button component in
the HBox component. Clicking the Button component in
the Outline view locates the Button component code in
Source mode. This is shown in Figure 3-6.
A Flickr Viewer | 25
Zobrazit stránku 40
1 2 ... 36 37 38 39 40 41 42 43 44 45 46 ... 147 148

Komentáře k této Příručce

Žádné komentáře