Introducing Macromedia Firefly Components
Macromedia Firefly Components is a key part of Macromedia Flash MX Data Connection Kit designed to transform Macromedia Flash MX into a powerful application environment for building data-rich Internet applications in minutes. Using Firefly Components, developers can build data-rich applications with the features that users have come to expect from traditional programming environments such as Visual Basic, Delphi, or Java. This article provides an overview of the Firefly Components application framework to help you understand how the Firefly components work together to make your life as a Macromedia Flash MX developer easier.
The Firefly Components suite provides developers with a flexible component-based architecture for retrieving, manipulating, and saving data from multiple data sources. The foundation of this architecture consists of a client-side data management engine that is represented by three components: Connector, Dataset, and Resolver. These components provide developers with complete control over their data.
The Firefly components also provide developers with several visual components, including FxGrid, FxComboBox, and FxEditBox. These components plug in seamlessly to the FxDataSet component, so that users can view and edit their data and the edited data is updated in real time. Multiple visual components can point to the same field in the Dataset. When the value of the field changes or when a new record is selected, all the controls are automatically updated to show the correct value.
Data Access Components
Each of the data access components-Dataset, Connector, Resolver-plays a distinct role in the retrieval, management, and updating of data:
- The Connector component is responsible for retrieving data. There are many flavors of this component, and developers should use the appropriate version for their data source. Each Connector contains additional functionality that is specific to their data source (for example, the SQL Server Connector enables developers to run SQL statements). When the Connector retrieves data, it passes it to the Dataset.
-
The Dataset component is the workhorse of the data access components. It is responsible for mapping complex data structures into rows and fields so that the data can be easily manipulated and displayed in the visual controls. When the data is modified, the Dataset records the changes in an XML-based set of instructions called a DeltaPacket. In addition to these features, the Dataset provides an extensive API that provides developers with complete control over their data, including multifield indexes, filtering, field validation, and master-detail support.
Note: The Dataset component is data source agnostic. It does not care where the data comes from or where it is going. The Connector and Resolver components handle this functionality.
- The Resolver component is responsible for saving data. There are many flavors of this component, and developers must use the appropriate version for their data source. Each Resolver contains additional functionality that is specific to the data source (for example, the SQL Server Connector uses the DeltaPacket to generate an Updategram). When the developer saves the data, the Resolver converts any changes to the original data in the appropriate DeltaPacket, which is then transferred to the data source to update the data.
XML Shadowing Technology
XML Shadowing refers to the process of tracking changes that are made to the Dataset in real time and generating a DeltaPacket that can be sent to the server to update the original data source. This process enables developers to create optimized applications that can update changes to multiple records at one time, thus reducing network traffic and allowing multiple users to work with and update the same data source simultaneously.
The Dataset uses the Resolver component to create the DeltaPacket when the data is changed. The Resolver component has an intimate understanding of the remote data source. This partnership enables Firefly Components to generate DeltaPackets that are very specific to the type of data source (XML, SQL Server, or Remoting) that is being updated.
Standard Plug-ins
Each of the Firefly Components plug-ins (XML, Remoting, SQL Server) includes a specialized Connector and Resolver component. These components are built with an intimate understanding of their respective data source. Many of the Connectors contain additional properties that take advantage of specific functionality that is provided by the data source, such as the ability to retrieve data with a query or a server-side template. The Resolvers contain similar functionality and are responsible for converting the changes that are made to the data into a DeltaPacket that can be read by the server (for example, the XML Resolver uses XPath statements to define which nodes are changed in an XML file).
Using this architecture, additional plug-ins can be built to read and write data from other sources such as Oracle, SOAP, and .NET. Simply changing the plug-in allows your application to talk to another data source without having to rewrite your code.
Visual Property Editor
The Firefly Components Visual Property Editor (VPE) makes it easier for developers to build rapidly data-rich applications within Macromedia Flash MX. Components such as FxGrid, FxDataSet, Connector, and Resolver have their own VPE which combines all of the properties, events, and settings that can be used to set up and customize the component. In addition, components such as FxGrid support live preview so that changes made at design time can be viewed by the developer.

There is more information about Macromedia Firefly Components you should check out at the Macromedia Flash MX Data Connection Kit product page, including case studies, documentation, and sample applications.