02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoPrevious Video

File Types

<p>Before we can start programing or thinking as a Flasher we need to understand what the basic file types are that Flash uses. There are two distinct file types in Flash: the source files and the deployment files.  Source files we want to keep away from the users' reach while the deployment files should be deployed to their destination, such as the web. <strong>The most common </strong>source files are *.fla files<strong> </strong>and *.as source file types whlie the most common deployment files are *.swf and *.html. Here is a more detailed breakdown: &nbsp;</p> <ul> <li><strong>*.as file type --</strong> holds the code for your application</li> <li>*<strong>.fla file type -- </strong>holds everything you need to set up your application, including assets, images, etc. </li> <li><strong>deployment file</strong> -- contains your *.swf. <a href="http://02geek.com/courses/video/6/42">What is .swf?</a></li> <li><strong>.swf file type</strong> -- already compiled application</li> <li><strong>*.html file type</strong>,  the wrapper which runs your application in a browser.</li> </ul> <h1>Flash file types:</h1> <p><strong>Flash is a programming language that must be &quot;compiled&quot;:</strong> the computer translates your code into a machine language that your computer can decrypt and understand easily and quickly.  There are other languages which have source files that are also the deployment files (such as Javascipt).  Compiled applications have major benefits: the application source code isn't visible and easy to access (helping protect your work) and the application is more computer-friendly (making it faster.) In a Flash application there are two type of file groupings: the <a href="http://everythingfla.com/courses/video/24/244">source files</a> and the deployment files. The source files are not meant to be uploaded on the web or end product while the deployment files are the end user files that are shared on line or at client end.</p> <h1>What are .swf and .as files?</h1> <p>*.fla files and *.as files are your source files. . Your <strong>*.as files</strong> are your <strong>ActionScript files which are external files that contain your code.</strong> Your code will be categorized into classes, which we will explain later. .as files are only text, and can be opened in a text editor. Your *.fla file is your hub. Everything that you need to set up your application is inside the .fla file, including your assets, images, configurations, etc. <br /> The source files are compiled into different formats depending on the platforms they will be used on On the other hand, your deployment files are intermediary files. In your deploy, you will have your *.swf (the compiled application) and  the *.html file which serves as the wrapper to run your application in a browser. Your Flash player will take your deployment files, decrypt them, and tell the computer how to run your exciting new animated application!</p> <h2>File types Video Transcript</h2> <div class="expandable"> <pre> So you downloaded the source files and it really doesn't matter from which of the <a href="http://02geek.com/category/developer-basics">coding basics courses</a> you chose.  In any of them you'll find the project folder. Unzip it and open it (now let me just drag this into our view). You'll see that there are 2 folders.  There's your source folder and your deploy folder. Flash is like all programming languages that compile. There are languages that don't compile, likeJavascript. What that means is, there are languages that, on the user system, the computer has to read your code, figure out what's going on, translate that into a language that your computer can actually understand, and then run those applications. Flash is not one of those types of applications, it actually compiles. <a href="http://02geek.com/courses/video/4/30">Compiling</a> basically means that it translates code into some sort of machine language that is much easier, and less work for your computer to then decrypt and understand. Thus, you have your source files, which are humanly readable files and configurations. The source and all things that you're going to work with like editors, if it's your Flash CS3 CS4 CS5 maybe even CS6 when it comes out. As3.0 are source files, but because we want to compress the files, we want to make sure that it's as close to machine language as we can, so it's easier on the processor that the files are smaller. We compile them into different formats depending on the platform that it's supposed to go to. If it's a desktop application, we're going to compile it differently. If we're going to run it on the web, we're going to compile it differently and so on. Different operating systems, different platforms demand different low-level interactions with the machine. In a way it's like a <a href="http://02geek.com/quickies/goodbye-complex-code">translator</a>, speaking in the most simplistic way. Your source files are then translated into a mediator language, that the end user or your computer then is capable of understanding. I'm saying it's a mediator language because we're not compiling it down into machine code. We're compiling it into an intermediary language just as java is if you're familiar with java. It's basically like a mini language, and if you have a Flash plugin running on your browser, then that Flash plugin is the translator that translates all what it needs to translate into your applications. So in a way, there's three steps. There's the source. You deploy your intermediary files, and then there's your <a href="http://02geek.com/quickies/wallaby">Flash player</a> which actually takes those files and decrypts them and breaks them down even more and gives information to your computer how to run it. We care that we have our source and our deploy.  Our source will never be uploaded and sent to anyone if we don't want people to access our work that we've worked on. If you only want them to view it, then we'll only show them our <a href="http://02geek.com/courses/video/6/42">deployment files.</a> We'll post to the web only those deployment files, and only e-mail those and so on. so what file formats are involved with Flash? Well, obviously we're not going to talk about all the different file formats that Flash supports because that's not our main focus, however let's go over the file formats that we're going to be working with. There are two different file types in our source files, <a href="http://02geek.com/course/coding-basics-1">.FLA file type</a> and.AS file type. Our FLA file type is still one of the most popular ways of working with Flash, although there are ways to work without it today. It's still here and it's very important. What are the FLA files? FLA file is basically our heart.  It's where we start everything up. On the other hand, I'm going to first explain what the <a href="http://everythingfla.com/course/basics/start-point">.AS file</a> is because it's going to make it a little bit easier. Our .AS file is our script where we're going to put all our code. It's only text, while our FLA file is kind of like our hub, our library where we can put assets in it and images, even code as well if we wanted but we prefer not to. We're going to put all our configurations and all the things we want to set up for our file. Then, we could choose to use <a href="http://02geek.com/category/Indispensable-as3?page=2">external files</a> if we want or we could opt out, but we always need to start from our root. Now, while we're working on CS3, CS4, or CS5 in our scenario we're going to always be working on FLA file formats. Now there's obviously differences and different between file types. In AS 3.0, the preferred way of working is putting classes into your AS files. The way that we set up our file structures is that we have our main, and most of our videos are going to be <a href="http://02geek.com/course/indispensable-as3/classes-in-actionscript3">main.as</a>, and all our code is going to be sitting in main.as, until we dig deeper into understanding what classes are.  Now, what are all the rest of the files from zero all the way to eleven? These are associated with the video number that you're watching, although in this tutorial it's not, in every other course, when you download the courses and you see the different numbers, these numbers correlate to the video that you're watching.  So if you want to grab the code instead of typing it on your own, or you want to revisit the code later on, you could always open up the AS file and grab it. Ok-so that's really it about our source.  We said that our FLA is our hub where all our assets are sitting and everything that's related to our project is sitting for now. The .AS files are always going to be a class (we don't really know what that is yet,) but basically from our perspective right now all of our code is going to sit inside of our AS file type. Now what's inside of our deploy? Let's look into our deploy. There's a lot of different deployments, it really depends where are we going to publish. But for our sake of coding basics, we're always just going to do the basics -- the SWF -- which is basically our compiled application. As we said, our compiled application is basically compressed and minimized and translated into a closer level to machine level programming language, where it's easier to understand for the processor and the Flash player, throughout the different operating systems and platforms that Flash player runs on these days, making it easier for it to actually understand it the same way throughout, without the overhead of actually compiling on run time. Or, in other words, actually translating our human readable code into machine readable language. Now, as we said, Javascript is a language which doesn't compile (or compiles on the fly,( so when you go into a <a href="http://02geek.com/courses/video/35/284">browser</a> and it's javascript heavy, a lot of times you're going to see that it's slower than the <a href="http://02geek.com/free">Flash application.</a> The reason why it's slower than a Flash application is because your browser actually has to first understand what that copy is before you could actually start interacting with it. Now, modern browsers have a lot of different interesting ways of dealing with that such as compiling it on the fly, and so on, but the end point is, because our applications are pre-compiled, we have a little bit more control over our content, because people can't just see our code directly as easily. Also, it cuts down the amount of time that it takes the browser and the users' computer to understand what's going on. As long as they have their Flash player, they're more or less ready to go! Alright, so that was our SWF which is a really critical file.  Now we wouldn't want to by mistake, because I've seen that so many times, you don't want to upload your FLA's or AS files by mistake on to a web site, especially if you're building it for a client. It's very important to differentiate between those two files types, and that's why I'm deliberately, throughout all the projects, I'm setting the source in one folder and the deploy in another one. It's a very good practice to always separate them. Now, you have HTML file, we're not going to dig too deep into what HTML is, but HTML is our wrapper for Flash which is going to be enable us to run our application in a browser. Although in our coding basics we're really not going to run it on a browser, so we're not too concerned about the HTML file: it's just the default file type that's added into our project when we compile it through Flash CS3 and up. Well, previous versions as well but now that we're talking about AS 3.0. So, that's all I really have to say about our file types for now. All we have to know is it's our main library where all of our assets are sitting, where everything starts from, all the commands, all the initiation process starts from here. This is the heart of our source file, this is what actually compiles. Then we have our .AS files which are external files that depend on our FLA. so in our FLA we're actually going to link our external class, our external file to our FLA. Without it, it wouldn't know that it's connected to our FLA. Now in our deploy file we said... Just to repeat it, we said our FLA is our main source file.  It's where we have our assets.  It's not text. It's usually bigger files. It could have text in it but you can't open it in a text editor, Your code in external files ia basically text.  You could open it up in text editors; they're small files, and then we're talking about our deploy which we said our deploy is basically our SWF what is our SWF? our SWF is basically, if I go back to our FLA, it's our FLA plus any other external assets that our FLA requested for in compiling time and we're going to see what that means. In compiling time, it then compiles it and compresses it and puts it all into one bundle into on file. Our <a href="http://02geek.com/courses/video/6/48">HTML file</a> is just our wrapper file that we can use to run our application in an HTML page. Ok-so those were our 4 file formats that we really need to make sure that we're comfortable with. </pre></div>

Developer Basics Overview

Pro or new, this course is for you. Our custom exams speed learning by filtering exams: zero to geek in no time! Always wanted to learn Flash? Take this free thorough 02geek tutorial, join the fun.

03:19

Starting Point Overview

In this overview we talk about what you get out of the next hour of this course: Know the Flash Environment, Files & Publishing, Output & Troubleshooting, OOP vs. Timeline, Sample files and resources.

03:08

File Types

Learn to code the right way, beginning with the different file types that are important to know about Flash: exactly what .as and .swf files are.

12:44

Where Is It?

The difference between CS5 and Cs3 layouts: Cs4 and Cs5 as well. . This Flash tutorial is the perfect starting point for those of you that have never used Flash before.

09:52

Workspace

Looking at our Cs5 workspace working area. Also, Cs4 and Cs3: how to use Flash As3 so we're on the same page.

06:43

Runtime vs. Compiler Errors

What is the difference between runtime and compiler errors? What are runtime errors and when do they happen? What are compile time errors?

03:39

Overall Things To Know

What are the things needed to know about Flash? Flash is a time-based programming language, which means it compiles, (unlike Javascript). Educate yourself with the basics of coding and learn how to bu

07:36

The Properties Panel

In this session we meet the properties panel and see how it's dynamic and flexible. By the end of this session you will know all you need to know to roll in it.

09:22

Publish Settings

The Flash Publish settings in action. In this session we get to learn the basics of the publish settings and how to work with it.

08:47

Split Paths

Hint Hint we want you to pick OOP. in this intro we will explain why its important to go the transition into OOP way of coding.

03:32

Split Paths : OOP

In this video, we take a step further into our object orientated programming world.

07:31

Split Paths : Timeline Coding

In this title we outline the options you have as a developer and help you understand why it would be a good idea to move to OOP

03:15

How To Use Samples

We walk through the source files of our Flash ActionScript project

01:12

Building It Up From Scratch

In this video we redo our work and build together a class and connect it to our flash interface.

05:09