Macromedia Studio 8 [Electronic resources] : Training from the Source

Jeffrey Bardzell, Shaowen Bardzell

نسخه متنی -صفحه : 240/ 159
نمايش فراداده

Lesson 13. Dynamic, Data-Driven Sites

The word

dynamic means many different things in the world of Web development. You might have heard of a Web technology called Dynami216 (DHTML), which enables developers to control the behavior of the browser and screen content when a page is browsed. A client-side technology, DHTML runs entirely in the browser, relying on JavaScript.

Macromedia Flash developers often strive to create a "dynamic" experience, in which users have control over their experience of a Flash movie; the map of the

Inferno you just completed is an example. Like DHTML, Flashat least as you have used it so faris primarily a client-side technology; all the ActionScript you wrote, all the assets you created, and so on are passed to the Flash player in the user's browser, and the Flash player figures out what to show the user.

This quiz is built in Flash using components. Test data is collected in Flash and submitted to a database using ActionScript and ColdFusion.

[View full size image]

From this lesson to the end of the book, "dynamic" takes on yet another, and more robust, meaning. Thanks to the power and ease of Macromedia ColdFusion, you'll create sites that act as interfaces to databases. You'll pass data between pages, enable users to view data loaded dynamically from databases, and write to databases. Later, you'll even create a quiz application in Macromedia Flash 8 that saves users' scores and identities to the database. ColdFusion is a server-side technology, which means that the code is executed on the server, and only the results are sent to the browser.

The hallmark feature of server-side dynamic sites (created with ColdFusion or an equivalent technology, such as ASP or PHP) is that page content is generated on the fly. That is, you and I might both request the exact same page (such as www.amazon.com), and yet the page we each see is entirely different. Mine greets me by name and places front and center an odd mix of computer books and mystery novels that represents my buying habits. What you see on the Amazon site is likely to be different. For starters, you won't see "Hello, Jeffrey Bardzell" at the top of your page.

You will not, in just four lessons, learn how to produce anything as sophisticated as Amazon.com's Web site. The development of Web applications is a serious topic whose mastery takes years of study and practice. The good news is that you don't need to spend years studying and practicing to create a handful of useful applications. Such Web staples as Web forms that save user input to databases take a matter of minutes (depending on their length) to set up, using Dreamweaver and ColdFusion. Developing pages that display specific database records is likewise a simple task. Using Dreamweaver and ColdFusion together, it's surprisingly easy to create environments where users have to log in to access content.

In the final four lessons of this book, you'll create a Web application that combines several of these elements. The dante_admin.cfm page displays a list of all the students in the class, and provides one-click email access to them. You'll also create a Flash-based quiz that outputs the user's test score to ColdFusion. ColdFusion then sends this data in two directions: it outputs the final test score to the browser so the user can see it, and inserts the score into the database so the instructor can see how the students are doing.