ebook img

Flash with Drupal PDF

380 Pages·2009·9.954 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Flash with Drupal

Flash with Drupal Build dynamic, content-rich Flash CS3 and CS4 applications for Drupal 6 Travis Tidwell BIRMINGHAM - MUMBAI Download at Boykma.Com This material is copyright and is licensed for the sole use by Richard Ostheimer on 15th June 2009 2205 hilda ave., , missoula, , 59801 Flash with Drupal Copyright © 2009 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: May 2009 Production Reference: 1200509 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-847197-58-0 www.packtpub.com Cover Image by Gabriela y la pintura ([email protected]) Download at Boykma.Com This material is copyright and is licensed for the sole use by Richard Ostheimer on 15th June 2009 2205 hilda ave., , missoula, , 59801 Credits Author Editorial Team Leader Travis Tidwell Abhijeet Deobhakta Reviewer Project Team Leader Steve Zeidner Lata Basantani Acquisition Editor Project Coordinator David Barnes Joel Goveya Proofreader Development Editor Laura Booth Swapna V. Verlekar Technical Editor Production Coordinator Aditi Srivastava Aparna Bhagat Cover Work Copy Editor Aparna Bhagat Ajay Shanker Indexer Hemangini Bari Download at Boykma.Com This material is copyright and is licensed for the sole use by Richard Ostheimer on 15th June 2009 2205 hilda ave., , missoula, , 59801 About the author Travis Tidwell is the founder and CTO for TMT Digital (http://www. tmtdigital.com), a company that specializes in the development of Flash applications for the Drupal Content Management System. He is also the sole developer for the Dash Media Player (http://www.tmtdigital.com/project/ dash_player, http://www.drupal.org/project/dashplayer), which is a media player built specifically for Drupal. As well as contributing to this media player, Travis is also the author and co-maintainer for the FlashVideo module (http://www. drupal.org/project/flashvideo), which is a complete video solution for Drupal. Travis graduated with a degree of Bachelors of Science in Electrical and Computer Engineering from Oklahoma State University and has worked as an Embedded Systems Engineer for companies specializing in automotive and agricultural GPS products. Travis then fell in love with web development and more specifically with Drupal and Flash, where he has developed numerous sites including http://www.delicioso.com for Food Networks, Ingrid Hoffmann. In his spare time (which is rare these days), Travis enjoys the performing arts where he sings, plays the guitar, and even tap dances (go to http://www.youtube.com and search for "Soul Man Tap" to see him in action). Travis currently lives in Des Moines, IA with his beautiful wife Erin, and is the proud parent of a feisty one-year-old named Brycen. I would like to thank my wife, Erin, who has stood by me and supported me through the long evenings and weekends where I pursued my passions, including writing this book. Without her support, I would not be where I am today. Download at Boykma.Com This material is copyright and is licensed for the sole use by Richard Ostheimer on 15th June 2009 2205 hilda ave., , missoula, , 59801 About the reviewer Steve Zeidner is a web developer who has been using Perl, PHP, ActionScript, Flash, and other technologies to design and code web sites and web applications since 1999. In the past, he has been involved in educational projects such as Moodle and WeBWorK while pursuing his degree in Computer Science and Engineering at The Ohio State University. After completing his undergraduate Computer Science studies, Steve went on to develop his SQL database, web programming, and IT administration skills at the Ohio Farm Bureau Federation. In 2007, he became the lead web developer at Guardian Enterprise Studios, where he broadened his knowledge and use of web design elements with content management systems as well as PHP, Perl, and MySQL database integration. He currently resides in Columbus, Ohio and has an interest in social media and how the Web is changing the way people communicate. Download at Boykma.Com This material is copyright and is licensed for the sole use by Richard Ostheimer on 15th June 2009 2205 hilda ave., , missoula, , 59801 Download at Boykma.Com This material is copyright and is licensed for the sole use by Richard Ostheimer on 15th June 2009 2205 hilda ave., , missoula, , 59801 Table of Contents Preface 1 Chapter 1: Flash with Drupal 7 Why Flash with Drupal? 8 Who is this book for? 8 Getting started with Drupal 9 Installing Drupal 9 Installing Apache-MySQL-PHP (AMP) 9 Creating the Drupal database 10 Creating a database user 11 Increasing PHP memory 12 Installing Drupal 12 Adding content to Drupal 16 Getting started with Flash 17 Creating a new Flash project 18 Setting up the workspace 18 A: The Stage 19 B: The Toolbar 19 C: The Timeline 20 D: The Properties panel 20 E: The Color Palette 21 F: The Library 21 Creating a Flash application 21 Creating a background 21 Rectangle properties 22 Adding a gradient 23 Adding text to a Flash application 24 Text properties 25 Compiling our Flash application (making a SWF) 25 Publish Settings 26 Adding Flash content to Drupal 27 Installing a contributed Drupal module 28 Adding Flash! 30 Summary 32 Download at Boykma.Com This material is copyright and is licensed for the sole use by Richard Ostheimer on 15th June 2009 2205 hilda ave., , missoula, , 59801 Table of Contents Chapter 2: Building a "Hello World" Application 33 How Flash and Drupal communicate 33 Understanding web services 34 Synchronous versus asynchronous programming 36 Setting up Drupal for web services 38 Installing and configuring the Services module 38 Servers and Services 38 Installing AMFPHP 39 Services configuration 41 Creating a Services key 41 Services settings 43 Service Permissions 43 Building a web service-driven "Hello World" application in Flash 44 Step 1: Creating our Flash application 45 Step 2: Creating a main.as ActionScript file 45 Step 3: Connecting to Drupal 46 Step 4: Session handling 50 Connecting to Drupal using system.connect 50 Step 5: Drupal says "Hello World" 51 Loading a node in Flash 52 Step 6: Hooking up the text 55 Step 7: Passing the node ID using FlashVars 57 Step 8: Adding it to Drupal 58 Summary 59 Chapter 3: Flash and CCK 61 Overview of a typical recipe web site 61 Using Drupal's Content Construction Kit 62 Creating a new content type 63 Adding custom fields to your Recipe content type 65 Adding a new field 66 Changing the default Body field 69 Showing CCK fields in Flash 70 Building a Recipe widget in Flash 71 Adding dynamic TextFields for Drupal content 72 Using ActionScript to show Drupal CCK fields 74 Using the Services Administrator 74 Showing CCK information in ActionScript 76 Adding ScrollBars to our TextFields 79 Creating a Drupal node template for Flash 82 Using the Content Template module (Contemplate) 82 Summary 85 Chapter 4: Drupal Images in Flash 87 Image handling in Drupal 87 ImageField for CCK 88 [ ii ] Download at Boykma.Com This material is copyright and is licensed for the sole use by Richard Ostheimer on 15th June 2009 2205 hilda ave., , missoula, , 59801 Table of Contents Installing the ImageField module 88 Adding an Image field to our Recipe content type 89 Adding an image to our Recipe node 90 Verifying that the image is attached 91 Adding an image to our Recipe Flash application 92 Adding a MovieClip container for our image 93 Using ActionScript to load the Recipe image 95 Resizing an image 100 Preserving the width and height ratio (scaling) 102 Using Drupal's ImageCache with Flash 104 Creating an ImageCache preset 104 Adding an ImageCache image in Flash 106 Adding the new Recipe Flash application to Drupal 108 Summary 109 Chapter 5: Drupal Audio in Flash 111 Working with audio in Drupal 111 Installing the getID3 library 113 Setting up the Audio content type 114 Creating an Audio node 115 How our player will be different (and better) 116 Building a custom audio player for Drupal 117 Examining the Audio node using Services Administrator 117 Referencing the audio file path 118 Writing a custom AudioPlayer class 119 Playing audio in Flash 121 Using our AudioPlayer class to play audio 122 Adding controls to your custom audio player 123 Adding a play and pause button 123 Creating a base button MovieClip 124 Adding the PlayButton movie clip 125 Creating a pause button from the play button 127 Linking MovieClips to ActionScript 128 Adding the AudioPlayer to the stage 130 Modifying the AudioPlayer class to use play and pause 131 Step 1: Adding the SoundChannel 131 Step 2: Adding load, play, and pause functions 132 Step 3: Reference the mcAudioPlayer MovieClip 133 Step 4: Hooking up our buttons! 133 Modifying our main.as file to use our new AudioPlayer 136 Summary 137 [ iii ] Download at Boykma.Com This material is copyright and is licensed for the sole use by Richard Ostheimer on 15th June 2009 2205 hilda ave., , missoula, , 59801

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.