beautypg.com

Adobe Flash Professional CC 2014 v.13.0 User Manual

Page 864

background image

Best practices - SWF application authoring guidelines

To the top

To the top

To the top

About SWF application guidelines
Collecting and formatting data
Sending and processing data
Adding data loading and validation
Using error handling and debugging
Organizing files and storing code
Using the MVC design pattern
Creating secure applications

About SWF application guidelines

The best way to create Flash Professional applications depends on the application you create and the technology that you are using to build the
application.

An online application lets a user influence a website by interacting with it. For example, the application might collect information from the user
(such as a username and password for a registration), information might be added to the site (such as in a forum), or the user might interact in real
time with other site visitors (such as a chat room or interactive white board). Results from the server often appear in the SWF file, depending on
the interaction. These examples are applications that involve the user and different kinds of server interaction. A website that does not use visitor
information or data is not an application (for example, a portfolio, cartoon animation, or static informational site). Flash Professional applications
involve an interactive process between the user, a web application, and a server. The basic process is as follows:

1. A user enters information into a SWF file.

2. The information is converted into data.

3. The data is formatted and sent to a web server.

4. The data is collected by the web server and sent to an application server (for example, ColdFusion, PHP, or ASP).

5. The data is processed and sent back to the web server.

6. The web server sends the results to the SWF file.

7. The SWF file receives the formatted data.

8. Your ActionScript processes the data so the application can use it.

When you build an application, you must select a protocol for transferring data. The protocol alerts the application when data is sent or received, in
what format the data is transferred, and how it handles a server’s response. After data is received in the SWF file, it must be manipulated and
formatted. If you use a protocol, you do not have to worry about data being in an unexpected format. When you transfer data using name-value
pairs, you can check how the data is formatted. Check that the data is formatted correctly, so you do not receive XML formatted data and so the
SWF file knows what data to expect and work with.

Collecting and formatting data

Applications depend on user interaction with the SWF file. Frequently, it depends on the user entering data into forms. Flash Professional provides
many ways you can enter and format data in Flash Professional applications. This flexibility exists because of the capabilities you have with
animation and creative control over the interface, and error checking and validation you can perform using ActionScript.

Benefits from using Flash Professional to build forms to collect data include the following:

Increased design control.

Decreased or no need for page refreshing.

Reuse of common assets.

To save information that you collect from the user, save it in a shared object on the user’s computer. Shared objects let you store data on
a user’s computer, which is similar to using a cookie. For more information on Shared objects, see the sharedObject class in ActionScript
2.0 Language Reference or ActionScript 3.0 Language and Components Reference.

Sending and processing data

857