Adobe
Products

Top destinations

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • SiteCatalyst
  • Students
  • Elements family

Adobe Creative Cloud

  • What is Adobe Creative Cloud?
  • Design
  • Web
  • Photography
  • Video
  • Students
  • Teams
  • Enterprise
  • Educational institutions

Design and photography

  • Photoshop
  • Illustrator
  • InDesign
  • Adobe Muse
  • Lightroom

Video

  • Adobe Premiere
  • After Effects

Web development and HTML5

  • Edge Tools & Services [opens in a new window]
  • Dreamweaver
  • Gaming [opens in a new window]

Adobe Marketing Cloud

  • What is Adobe Marketing Cloud?
  • Digital analytics
  • Social marketing
  • Web experience management
  • Testing and targeting
  • Media optimization

Analytics

  • SiteCatalyst
  • Adobe Discover
  • Insight

Social

  • Adobe Social

Experience Manager

  • CQ
  • Scene7

Target

  • Test&Target
  • Recommendations
  • Search&Promote

Media Optimizer

  • AdLens
  • AudienceManager
  • AudienceResearch

Document services

  • Acrobat
  • EchoSign [opens in a new window]
  • FormsCentral [opens in a new window]
  • SendNow [opens in a new window]
  • Acrobat.com [opens in a new window]

Publishing

  • Digital Publishing Suite

  • See all products
Business solutions

By business need

  • Digital analytics
  • Digital publishing
  • Document management
  • Media optimization
  • Social marketing
  • Testing and targeting
  • Video editing and serving
  • Web development [opens in a new window]
  • Web experience management
  • See all business needs

By industry

  • Broadcast
  • Education
  • Financial services
  • Government
  • Publishing
  • Retail
  • See all industries
Support & Learning

I need help

  • Products
  • Adobe Creative Cloud
  • Adobe Marketing Cloud
  • Forums [opens in a new window]

I want to learn

  • Training and tutorials
  • Certification [opens in a new window]
  • Adobe Developer Connection
  • Adobe Design Center
  • Adobe TV [opens in a new window]
  • Adobe Marketing Center
  • Adobe Labs [opens in a new window]
Download
  • Product trials
  • Adobe Flash Player
  • Adobe Reader
  • Adobe AIR
  • See all downloads
Company
  • Careers at Adobe
  • Investor Relations
  • Newsroom
  • Privacy
  • Corporate Social Responsibility
  • Customer Showcase
  • Contact us
  • More company info
Buy
  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers
  • Adobe Marketing Cloud sales [opens in a new window]
Search
 
Info Sign in
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Welcome,
My Adobe
My orders
My information
My preferences
My products and services
Sign out
My cart
Privacy My Adobe
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out Privacy My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Promotions
Estimated shipping
Tax
Calculated at checkout
Total
Review and Checkout
Adobe Developer Connection / Flex Developer Center / Flex in a Week /

Exercise 5.12: Importing a Flash Catalyst FXP file in Flash Builder

by Trilemetry

Trilemetry
  • Trilemetry, Inc.

Created

13 July 2000

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
Flash Builder 4
Was this helpful?
Yes   No

By clicking Submit, you accept the Adobe Terms of Use.

 
Thanks for your feedback.

Requirements

Prerequisite knowledge

  • Exercise 1.1: Setting up Flash Builder and your project files
  • Exercise 1.4: Adding data to your application
  • Exercise 4.1: Passing data to item renderers for display
  • Exercise 4.2: Displaying dynamic data in a custom item renderer
  • Exercise 4.3: Implementing a Spark item renderer in List-based controls
  • Exercise 5.5: Creating and applying skins
  • Exercise 5.6: Creating custom skin properties

User level

Beginning

Required products

  • Flash Builder 4 (Download trial)

Exercise files:

  • ex5_12_starter.zip (98 KB)
  • ex5_12_solution.zip (108 KB)

Additional Requirements

Flash Catalyst (optional)

  • Try
  • Buy

Adobe Flash Catalyst is an interaction design tool that you can use to wireframe, storyboard, prototype, and design an application. Whether you are a designer or developer, you can create a Flex project in Flash Catalyst that can be imported into Flash Builder, where you can add dynamic data using any of the techniques that you have learned in this training series.

In this exercise, you will import a Flash Catalyst project in Flash Builder. You will first review the generated code and then use the Flash Builder Data/Services tools to add dynamic data to the application. Lastly, you will learn how to import a Flash Catalyst Flex Library Package (FXPL) into Flash Builder and apply a custom skin to the horizontal scroll bar in the application (see Figure 1).

Preview the finished application.
Figure 1. Preview the finished application.

In this exercise, you will learn how to:

  • Import a Flash Catalyst FXP file in Flash Builder
  • Apply dynamic XML data to the application
  • Import an FXPL and use it to skin a component

Create a Flash Builder project from a Flash Catalyst FXP file

In this section you will use an FXP file created using Flash Catalyst to create a project in Flash Builder.

  1. Open Flash Builder.
  2. Select File > Import Flex Project (FXP).
  3. In the Import Flex Project dialog box, browse to the ex5_12_starter.fxp file and click Open.
  4. Click Finish.
  5. In the Package Explorer view, expand the ex5_12_starter project folder to reveal the src > (default package) contents (see Figure 2).
View the main application file.
Figure 2. View the main application file.
  1. Double-click Main.mxml to open the file.

Compile and run the project

In this section you will run the application to see it function.

  1. Click the Run button to run the application.
  2. Scroll the horizontal List to view employees. You should see the items are slightly different when hovered over with the mouse and selected (see Figure 3).
Run the application to explore it.
Figure 3. Run the application to explore it.

Explore the imported project

In this section you will review the code generated by Flash Catalyst.

  1. Return to Flash Builder.
  2. Locate the List control. Note the skinClass property value is components.EmployeeOfTheMonthListSkin.
  3. In the Package Explorer view open the components package and double-click EmployeeOfTheMonthListSkin.mxml to open it. You should see that the opening and closing tags for the file are <s:Skin> tags and that the HostComponent is set to the spark.components.List component (see Figure 4).
Open the EmployeeOfTheMonthList.mxml file to see it is a skin file.
Figure 4. Open the EmployeeOfTheMonthList.mxml file to see it is a skin file.
  1. Locate the DataGroup block and note the value for the itemRenderer property is set to components.RepeatedItem1.
  2. In the Package Explorer view, open the RepeatedItem1.mxml file and review the code.
  3. Rename the RepeatedItem1.mxml file as EmployeeOfTheMonthRepeatedItem.mxml.

Connect to XML data

In this section you will use an external XML file and the Flash builder Data / Services view to add dynamic data to the application.

  1. In a browser navigate to the URL http://www.adobetes.com/f4iaw100/employees.xml. Note the repeating node is the employeeOfTheMonth node (see Figure 5).
View the XML data in a browser.
Figure 5. View the XML data in a browser.
  1. Return to Flash Builder.
  2. Select Data > Connect to XML (see Figure 6).
Select Data > Connect to XML.
Figure 6. Select Data > Connect to XML.
  1. Fill out the Configure XML Service dialog box as follows (see Figure 7):
    • XML Source: URL
    • URL: http://www.adobetes.com/f4iaw100/employees.xml
Enter the URL of the XML file.
Figure 7. Enter the URL of the XML file.
  1. Click Invoke.

    You should see the Select node drop-down menu, Service Name, Service Data and Service Package fields populate as shown in Figure 8.

See the rest of the fields in the dialog box based on the XML file.
Figure 8. See the rest of the fields in the dialog box based on the XML file.
  1. Open the Select node drop down to see the structure of the returned data (see Figure 9). You are selecting the repeating node of the XML file.

    Note the three properties of the EmployeeOfTheMonth node.

Note the selected node of the returned data.
Figure 9. Note the selected node of the returned data.
  1. Click Finish.

    In the Data/Services view you should see the Employees service that contains the getData() operation (see Figure 10). Note the getData() operation is data-typed to the EmployeeOfTheMonth[] type as specified in the Configure XML Service dialog box.

View the service in the Data/Services view.
Figure 10. View the service in the Data/Services view.

Bind data to the application

In this section you will use the data service created in the previous section to populate the List control with dynamic data.

  1. Return to the Main.mxml file in Flash Builder.
  2. Switch to Design mode.
  3. From the Data/Services view, drag the getEmployees(): Object operation and drop it on the List control (see Figure 11).
Drag the getData() operation and drop it on the List control.
Figure 11. Drag the getData() operation and drop it on the List control.

You should see the Bind Operation dialog box open and display a message stating the component is already bound to data.

  1. Click OK.
  2. In the Bind To Data dialog box, from the Label field drop-down menu select the blank option (see Figure 12). The repeated item in the List control displays more than just one field.
Select the blank value for the Label field.
Figure 12. Select the blank value for the Label field.
  1. Click OK.
  2. In the Package Explorer view open the components package and then open EmployeeOfTheMonthRepeatedItem.mxml.
  3. Click the RichText control above the image to select it.
  4. In the Properties view change the value of the text property to reference the month value in the data (see Figure 13).
Change the RichText control's Text binding.
Figure 13. Change the RichText control's Text binding.
  1. Right-click the RichText control and select Apply Current Property to All States.
  2. Select the Image control and use the Properties view to change the Source binding to {data.image} (see Figure 14).
Change the Image control's Source binding.
Figure 14. Change the Image control's Source binding.
  1. Click the Refresh button next to the Source and Design mode button to refresh Design mode.
  2. Right-click the Image control and select Apply Current Property to All States.
  3. Switch to the hovered state.
  4. Select the RichText control below the image and use the Properties view to change the Text binding to {data.name} (see Figure 15).
Change the RichText control's Text binding.
Figure 15. Change the RichText control's Text binding.
  1. Right-click the RichText control and select Apply Current Property to All States.
  2. With the RichText control selected switch to Source mode.
  3. To the RichText control add the visible.normal property with a value of false and the color.selected property with a value of yellow (#FFF000).
<s:RichText visible.normal="true" color.selected="#FFF000" ... />
  1. Save the file and run the application.

    You should see the employee information is now dynamically populated in the List control and the application functions as it did at the beginning of the exercise (see Figure 16).

Run the application.
Figure 16. Run the application.

Import an FXPL and use it to skin a component

In this section you will learn how to import a Flex Library Package file (FXPL) as a project in Flash Builder and how to make access classes from it in your primary project.

  1. Return to Flash Builder.
  2. Select File > Import Flex Project (FXP).
  3. In the Import Flex Project dialog box, browse to the scrollbar.fxpl file and click Open.
  4. Click Finish.

    You should see the scrollbar project listed in the Package Explorer view.

  5. Open the scrollbar project and review its contents. Note the files in the components package, specifically the CustomScrollbar.mxml file. This is the file that will be referenced from the Flex library package as the name of the skin. The other MXML files represent the skin parts for the scrollbar (see Figure 17).
View the scrollbar project in the Package Explorer view.
Figure 17. View the scrollbar project in the Package Explorer view.
  1. In the Package Explorer view select the ex5_12_starter project and then select Project > Properties.
  2. In the Properties for ex5_12_starter dialog box click the Flex Build Path from the options on the left (see Figure 18).
Select Flex Build Path.
Figure 18. Select Flex Build Path.
  1. Click the Add Project button.
  2. In the Add Library Project dialog box select the scrollbar project and click OK.

    You should see the scrollbar library is now listed in the Build path libraries (see Figure 19).

See the scrollbar package is now available in the Build path libraries.
Figure 19. See the scrollbar package is now available in the Build path libraries.
  1. Click OK.

Apply the Library to a component

In this section you will learn how to apply an imported FXPL as a component skin.

  1. Open EmployeeOfTheMonthListSkin.mxml.
  2. Switch to Design mode and select the scrollbar component.
  3. In the Properties panel change the Skin value to components.CustomScrollbar (see Figure 20).
Change the Skin package in the Properties panel.
Figure 20. Change the Skin package in the Properties panel.
  1. Save the file and run the application.

    You should see the scroll bar for the application is now skinned based on the imported FXPL (see Figure 21).

Run the application to see the custom skin applied to the scroll bar.
Figure 21. Run the application to see the custom skin applied to the scroll bar.

Test your knowledge

In this exercise, you learned how to create a data model using typed data.

What file type is use to represent both Flash Catalyst and Flash Builder projects?

The FXP file type.

What step must first be done to be able to use an FXPL to skin an existing component?

The FXPL must first be imported as a Flex project. Then the library may be added to the Build path libraries and applied as a skin.

Products

  • Adobe Creative Cloud
  • Creative Suite
  • Adobe Marketing Cloud
  • Acrobat
  • Photoshop
  • Digital Publishing Suite
  • Elements family
  • SiteCatalyst
  • For education

Download

  • Product trials
  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR

Support & Learning

  • Product help
  • Forums

Buy

  • For personal and professional use
  • For students, educators, and staff
  • For small and medium businesses
  • Volume Licensing
  • Special offers

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2013 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

Ad Choices

Reviewed by TRUSTe: site privacy statement