Book Image

Flash with Drupal

Book Image

Flash with Drupal

Overview of this book

Due to its power and expandability, Drupal has become one of the most popular open source content management systems. At the same time, Flash has been adopted for its ability to create beautiful and dynamic web applications. By combining these technologies, you can create Flash applications that are both visually stunning and rich in content. This book is an in depth discussion and tutorial on how to integrate Flash applications with Drupal CMS. It will describe the best techniques and practices for integrating Flash technology with the power and flexibility of Drupal by building real-life Flash applications. Within this book, you will learn how to build Flash applications that show text from within Drupal and also present images, music, and video within a single Flash application. You will also be able to take advantage of the expandable fields and content filtering provided from the CCK and Views modules to add flexibility and power to your Flash applications. Finally, you will learn how to add your own custom functionality to Drupal and then utilize that from within your Flash applications leaving you with a world of possibilities. This book starts out with a simple introduction to Flash and Drupal technology where you will create a simple Flash application and then embed that within Drupal. From there, each subsequent chapter builds on the previous chapters tackling a new and challenging task. For each new task, you will take a step-by-step approach to building a real-life application that utilizes the feature introduced within that chapter. You will also explore alternative design approaches that will eliminate the current design challenges that developers face when building Flash-driven Drupal sites; and all this while staying true to the Object Oriented Principles that govern the foundation of the ActionScript 3 language. By the end of this book, you will be able to apply all the lessons learned from this book to any other use case you may encounter.
Table of Contents (17 chapters)
Flash with Drupal
Credits
About the Author
About the Reviewer
Preface

Adding Flash content to Drupal


There are many ways to add Flash content to Drupal, but what I am going to cover in this section is what I have found to be the easiest. Thanks to the wonderful Drupal community, there is already a fantastic module that was built to easily add Flash applications to Drupal. This module is called FlashNode and can be found at http://www.drupal.org/project/flashnode. Within this project page, we need to download the latest version for Drupal 6. We can determine a module's Drupal version by taking a look at the first number in the package version, where 6.x means it is for Drupal 6. After we have downloaded the version build for Drupal 6, which was version 6.x-3.1 at the time of writing, we can install this module in our local host Drupal installation.

Installing a contributed Drupal module

The first thing that we need to do to install a Drupal module is locate our Drupal installation that we placed in our computer earlier in this chapter. Within this directory, we should see the following files:

If we open up the sites folder, we should then see an all and a default folder. These folders are used to separate the files, modules, and themes for any web site that is sharing the single Drupal installation (called multisite). For example, if we wish to install a module for all of our web sites, then we would place this new module within the all folder. However, if we just wish to include this module in the default site (which is the site we are using right now), then we will have to place the module within the default folder. In a typical multisite configuration, there would be a separate folder within the sites directory for each web site that is being run off the single Drupal installation. But for our purposes, we will use the default folder for any additional module that we install to our Drupal web site. So, within the default folder, we will need to create a new folder called modules, and then place the extracted contents of the flashnode module within this directory as follows:

Now that we have the flashnode module in the right location on our server, we can navigate to our Drupal web site by going to http://localhost/drupal6. Once we are there, we can go to our administrator section by clicking on the Administer link on the left menu. Once we are within our Drupal administration section, we will click on the Modules link. Throughout this book I will refer to this type of navigation as saying "navigate to Administer | Modules".

Once we are within the Modules section, we can scroll down to the bottom of the page and enable the FlashNode module by clicking on the checkbox next to this module, and then clicking on the Save Configuration button at the bottom of the page.

Adding Flash!

We are now ready to add our Flash application to Drupal. We will first click on the Create Content link from the left navigation menu, and then select Flash from the list of items.

We will then see the Create Flash page, where we will start by giving our new Flash node a title.

After this, we will select the Flash file that we just created by clicking on the Browse button next to the Flash file input field, and then selecting our SWF file using the file browser window.

Finally, we can scroll down to the bottom of the page, where we can click on the Save button. Congratulations, you have added Flash to Drupal!