Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Adobe Flash

Flash Reference Guide

📄 Contents

  1. Flash Guide 2006
  2. Welcome to the New Flash Reference Guide
  3. Flash Design Guide
  4. Introduction To Flash
  5. Working with the Authoring Tool
  6. Working with Templates
  7. FreeHand for the Power User
  8. Creating Animation with Fireworks
  9. Creating Animation in Flash
  10. Animating Text
  11. Working With Layers and Keyframes
  12. Working With Tweens
  13. Quickly Add Keyframes to Tweens
  14. Using Animation Paths
  15. Using Flash's Onion Skinning Tools
  16. Publishing Your Animation
  17. Preloading for Non-Programmers
  18. Drawing in Flash
  19. Using the Library
  20. Organizing Animations With Storyboards
  21. Working With Masks
  22. Making 2D Look 3D
  23. Working With Text
  24. Working With Input Text Fields
  25. Working With Dynamic Text
  26. Working with Text: Advanced Text Treatment With CSS
  27. Working With Text: Embedding Fonts
  28. Flash Interactive Developer Guide
  29. What is an Interactive Developer?
  30. Creating Flash Projects
  31. Using Form Applications
  32. Working with Form Components
  33. Setting up a Movie for Design and Animation
  34. Setting up a Movie for Programming
  35. Working with Components
  36. ActionScript Fundamentals
  37. Intro to Working With Arrays
  38. Understanding The Three Types of Arrays
  39. Control Data Stored in Arrays
  40. The Eolas Solution
  41. Intro to Flash Player 9
  42. Working with Strings
  43. Creating ActionScript Transitions
  44. Working with Boolean Objects in ActionScript
  45. Optimizing Delivery
  46. Working with Numbers in ActionScript
  47. Working with the Number Class
  48. Flash Professional 9 Preview
  49. Adobe Takes ActionScript Open Source
  50. Flash Rich Media Guide
  51. Pros and Cons of Flash 8 Video
  52. Using SMIL in Flash Video 8
  53. Stream an MP3 Audio File to Your Flash Movie
  54. Flash 8
  55. Introduction to Flash 8
  56. Advanced Text Rendering
  57. Using BitmapData Class in Your ActionScript
  58. The CacheAsBitmap Property
  59. Bitmap Rendering Improvements and Blend Modes
  60. Using The ExternalInterface Class
  61. Using Filters
  62. Downloading and Uploading Files with ActionScript
  63. Runtime Support for GIF and PNG Files
  64. Garbage Collection in Flash 8
  65. Using Enhanced Gradients
  66. Using Scale 9
  67. Stroke Enhancements in Flash 8
  68. Video Support in Flash 8
  69. How to Create a Slideshow
  70. Creating Dynamic Text in Flash
  71. Flash 3-D–Taking Flash to the Third Dimension!
  72. Object Collision Detection with Flash
  73. Create a Quiz With The Flash Quiz Template
  74. Working with Flash
  75. Uses for Flash
  76. Beyond Flash
  77. Flash Reference Guide
  78. Informit Articles and Sample Chapters
  79. Books
  80. Online Resources
  81. Blogs and Discussion
  82. Tools and Downloads
  83. Summary
  84. Flash MX Interface
  85. Welcome to Flash: the Designers' and Developers' Tool
  86. Using the Stage
  87. Panels, Panels Everywhere
  88. Using the Tools Pane
  89. Using the Property Inspector
  90. Using the Timeline Panel
  91. Using the Library
  92. Adding Interaction through the Actions Panel
  93. Integrating with Studio MX
  94. Saving and Publishing Flash Movies
  95. Informit Articles and Sample Chapters
  96. Books
  97. Online Resources
  98. Summary
  99. Drawing in Flash
  100. Shape Tools
  101. Applying Color
  102. Informit Articles and Sample Chapters
  103. Tools and Downloads
  104. Summary
  105. Flash Bitmaps
  106. Importing Bitmaps
  107. Exporting Bitmap Images
  108. Converting Bitmap Images to Vector Illustrations
  109. Informit Articles and Sample Chapters
  110. Online Resources
  111. Tools and Downloads
  112. Summary
  113. Flash Text and Text Fields
  114. Text Types
  115. Input Text
  116. Online Resources
  117. Tools and Downloads
  118. Summary
  119. Using the Library
  120. Library Organization
  121. Creating Instances
  122. Informit Articles and Sample Chapters
  123. Books
  124. Online Resources
  125. Summary
  126. Flash Animation
  127. Controlling Time
  128. Keyframe Animation
  129. Tweening
  130. Text Animation with Flash
  131. Informit Articles and Sample Chapters
  132. Books
  133. Online Resources
  134. Summary
  135. Flash Audio
  136. Using Audio in Flash
  137. Importing
  138. Linking to MP3
  139. Publishing Audio
  140. Streaming MP3 from the Flash Communication Server
  141. Informit Articles and Sample Chapters
  142. Online Resources
  143. Summary
  144. Video in Flash
  145. Video
  146. Flash Video
  147. Spark Codec
  148. Exporting Video
  149. Informit Articles and Sample Chapters
  150. Blog and Discussion
  151. Summary
  152. Flash Components
  153. Attaching Components to Movies
  154. Creating a Component
  155. Informit Articles and Sample Chapters
  156. Tools and Downloads
  157. Summary
  158. Exporting and Optimization
  159. Connecting Flash to the Internet
  160. Loading SWF Movies
  161. Sharing Fonts Between Movies
  162. Reusing Your ActionScripts
  163. Using Third-Party Tools
  164. Informit Articles and Sample Chapters
  165. Online Resources
  166. Tools and Downloads
  167. Summary
  168. Introduction to Design in Flash
  169. Introduction to Design
  170. Fundamental Design Concepts
  171. Breaking Up the Screen
  172. Branding
  173. Adding Forms to Movies
  174. Developing with ActionScript
  175. Introduction to Programming within Flash MX 2004
  176. Using ActionScript to Extend the Functionality of Flash
  177. ActionScript Fundamentals
  178. Using the Actions Panel
  179. Using the Reference Panel
  180. Rapidly Adding ActionScript with the Behaviors Panel
  181. Event Handling within ActionScript
  182. Timeline Events
  183. Triggering Events through User Interaction
  184. Flash MX 2004 Pro
  185. Summary
  186. Creating Interactive Movies
  187. Giving Users a Choice
  188. What it All Comes Down to
  189. Summary
  190. Testing your Flash Movies
  191. Naming Conventions
  192. Syntax Checker
  193. Testing your movies
  194. Summary
  195. Debugging
  196. Using the "Debugger"
  197. Reviewing ActionScript Error Codes
  198. Summary
  199. Using ActionScript to Control Your Movies
  200. Setting Up Your Movies for Interaction
  201. Making Movie Clips Behave Like Buttons
  202. Controlling Multiple Movie Clips
  203. Applying Different Types of Events to a Movie Clip
  204. Summary
  205. Using ActionScript to Control Text
  206. How ActionScript Can Control Text
  207. Using Cascading Style Sheets within Flash MX 2004 Dynamic Text Boxes
  208. Applying CSS formatting with ActionScript
  209. Where Do You Go Now?
  210. The Differences Between ActionScript 1 and ActionScript 2
  211. Working with Classes
  212. Which Version of the Flash Player should you use?
  213. What’s Next?
  214. Using Pre-Built Classes In Flash MX 2004
  215. Using a Class in ActionScript
  216. The List of Core Classes
  217. Flash Player-Specific Classes
  218. Summary
  219. Creating Your Own Classes
  220. Creating a Custom Class
  221. Working with External Data in Flash
  222. Why Use XML in Flash?
  223. Integrating Flash and XML
  224. Visual Elements
  225. Adding the ActionScript
  226. Future Shock
  227. Using Components
  228. Begin Using Components
  229. Building an Application with Components
  230. Gluing Components Together with ActionScript
  231. Summary
  232. Informit Articles and Sample Chapters
  233. Books and e-Books
  234. Online Resources
  235. Rich Internet Applications
  236. Introduction to Rich Internet Applications
  237. Why Use Flash for Building Application Solutions?
  238. Building Applications with Flash
  239. Getting Started
  240. Using Flash Variables
  241. Working with Parameters in the Object and Embed HTML Tags
  242. Linking data with Flashvars
  243. Getting Data Into Flash: Loading External SWF and JPG Files
  244. Why You Should Separate Your Files
  245. Loading Movies into Levels and Target Movie Clips
  246. Summary
  247. Loading SWF and JPG Images
  248. Working With XML: What is XML, and How Does it Relate to Flash?
  249. A Brief History of XML
  250. Why Structuring Your Data is Always a Good Thing
  251. How XML Came to Flash
  252. Summary
  253. Working with XML: Good XML vs. Bad XML
  254. Good Places to Start
  255. Writing Good XML
  256. XML Tools
  257. The Next Step - Using XML in your Flash Applications
  258. Working with XML: Loading XML into Flash
  259. Integrating Flash and XML
  260. Visual Elements
  261. ActionScript
  262. Future Shock
  263. Working with XML — Dynamically Building XML with .NET, ColdFusion, Java, and PHP
  264. ColdFusion
  265. .NET
  266. Java
  267. PHP
  268. Summary
  269. Working with XML — Web Services
  270. SOAP Support in Flash MX 2004
  271. Using Components to Bind Web Services into your Applications
  272. Summary
  273. Working with Data — Working with XML
  274. XML In Flash
  275. Writing XML In Flash
  276. Building Trees of Data with XML
  277. Working with Data: Pushing Data back to the Server with Load Vars
  278. Setting up the Database
  279. Writing the VB.NET Code
  280. Creating the Flash Movie
  281. Working with Data: Leveraging Persistent Connections
  282. Using XMLSocket Connections
  283. XMLSocket Server
  284. XMLSocket Security
  285. XMLSocket Class in Flash
  286. Creating a Pong Game with an XMLSocket Server
  287. Summary
  288. Flash Remoting
  289. What is Flash Remoting?
  290. Using Flash Remoting
  291. The Future of Flash Remoting
  292. Flash Remoting Links
  293. Working with Data: Macromedia Flex Presentation Server
  294. What Problem Does Flex Presentation Server Address?
  295. How does Flex work?
  296. Coding and Building Flex Applications
  297. Building Rich Internet Applications: Connecting Flash to a Database
  298. Using FlashVars
  299. Using LoadVars
  300. Loading XML
  301. Consuming a Web Service
  302. Live data connections with XMLSocket Connections
  303. Building Rich Internet Applications: Planning, Planning, Planning
  304. A Simple Plan
  305. Tools You Can Use
  306. Applying a Discipline
  307. Building Rich Internet Applications: Design Counts
  308. Do Not Be Afraid to Ask For Help
  309. What if You Do Not Have a Ben To Call
  310. Building Rich Internet Applications: Beyond the Movie Clip
  311. UI Components
  312. Data Components
  313. Media Components
  314. Manager Components
  315. Screen Components
  316. Building Rich Internet Applications: Using Macromedia Central
  317. What Central is All About
  318. Who is Using Central?
  319. Developing for Macromedia Central
  320. Next Steps You Need to Take
  321. Building Rich Internet Applications: Using Macromedia Flex
  322. Authoring with Flex
  323. Publishing with Flex
  324. Presenting the Solution: Delivering Flash Applications to the Web
  325. Flash's own Publishing Tools
  326. Using Dreamweaver
  327. Writing your Own HTML
  328. Presenting the Solution: Delivering Flash Over Non-PC Devices
  329. Using Macromedia's Flash Lite
  330. Programming for Flash Lite
  331. FlashCast
  332. Informit Articles and Sample Chapters
  333. Books and e-Books
  334. Flash for Designers: Rich Media Production
  335. Graphic Control in Flash
  336. Drawing in Flash
  337. Importing Vector Art
  338. Importing Raster
  339. Scripting Images
  340. Introduction to the Rich Media Production
  341. Using Video, Audio and Images in your Flash Movies
  342. Using SWF Flash Movies
  343. Using JPEG Images
  344. MP3 Sound Files
  345. Flash Video
  346. Using Components to Build Rich Media Solutions
  347. Using the Loader Component
  348. Using the Media Components
  349. Controlling Components with ActionScript
  350. Controlling the Loader Component
  351. Media Components
  352. Using Audio in Flash
  353. Linking to MP3
  354. ActionScript-Controlled Audio
  355. Volume Control
  356. Publishing Audio
  357. Summary
  358. Video in Flash
  359. Working with Video
  360. Controlling Video with Components
  361. Exporting Video
  362. Summary
  363. Choosing Which Version of Flash Communication Server to Use
  364. Server Requirements
  365. Installation
  366. Running Communication Server on Different OS Platforms
  367. Pitfalls to Watch for
  368. Summary
  369. Streaming Video
  370. Live Video
  371. Broadcast Video on Demand
  372. Flash Video Components
  373. The Communication Server MX Server Code for the VideoPlayBack Component
  374. Record Video with VideoRecord Communication Component
  375. Create A Video Conference
  376. Examining the VideoConferencing Component
  377. The Communication Server MX Server Code for the VideoConferencing Component
  378. Summary
  379. Using the Microphone and Camera Core Classes
  380. Microphone
  381. Camera
  382. Constructing Large Applications That Leverage Video and Audio
  383. Configuring the Server
  384. Creating the Movie
  385. Broadcasting
  386. Summary
  387. Informit Articles and Sample Chapters
  388. Books and e-Books
  389. Matthew's Predictions for 2006
  390. Matthew's Favorite Flash Books
  391. Matthew's Favorite Flash Web Resources
  392. Macromedia as Part of Adobe
  393. First Look: Flash Player 8
  394. First, the Facts
  395. What Macromedia Brings to the Table
  396. What Adobe Brings to the Table
  397. What the Two Companies Can Do for Each Other
  398. A Brief History of Flash

The Components bundled with Flash are designed to make development easier for you. A Component is essentially a specialized movie clip with exposed parameters that you can modify. If you have developed with tools such as Visual Studio, it’s likely that you are already familiar with Controls, which are similar time-saving tools.

Components allow you to rapidly build applications and solutions. For example, if you are building a form with a drop down menu, checkboxes, radio buttons, and a calendar control, you could spend a lot of time developing the code for these movie clips, or you could simply use the pre-built Components that come with Flash to streamline your development pains.

Think of Components as the great little helpers you need in an application. Some do simple jobs, such as adding a UIScrollBar to a Text box. Others are more complex, such as the DateChooser and others rival enterprise tools such as the DataGrid.

A Brief History of Components

Components are not new to Flash. The first set of Components made its appearance in Flash 5 (at the time, Macromedia called them Smart Clips). The idea was right, but the execution was wrong. SmartClips died under the noon day sun and were quickly dismissed.

Flash MX—or Flash 6—introduced an enhanced version of ActionScript and formally introduced Components. Macromedia, and now Adobe, have been steadily improving the functionality and form of Components since their debut. Today I rely on them for all of my work because they help me get the job done, simply and efficiently.

Where to find Components

To view the Components Panel, open Flash and Choose Window > Components. There are five sets of Components in the Components Panel:

  • Data
  • FLV Playback — Player 8
  • FLV Playback Custom UI
  • Media Players 6-7
  • User Interface

These five groups, when expanded, contain over 30 Components that you can drop into a movie. The parameters of each Component can be controlled through the Properties Inspector, and both the interaction and presentation of Component can be controlled with ActionScript. Remember, this is Flash—if you do not like what you see, you can change it without damaging the integrity of the Component.

Every Component is data aware, meaning you can bind data from a Web Service, XML, or Array to it. The Data Components allow you to do this easily.

The FLV Playback—Player 8 Component is designer specifically to handle the new On2 video CODEC supported in Flash 8 Player, and can be easily customized. The FLV Playback Custom UI controls allow you to change the appearance of the FLV Playback—Player 8 Component. This is a clear example of Flash Components separating form from function. Brilliant.

The final set of Components listed in the Components Panel is the User Interface Components. There are over 20 Components in this one category alone. These Components each come with a rich level of complexity that could easily warrent individual sections in the guide. For example, the data-sensitive Components such as the List, Tree, Accordion, ComboBox, and DataGrid are extremely complex. Of particular note is the DataGrid. This is one of the most useful Components because it allows you to easily display large amounts of data in a simple and clear view, very similar in look and appearance to Microsoft's Excel.

In addition to the visual Components, there are two additional categories of Components: Managers and Screens. Managers allow you to control elements such as depth, style, system, and popup. Screens allow you to control forms and slides.

Using Components

Obviously, I do not have enough space to cover all of the Components in great detail, but I hope to give you a feel for how to use them by examining the humble UIScrollBar.

  1. On the stage, draw a small Dynamic Text box with the Text Tool. Name it "myText."
  2. Select frame one from the Timeline Panel.
  3. Open the Actions Panel.
  4. Add the following ActionScript: myText.text="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Integer sollicitudin metus ut nibh. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In eget ante ac tortor tincidunt lobortis. Nunc egestas elit non ante. Morbi ut sem. Mauris ac nibh. Suspendisse dapibus, turpis sit amet tincidunt faucibus, arcu elit condimentum elit, eu iaculis odio ante eget mi. Praesent facilisis odio at elit. Vivamus blandit commodo orci. Ut ultrices aliquam enim. Fusce nonummy tortor in felis.";
  5. Test the movie by pressing F12. You will notice that not all of your text fits onto the screen. To see all of the text easily, you must use the UIScrollBar from the Components Panel.
  6. Select and drag an instance of the UIScrollBar from the Components Panel onto the Dynamic Text box called "myText" on the stage. Release your cursor. You will notice that a blue outlined scroll bar appears to the righthand side of the text area. Test your movie again and use the UIScrollBar to view your content.
  7. Select the UIScrollBar and—in the Properties Inspector—name the Component "myScrollBar."
  8. Open the Actions Panel and add the following ActionScript to modify additional parameters of the UIScrollBar
    this.createTextField("my_txt", 10, 10, 20, 200, 100);
    my_txt.wordWrap = true;
    
    this.createClassObject(mx.controls.UIScrollBar, "my_sb", 20);
    
    my_sb.setStyle("ThemeColor","haloOrange");
    
    // Set the target text field.
    my_sb.setScrollTarget(my_txt);
    
    // Size it to match the text field.
    my_sb.setSize(16, my_txt._height); 
    
    // Scroll 2 lines per click on scroll arrow.
    my_sb.lineScrollSize = 2;
    
    // Scroll 5 lines per click on scroll track.
    my_sb.pageScrollSize = 5;
    
    // Move it next to the text field.
    my_sb.move(my_txt._x + my_txt._width, my_txt._y);
    
    // Scroll 2 lines per click of scroll arrow.
    my_sb.lineScrollSize = 2;
    
    // Scroll 5 lines per click of scroll track.
    my_sb.pageScrollSize = 5;
    
    // Load text to display and define onData handler.
    var my_lv:LoadVars = new LoadVars();
    my_lv.onData = function(src:String) {
      if (src != undefined) {
        my_txt.text = src;
      } else {
        my_txt.text = "Error loading text.";
      }
    };
    my_lv.load("http://www.helpexamples.com/flash/lorem.txt");
  9. Now test your movie again to see the affects of the modified Component.

Summary

Components are very useful. Here you have been introduced to Components and given a tour of one of the more simple Components: the UIScrollBar. You can find more information on Components in other sections of the Guide. Expect to find even more coverage of specialized Components coming in future issues of the Flash Guide. There is lot to discover.

Peachpit Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Peachpit and its family of brands. I can unsubscribe at any time.