1. Trang chủ
  2. » Công Nghệ Thông Tin

Wrox adobe AIR create modify reuse apr 2008 ISBN 0470182075 pdf

483 104 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 483
Dung lượng 5,3 MB

Nội dung

Adobe® AIR™ Create-Modify-Reuse Marc Leuchner Todd Anderson Matt Wright Wiley Publishing, Inc Adobe® AIR™ Create-Modify-Reuse Acknowledgments vii Introduction xv Chapter 1: The Development Environment Chapter 2: Simple Text Editor 21 Chapter 3: Simple RSS Reader 47 Chapter 4: Music Player 69 Chapter 5: Mini CMS 123 Chapter 6: Image Viewer and Editor 161 Chapter 7: HTML and CSS Editor 205 Chapter 8: Weather Widget 239 Chapter 9: Map Application 285 Chapter 10: Blogger Agent 333 Chapter 11: Slideshow Maker 375 Chapter 12: AIR Video Player 419 Index 447 Adobe® AIR™ Create-Modify-Reuse Marc Leuchner Todd Anderson Matt Wright Wiley Publishing, Inc Adobe® AIR™ Create-Modify-Reuse Published by Wiley Publishing, Inc 10475 Crosspoint Boulevard Indianapolis, IN 46256 Copyright © 2008 by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-0-470-18207-9 Manufactured in the United States of America 10 Library of Congress Cataloging-in-Publication Data is available from the publisher No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600 Requests to the Publisher for permission should be addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317) 572-4355, or online at http://www.wiley.com/go/permissions Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose No warranty may be created or extended by sales or promotional materials The advice and strategies contained herein may not be suitable for every situation This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services If professional assistance is required, the services of a competent professional person should be sought Neither the publisher nor the author shall be liable for damages arising herefrom The fact that an organization or Website is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Website may provide or recommendations it may make Further, readers should be aware that Internet Websites listed in this work may have changed or disappeared between when this work was written and when it is read For general information on our other products and services please contact our Customer Care Department within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002 Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc and/or its affiliates, in the United States and other countries, and may not be used without written permission Adobe and AIR are trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries All other trademarks are the property of their respective owners Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book Wiley also publishes its books in a variety of electronic formats Some content that appears in print may not be available in electronic books Luchner fauth.tex V3 - 03/20/2008 2:36pm About the Authors Marc Leuchner is a Senior Flash Developer for the Boston-based advertising group Almighty His roles and talents within the company primarily revolve around Flash development and interactive design Over the years, he has worked with clients such as New Balance, ABC, Cond´e Nast, PUMA, BMW/Mini, Comcast, and GAP, Inc Marc holds a BFA in New Media/Design from the Rochester Institute of Technology In his spare time, he writes the technology blog www.nobien.net/ with co-author Matt Wright Todd Anderson is a Senior Software Engineer for Infrared5 With over five years of developing for the Flash Platform in the areas of RIA and game development, Todd has delivered web and desktop solutions for the publishing and entertainment industries for companies including McGraw-Hill, Thomson, Motorola, and Cond´e Nast He runs www.custardbelly.com/blog, focusing on development of the Flash Platform and game development Matthew Wright is a Senior Flash Developer for ROKKAN, a full-service digital agency located in New York City Since 2005 he has delivered mostly consumer experience Flash sites and applications for a wide array of clients, including Virgin America, the Coca-Cola Company, Atlantic Records, Time Warner, the NBA, and 2K Games Prior to ROKKAN, he got his start at an interactive agency in Syracuse, New York, called 2ndNature It was here that he discovered his love for the Flash platform Outside of work, Matthew contributes to a Flash and technology blog www.nobien.net, with friend, colleague, and co-author Marc Leuchner He has also spoken at FlashForward Matthew lives in Brooklyn, New York, with his beautiful girlfriend, Chewy Page v Luchner fcredit.tex V3 - 03/20/2008 Credits Executive Editor Production Manager Chris Webb Tim Tate Development Editor Vice President and Executive Group Publisher Brian Herrmann Richard Swadley Technical Editor Vice President and Executive Publisher Ashley Atkins Joseph B Wikert Production Editor Project Coordinator, Cover Daniel Scribner Lynsey Stanford Copy Editor Proofreader Luann Rouff Nancy Bell Editorial Manager Indexer Mary Beth Wakefield Ron Strauss 2:36pm Page vi Luchner fack.tex V3 - 03/20/2008 2:36pm Acknowledgments Marc Leuchner I would like to thank co-authors Todd Anderson and Matt Wright for their excellence and dedication in writing this book and for being terrific friends I am excited that you two took charge and made the book your own To Ash Atkins, your editing and knowledge was greatly needed and well received To the people at Wiley, Chris Webb, and especially Brian Herrmann, I thank you for the opportunity to write this excellent book Brian, I know it was sometimes difficult to beat the chapters out of us, but we really appreciate your editing, support, and humor throughout this past year I would like to thank Joey Lott and Matt Sutton for helping me into the world of writing And thanks to my family and friends for their support and encouragement over the past year, especially my parents, who have been nothing but supportive in my career Lastly, I would especially like to thank my girlfriend, Courtney Your understanding and commitment has meant so much to me, particularly during those busy weekends and sleepless nights Todd Anderson I would like to thank Marc Leuchner and Matt Wright for being excellent co-authors in this endeavor and lending expertise and humor while writing this book To my family, I could not thank you enough for the huge support and love — my wonderful wife, Carrie, Mom, Dad, Brian, Krissa, Emma, Kelsea, and Cayuga I would also like to thank my friends and the huge support I get from the Flash community Big thanks and a shaking fist go out to Ash Atkins, who provided invaluable wisdom during the tech editing process Lastly, I would like to thank Brian Herrmann, Chris Webb, and the Wiley team for their patience, understanding, and hard work Matt Wright First, I’d like to thank the people at Wiley for giving me the opportunity to write a book on a topic I truly enjoy In particular, I’d like to thank Chris Webb for trusting me to write my first book on a brand-new technology It’s not often that one gets such an opportunity Second, I’d like to thank Brian Herrmann and Ash Atkins for being such awesome and helpful editors Without them this book would have no legs to stand on I’d also like to send many thanks to my co-authors, Todd Anderson and Marc Leuchner These two guys are both brilliant and motivating I only wish we could work together more often My appreciation also goes out to my family, most importantly my mother and father, for supporting me and my career Without them I wouldn’t be where I am today Lastly, I’d like to send a huge thank-you to my girlfriend, Chewy, for all her support and patience during the writing of this book Page vii Luchner c12.tex V3 - 03/20/2008 Chapter 12: AIR Video Player Once the package is created, navigate to your working directory If the video player packaged correctly, you should have an AIRVideoPlayer.air file Execute the AIRVideoPlayer.air package in order to install the application on your hard drive Once it is installed, open it, drag and drop the included video into your new video player, and enjoy the show Summar y This chapter covered how to utilize the VideoDisplay component included in the Flex API in combination with other components and classes such as the HSlider and DataFormatter to create a fully featured video player component capable of playing FLV or H.264 encoded video It introduced the idea of creating a liquid component layout that allows for resizing to any video content width and height In building the video player component, the chapter discussed how to create a player that can be used with or without the AIR SDK Once the video player was created, you learned how to implement the component in an AIR application The AIR Video Player uses the NativeDragManager and NativeMenu to provide users with access to playing videos Lastly, you learned how to enable full-screen video support through setting the stage.displayState, and how to adjust the layout of the application accordingly As a result of all these features, the AIR Video Player is capable of playing multiple formats and can be customized and distributed cross-platform As stated earlier in this chapter, the intention of this player wasn’t necessarily to create a video player with a lot of bells and whistles, but to create a good base for you to improve on You could take this application and add features such as playlist support, custom skins, a custom slider (in place of the HSlider), multiple window support, controller effects such as fading in and out when full-screen, or anything else that you can think of The video player is yours to utilize either in Flex or in AIR; it is left to you to perhaps create the next QuickTime killer app 446 2:35pm Page 446 Index A accounts, managing (Blogger Agent), 334–335 ActionScript API, 189 integrating with JavaScript, 216, 309 ActionScript Messaging Format (AMF), 376 addBlog function (Blogger Agent), 353–354 AddBlogPanel component, 358–361 AddPropertyPrompt component, 230 address bar component (HTML and CSS Editor), 206–209 AddStylePrompt component, 226, 228–229 Adobe FlexBuilder, XML News Aggregator (AXNA), 47 ADT -certificate command, 12 AIR (Adobe Integrated Runtime) API, 376 Debug Launcher (ADL), 3, Developer Tool (ADT), 4, 12 downloading/installing, SDK, Video Player See Video Player application AIR basic application code and explanation, 5–8 compiling, 8–9 installing Hello World, 13–15 overview, 4–5 previewing and debugging, 9–13 uninstalling Hello World, 15–16 airAMP See Music Player application (airAMP) AIRVideoPlayer.mxml context menus, 441–442 creating, 433–438 drag and drop capabilities, 439–440 full-screen viewing, 443–444 implementing UIVideoPlayer component 439 resizing videos, 442–443 window menus, 440–441 alwaysInFront property (Weather Widget), 281 AMF (ActionScript Messaging Format), 376 amxmlc compiler, 3–4, animating views (Weather Widget), 281–282 Apache Ant build markup, 16–20 application directory, defined, 14–15 application shell (HTML and CSS Editor), 231–233 application storage directory, 15 application tags (descriptor files), applicationComplete event (RSS Reader), 63 ApplicationDataModel class (Music Player), 77–78 applyFilter() method, 191 applyHandler() method, 102 AspectRatio property (Video Player), 432 associated file types, defined, 415 AtomUtil class (Blogger Agent), 343 authentication, user (Blogger Agent), 347 autoPlay property (Video Player), 432 autoRewind property (Video Player), 432 AXNA (Adobe XML News Aggregator), 47 AXNAFeedService class, 52 B -benchmark option, BitmapData objects, encoding, 162 Blogger Agent application, 333–374 basics, 333 blog entries, managing, 335 BlogEntry class, 335 Blogger Data API, 334–335, 343, 347–348 BloggerAgent-app.xml, 373 BloggerAgent.mxml, 370–372 Blogger Agent application (continued) Blogger Agent application (continued) BloggerService class, 334–335, 343–348, 358, 361–362, 367 BlogManager component, 335–336 BlogManagerPanel component, 362–364, 372 data objects, 337–339 DBService class, 348–356 deploying, 372–373 design of, 333–337 event objects, 339 features of, 334 Google Blogger service, 333 main application file, 370–372 QueueService class, 356–358 user interface, creating, 358–370 utility classes, 340–343 body.innerHTML property, 212 BottomControls component (Music Player), 110–113 browseForDirectory method (Music Player), 102 browser-based Flash content, 333–334 browsing opened image files, 171–181 buildSettingsData method Music Player, 102 Weather Widget, 262 ByteArray objects, 162, 198 C camera input, capturing (UIVideoPlayer), 433 Canvas component, Flex, 233 canvas, slide, 384, 412 carousel, slide, 384, 393–396, 412 Cascading Style Sheets (CSS) See CSS (Cascading Style Sheets) certificate authorities, 4, 237, 330 certificates Blogger Agent, 373 RSS reader, 66–67 self-signed, 12, 237, 416–417 storing, 12 chromeless applications (Weather Widget), 278–279 448 classes data management (CMS), 133 data object classes (Blogger Agent) 337–339 RSS reader, 52, 57–58 settings (CMS), 127 utility classes (Blogger Agent), 335, 340–343 Clipboard instances, 197 close application functionality (Music Player), 118–120 CMS (content management system) application See Mini CMS application code for basic AIR applications, 5–8 codecs in Flex SDK, 198 color transformations, 189–191 ColorMatrixFilter, 191 command-line tools (AIR SDK), 3–4 compile tasks (ANT), 19–20 compiling and packaging AIR applications, 8–9, 158 Blogger Agent, 373 Image Viewer and Editor, 201–202 Map application, 330–332 Music Player, 121–122 RSS reader, 66–67 Slideshow Maker, 416–418 Video Player, 445–446 Weather Widget, 284 completeHandler()method, ComposeEntryPanel component (Blogger Agent), 335–336, 364–368, 372 element ( declaration), 416 context menus (AIRVideoPlayer.mxml), 420, 441–442 createPopUp method (Music Player), 101–102 CSS (Cascading Style Sheets) CSSEditorEvent class, 216, 230 cssRuleIndex property, 215 CSSStyle data classes, 226 CSSStyleProperty objects, 215, 229 data, managing, 213–216 editor overview, 213 user interface and logic, 216–231 CurrentWeatherView MXML component (Weather Widget), 263–265 D data handling (CMS), 125, 133–141 data handling (Image Viewer and Editor) data object, creating, 162–164 data objects, managing, 165–167 queuing image files, 167–170 data handling (Maps) data model, 289–290 overview, 286 querying database, 290–299 value objects, 286–289 data handling (Music Player) access and parsing, 79 ApplicationDataModel class, 77–79 data objects, 72–77 external XML, 71–72 FileSearch service See FileSearch service (Music Player) ID3Parser utility, 90–92 SoundManager class, 92–98 XMLFileService service class, 79–84 XMLParserUtil class, 85–86 data handling (RSS reader), 48–49 data handling (Slideshow Maker) managing slides, 381–384 serializable data objects, creating, 376–381 data handling (Weather Widget), 282–283 copying local files, 252 data model class, 247–249 data objects, 242 SettingsVO object, 245–246 TemperatureUtil class, 256–257 WeatherVO class, 242–245 XML settings, 242 XML weather data, 241 XMLFileService class, 249–252 XMLParserUtil class, 254–256 XMLServiceEvent class, 253 data model class (Weather Widget), 247–249 data model (Maps), 289–290 data objects Blogger Agent, 337–339 Music Player, 72–77 serializable (Slideshow Maker), 376–381 Weather Widget, 242 databases, querying (Maps), 290–299 DataGrid component (HTML and CSS Editor), 216, 230 dataProvider, PlaylistView (Music Player), 110 DateFormatter class Music Player, 108 Video Player, 430 DBService class (Blogger Agent), 334–335, 348–356 DBServiceEvent class (Blogger Agent), 339 Debug Launcher, AIR (ADL), 3, debug panel, creating, 20 debugging basic AIR application, 9–13 deployment Blogger Agent, 372–373 CMS, 158–159 defined, HTML and CSS Editor, 236–237 Image Viewer and Editor, 200–202 Map, 329–332 Music Player, 121–122 RSS Reader, 65–66 Slideshow Maker, 414–418 Video Player, 444–446 Weather Widget, 283–284 element ( declaration), 416 description property, descriptor files basics, Blogger Agent, 372–373 CMS, 158 Image Viewer and Editor, 200–201 Map application, 329–330 Music Player, 121 RSS reader, 65–66 Slideshow Maker, 414–416 Video Player, 445 Weather Widget, 283–284 deserialize() method, 287, 381 destinations, displaying (Map), 314–316 Developer Tool, AIR (ADT), 4, 12 development environment Apache Ant build markup, 16–20 building AIR applications See AIR basic application 449 Index development environment development environment (continued) development environment (continued) command-line tools (AIR SDK), 3–4 debug panel, creating, 20 Flex SDK installation, 1–4 installing Hello World, 13–15 overview, uninstalling Hello World, 15–16 DigestToaster class (RSS reader), 57–59 directories browsing for (Music Player), 102 Music Player structure, 71 Video Player structure, 420–421 Weather Widget structure, 240–241 display view (Maps), 299 displaying SettingsPanel component (Music Player), 101–102 doLayout() method, 180, 188 domWindow property, 206, 235 dot-delimited reverse-DNS-style strings, drag-and-drop AIRVideoPlayer.mxml, 420, 439–440 API of Flex framework, 309 API, opening/saving with, 196–198 E editing images, 188–190 encryptPassword method (Blogger Agent), 356 event handlers CSS Editor, 229 DBService class (Blogger Agent), 354–355 HTML and CSS Editor, 234–236 event objects (Blogger Agent), 339 executeStatement function (Blogger Agent), 353 Extensible Markup Language (XML) See XML (Extensible Markup Language) element ( declaration), 416 F feeds defined, 47 parsing (RSS reader), 49–53 files copying local (Music Player), 82 450 descriptor file (CMS), 158 file API, opening/saving from, 199–200 File class, 24 File objects, defined, 26 FileFilter class (text editor), 38 FileMode class, 24 filename element, FileStream class, 24 File.writeBytes()method, 162 fileWrittenHandler, 103 reading and writing (Text Editor), 27–32 SWF file (CMS), 158–159 uploading (CMS), 125, 141–144 writing XML data to (Music Player), 82 FileSearch service (Music Player) adding, 85–88 executing searches, 88 FileSearchEvent, 88–89 MP3FileSearch, 89–90 Flash browser-based Flash content, 333–334 Debugger (FDB), 10–11, 16 flash.data.SQLStatement object, 297 flash.desktop package, 162 flash.desktop.NativeDragManager, 197–198 flash.display.NativeMenu class (RSS reader), 64 Player, 419 Flex API, 419 Canvas component, 233 DataGrid component, 213 Flex SDK, 2–4, 198 PopUpManager class, 226 FourDayForecastView (Weather Widget), 265–267 full-screen video viewing, 420, 443–444 G GalleryDataManager, 164 gateways See remote gateways (CMS) generateThumbnail()method, 180 getBlogs method, 348 getDirectoryListingAsync() method, 70, 88 getElement()method, 53 getEncodedBitmap()method, 198 Google Blogger service, 333 weather site, 241 H H.264 codec, 419 handleAppCreationComplete method, 440 Hello World application creating, 4–5 installing/uninstalling, 13–16 preparing development environment, HSlider component, 107–108, 112–113, 430 HTML and CSS Editor application address bar, 206–209 application shell, building, 231–233 CSS data, managing, 213–216 CSS Editor overview, 213 CSS user interface and logic, 216–231 deploying application, 236–237 design of, 206 event handlers, adding, 234–236 HTML Editor, creating, 209–212 overview, 205–206 HTML document (Maps), 309–313 I icons, image data and (RSS reader), 64–65 ID3Parser utility (Music Player), 90–92 Image Viewer and Editor application browsing opened images, 171–181 building main application file, 191–196 compiling/packaging application, 201–202 data handling See data handling (Image Viewer and Editor) deploying, 200–202 design of, 162 editing images, 188–190 opening/saving from file API, 199–200 opening/saving with drag-and-drop API, 196–198 overview, 161 queuing image files, 167–170 user interface, building, 170 viewing images, 181–188 XML descriptor file, 200–201 images Image component (Maps), 302 image property, 380 ImageCanvas.mxml component, 186 ImageData object, 164 ImageDisplay component, 187–188 init function, 230, 352 initialWindow element, init()method (Music Player), 119 installing Adobe SDKs, 1–4 Hello World application, 13–15 installationFolder property, interfaces, user See user interfaces invalidateAvailability ()method, 302 invalidateImage() method, 389 invalidate()method, 298 invalidateProperties() method, 179–180 invalidateViewScale() method, 388 isAvailable property (RSS reader), 63 ItemData class (CMS), 139 ItemEditor interface component (CMS), 147, 151 J JavaScript communication with ActionScript, 309 integrating with ActionScript, 216 JPEGEncoder codec, 198 L launch tasks (ANT), 19–20 List component, 216 ListDataService class (CMS), 139–140 live scrubbing, 107 -load-config option, loadAll() method, 170 loading view (Weather Widget), 263 loadSong()method, 97 _localDataFile property, 132 location control view (Maps), 299 LocationDisplay.mxml view class (Maps), 309 locations (Map application) displaying, 302–309 451 Index locations (Map application) locations (Map application) (continued) locations (Map application) (continued) LocationsControls class, 320 LocationVO object, 290, 328 M Mac OS X ANT installation on, 17 creating development folder in, 4–5 installing AIR applications on, 14–15 installing Flex SDK on, main application file Blogger Agent, 370–372 Slideshow Maker, 402–412 maintainAspectRatio property (Video Player), 432 Map application compiling/packaging, 330–332 data handling See data handling (Maps) deploying, 329–332 descriptor file, 329–330 design of, 285–286 overview, 285 user interface, building See user interfaces (Maps) markers (Maps) Marker objects, 316 MarkerBank component, 321 marker_red.png graphic asset, 330 MarkerVO class, 289 menus adding to Weather Widget, 279–281 context (AIRVideoPlayer.mxml), 441–442 window (AIRVideoPlayer.mxml), 440–441 Mini CMS application, 123–161 basics, 123 code basics, 125 data management, 125, 133–141 deploying, 158–159 design of, 124–125 files, uploading, 125, 141–144 remote gateways, 124, 125–127 settings, 124–125, 127–133 user interfaces, 125, 144–157 minimizing and restoring (Weather Widget), 281 452 mode controls (Maps) ModeControls class, 327 ModeControls component, 302 view, 299 MP3s See also Music Player application (airAMP) MP3FileSearch, 89–90 SoundManager class and, 92 Music Player application (airAMP), 69–122 data handling, 71–98 deploying, 121–122 design of, 69–70 directory structure, 71 final MXML file, 113–117 musicdatabase.xml, 72 MusicPlayer.mxml, 82, 97, 117 vs , 117–120 playback button control, 107 user interface See user interfaces (Music Player) class, 118, 278 mx.controls.HTML control (Maps), 309 mx.graphics.core package, 162 MXML components (Music Player), 98–113 PlaybackControls See PlaybackControls (Music Player) PlaylistView, 108–110 Settings Panel component, 98–103 tag, class, 278 container, 117, 119 N element ( declaration), 416 name property, native menus, 411 NativeApplication class, 335, 343 NativeDragEvent objects, 192–198 NativeDragManager, 440 NativeMenu class, 279–281 NativeWindow class, 57–58 _nativeWindow private variable, 118 navigating controls (Map application), 316–321 NetworkConnection class (Blogger Agent), 335 NetworkDetection class (Blogger Agent), 343, 372 newDocument() function (Text Editor), 40 nextFile method, 143, 144 O onAlertClose() function (Text Editor), 40 onAppInit function (Text Editor), 26, 234 onCSSEditorAddStyle function, 235 onCSSEditorChangeProperty function, 236 onDirectorySelect() method, 102 onExportSelect() method, 410 onFileSavePanelSelect() function, 39 onHTMLLoadComplete function, 235 onHTMLLocationChange function, 235 onImageLoad() method, 392 onMouseDownHandler method (Music Player), 119 onOpenComplete() function, 31 onViewCreate() method, 388 openFile() function, 30 openItem() method, 410 -output option, P packaging See also compiling and packaging -package command, 12 package tasks (ANT), 19–20 parsing feed (RSS reader), 49–53 parseData()method, 52 parseWeatherXMLFeed methods, 255–256 passwords (Blogger Agent), 356 PHP (PHP Hypertext Preprocessor), 125, 127 PKCS (Public Key Cryptography Standards), 12 play/pause button (Video Player), 431, 433 playback controls (Video Player), 420 PlaybackControls component (Music Player), 103–108 adding, 103–107 basics, 70 button controls, 107 trackInfoDisplay, 107–108 playhead live scrubbing and, 107 monitoring playhead time, 97–98 playheadTime properties, 430–431 playing property (Video Player), 432 playTrackAt() method (Music Player), 110 PNGEncoder codec, 198 Post class (RSS reader), 57 Post.mxml component (RSS reader), 57 posts, displaying (RSS reader), 48, 53–59 PostVO value object (RSS reader), 49, 52–53, 57–58 previewing basic AIR application, 9–13 slides, 393–396 private keys, storing, 12 programMenuFolder property, promptUser () functions (Text Editor), 36–37, 38 properties PropertiesPanel object (Slideshow Maker), 392, 412 propertyChange events, 166 TrackVO object (Music Player), 76 public methods (Blogger Agent), 347 public variables UIVideoControls component, 430 UIVideoPlayer, 432 publishBlogEntry method, 348, 358 PublishQueueItem class (Blogger Agent), 335 PublishQueuePanel component (Blogger Agent), 336–337, 368–370, 372 Q queryDirectoryListToXML() method (Music Player), 87–88 queryDirectoryResults()method (Music Player), 88 querying databases (Maps), 290–299 QueueService class (Blogger Agent), 335, 356–358 453 Index QueueService class (Blogger Agent) reading files (Text Editor) R reading files (Text Editor), 27–32 Really Simple Syndication (RSS) See RSS Reader application refresh interval ComboBox component (Weather Widget), 262 regular expressions, 170 remote gateways (CMS) code, 125–127 design of, 124 resizing resizeToVideo property, 432 UIVideoPlayer, 432 videos, 420, 442–443 restoring and minimizing (Weather Widget), 281 returnID3Information() function (Music Player), 90, 91 rewind button (Video Player), 431 Rich Internet Application (RIA), rotation controls (Image Viewer and Editor), 187 RSS Reader application, 47–67 basics, 47 compiling/packaging, 66–67 data handling, 48–49 deploying, 65–66 descriptor file, 65–66 design of, 47–48 parsing the feed, 49–53 user interface, building See user interfaces (RSS Reader) Runtime Shared Library (RSL) files, S saving with drag-and-drop API, 196 from file API, 199–200 Save alert window (Slideshow Maker), 399–402 saveFile() function (Text Editor), 32, 40 saveXMLToStorage method (Weather Widget), 262 settings (Music Player), 102 screens Blogger Agent interface, 335–336 Screen class (AIR API), 414 454 scrubbing Music Player playhead, 107 video scrubber control, 430–431 SDKs (Software Development Kits), installing Adobe, 1–4 searches See FileSearch service (Music Player) self-signed certificates Hello World, 12 HTML and CSS Editor, 237 Maps, 330 Slideshow Maker, 416–417 serializable data objects (Slideshow Maker), 376–381 serialize() method, 287, 381 session-related properties, 376 setCredentials method (Blogger Agent), 347, 358 settings utility class (Slideshow Maker), 412–414 SettingsModel class (CMS), 124, 127, 132 SettingsPanel component (Music Player) basics, 70 closing, 102 creating, 98–101 displaying, 101–102 saving settings, 102 SettingsPanel interface component (CMS), 147 SettingsService class (CMS), 127, 132–133 SettingsVO object Music Player, 72–73 Weather Widget, 245–246 SettingsWindow MXML component (Weather Widget), 258–262 settings.xml file Music Player, 71–72 Weather Widget, 242 showVideoControls property, 432 SimpleDebugPanel application, 20 Singleton pattern, 164 slides (Slideshow Maker) canvas, 384 managing, 381–384 modifying, 389–392 presenting, 396–399 previewing, 393–396 SlideImage class, 380–381 viewing, 384–389 Slideshow Maker application compiling/packaging, 416–418 data handling See data handling (Slideshow Maker) deploying, 414–418 descriptor file, 414–416 design of, 376 main file, 402–412 overview, 375 Save alert window, 399–402 settings utility, 412–414 user interface, building See user interfaces (Slideshow Maker) songs, loading (Music Player), 97 SoundManager class (Music Player), 92–98 spawning OS native windows, 376 split method (arrays), 229 SQL (Structured Query Language) SQL injections, defined, 353 SQLStatement class, 298 SQLite database (Blogger Agent) DBService class and, 348, 352 managing accounts and, 334 startQueue function (Blogger Agent), 370 -storetype parameter value (PKCS), 12 Stucki, Ben, 90 styleSheetIndex property, 215 SWF (Shockwave Flash) files Blogger Agent, 373 CMS, 158–159 generating, 3, packaging AIR application with, 237 RSS reader, 66 system tray, RSS Reader and, 48 T tabEnabled attribute (Text Editor), 24 TabNavigator component (Flex), 233 temperature toggle (Weather Widget), 262 TemperatureUtil class (Weather Widget), 256–257 Text Editor application, 21–46 fundamentals, 21, 24–26 interface activation, 40–45 reading/writing files, 27–32 user prompts, 32–40 view, 21–24 Thawte certificate authority, 4, 237 thumb button (airAMP playhead), 107 thumbnails basics, 164 image browser, 171–181 time stamps Music Player, 108 video, 430 toaster alerts, defined (RSS Reader), 53–54 toaster windows (RSS reader), 58–59 tracks (Music Player) changing, 110 trackInfoDisplay, 107–108 trackPosition property, 107 TrackVO object (Music Player), 73–77, 97, 110 TrayIcon class (Weather Widget), 268–270 U UIVideoControls creating, 424–429 explained, 429–431 UIVideoPlayer component creating, 421–429 explained, 431–433 implementing, 439 resizing, 432 unencryptPassword method (Blogger Agent), 356 uninstalling Hello World, 15–16 update function (CSS Editor), 229 UploadService class (CMS), 140, 143–144 URLs (Uniform Resource Locators) remote gateways and (CMS), 124 URLMonitor (RSS reader), 63 user interfaces Blogger Agent, 335–337, 358–370 CMS, 125, 144–157 CSS Editor, 216–231 Image Viewer and Editor, 170 Weather Widget, 257–267 user interfaces (Maps) displaying destinations, 314–316 455 Index user interfaces (Maps) user interfaces (Maps) (continued) user interfaces (Maps) (continued) displaying locations, 302–309 HTML document, 309–313 managing events from view classes, 321–329 navigating controls, 316–321 overview, 299 view modes, 299–302 user interfaces (Music Player) BottomControls component, 110–113 PlaybackControls See PlaybackControls (Music Player) PlaylistView, 108–110 SettingsPanel component, 98–103 user interfaces (RSS reader) posts, displaying, 53–59 RSSReader.mxml, creating, 59–65 user interfaces (Slideshow Maker) modifying slides, 389–392 overview, 384 presenting slides, 396–399 previewing slides, 393–396 viewing slides, 384–389 user interfaces (Weather Widget) CurrentWeatherView MXML component, 263–265 FourDayForecastView view, 265–267 loading view, 263 refresh interval ComboBox component, 262 SettingsWindow MXML component, 258–262 temperature toggle, 262 view states, 257–258 WeatherItem view, 266–267 zip code TextInput component, 261 users RSS reader and, 47–48 user prompts (Text Editor), 32–40 utility classes (Blogger Agent), 335, 340–343 V validation, remote gateway and (CMS), 127 value objects (Maps), 286–289 variables, public UIVideoControls component, 430 UIVideoPlayer, 432 VeriSign certificate authority, 4, 237 456 version attribute, Video Player application AIRVideoPlayer.mxml See AIRVideoPlayer.mxml compiling/packaging, 445–446 deploying, 444–446 descriptor file, 445 design of, 419–420 directory structure, 420–421 overview, 419 resizing videos, 442–443 UIVideoControls, 429–431 UIVideoPlayer component, 421–429, 431–433 video scrubber control, 430–431 video timestamps, 430 videoControls component, 431–432 videoDisplay component, 431–432 viewing full-screen video, 443–444 images, 181–188 slides, 384–389 views animating (Weather Widget), 281–282 view classes (Maps), 321–329 view modes (Maps), 299–302 view states (Weather Widget), 257–258 volume controls (Music Player), 112–113 W Weather Widget application accessing data, 282–283 alwaysInFront property, 281 chromeless applications, 278–279 compiling/packaging, 284 data handling See data handling (Weather Widget) deploying, 283–284 descriptor file, 283–284 design and features, 240 directory structure, 240–241 menus and window interaction, 279–281 minimizing/restoring, 281 overview, 239 TrayIcon class, 268–270 user interface, building See user interfaces (Weather Widget) views, animating, 281–282 WeatherItem view, 266–267 WeatherWidget.mxml application class, 271–283 WidgetDataModel class, 242, 249 Web sites, for downloading Adobe Flex SDK, AIR, Apache Ant, 17 code for parsing syndication formats, 52 Web sites, for further information binary data, 90 Blogger Data API, 348 Google Blogger service, 333 Google weather, 241 ID3, 90, 92 weather services, 240 Yahoo! Maps AJAX API, 313 webcam input, capturing (UIVideoPlayer), 420, 433 widgets See Weather Widget application windows minimizing/restoring (Weather Widget), 281 window dragging functionality (Music Player), 118–120 window interaction (Weather Widget), 279–281 window menus (AIRVideoPlayer.mxml), 420, 440–441 windowComplete event, WindowedApplication container, WindowedApplication (Music Player), 117–120 Windows, Microsoft ANT installation on, 17 creating development folder in, installing AIR applications on, 14–15 installing Flex SDK on, ‘‘Working with Binary Data’’, 90 writeBytes FileStream method, 162 writing files (Text Editor), 27–32 X XML (Extensible Markup Language) data (CMS), 123, 125 descriptor files See descriptor files external (Music Player), 71–72 RSS and, 47 settings (Weather Widget), 242 weather data, 241 XMLDataService class (CMS), 140–141 XMLFileService class (Music Player), 71, 79–84 XMLFileService class (Weather Widget) 249–252 XMLFileServiceEvent (Music Player), 84–85 xmlNodeStructure() method, 90 XMLServiceEvent class (Weather Widget), 253 XMLParserUtil class Music Player, 71, 85–86 Weather Widget, 254–256 Y Yahoo! Maps AJAX API, 286, 312–313 Z zip code TextInput component (Weather Widget), 261 457 Index zip code TextInput component (Weather Widget) Programmer to Programmer TM Take your library wherever you go Now you can access more than 200 complete Wrox books online, wherever you happen to be! Every diagram, description, screen capture, and code sample is available with your subscription to the Wrox Reference Library For answers when and where you need them, go to wrox.books24x7.com and subscribe today! Find books on • • • • • • • ASP.NET C#/C++ Database General Java Mac Microsoft Office • • • • • • • NET Open Source PHP/MySQL SQL Server Visual Basic Web XML www.wrox.com wrox_24x7_BOB_ad_final.indd 9/8/2007 4:26:08 PM .. .Adobe AIR Create- Modify- Reuse Marc Leuchner Todd Anderson Matt Wright Wiley Publishing, Inc Adobe AIR Create- Modify- Reuse Acknowledgments ... 12: AIR Video Player 419 Index 447 Adobe AIR Create- Modify- Reuse. .. Matt Wright Wiley Publishing, Inc Adobe AIR Create- Modify- Reuse Published by Wiley Publishing, Inc 10475 Crosspoint Boulevard Indianapolis, IN 46256 Copyright © 2008 by Wiley Publishing, Inc.,

Ngày đăng: 19/04/2019, 13:42

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN