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

Split Paths : OOP

<p>In this video, we take a step further into our OOP programming, object orientated programming. Seeing where we will code along with a very high level overview of the different elements we're working with. We will learn two ways to run an application. We actually get a look at certain things in detail, such as the contents of a basic AS file, a 'package.' Hint: a package tells Flash what directory the OOP class &quot;Main&quot; is in. This video explains what a 'movie clip' is: it is contained in the package. Learn to define a new object that is created dynamically as we're running the application: the object is <strong>actually the application</strong>!<br /> <br /> <strong><em>NOTE</em></strong>: Everything in Flash is case-sensitive: if you name a class &quot;Bouncing_Ball&quot; and later call it &quot;bouncing_ball,&quot; you'll get an error.<br /> <br /> I'm sure we will find things in our output and compiler errors if we make a mistake anywhere in the coding. Not to worry, this is a natural process and you can expect some mistakes and errors to be made. It's learning from those mistakes and actually bookmarking future solutions that help you become a great developer.</p> <h1>Still working in Split Paths: More OOP</h1> <p>We continue our steps along the path of OOP programming by learning how to send a value to the output panel. (Does &quot;Hello World&quot; sound familiar? ;) We show you examples and give you the exact run-down of how to run our applications. Also, in the most likely case that you become stuck or receive an error or caution warning, examples and solutions to your problems are provided.</p> <h2>Split Paths cont. OOP Video Transcript</h2> <div class="expandable"><pre> So, how do we actually get this stuff set up? So if we go back into our project files, i'm just going to double click into it, and I'm going to go directly to my source, into our main. If I click on our main, it's going to open up, and I'm going to toggle back into our finder, and I'm going to double-click on our main.as as well. If I click into our main.as, we're going to see that this is a file structure here that has some code in it, that is a prior written amount of code that we are going to have there always until we learn a little bit more about object oriented programming(OOP.) We're just going to assume that that has to be there always. To make linkage between where we're going to code and our FLA, we have to actually tell our FLA that our stage from now on, our root, our application hub, where our source code begins is our main.as. The way we do that, and the way we've done it in our pre-loaded files is to type the name of our class directly into our class property. We got rid of the .as because we don't need that, and it wouldn't work if we would, and we just typed... and it's really important to note, uppercase M, all the rest lowercase, everything in Flash because Flash is case sensitive. It's very very important to make sure that you type it exactly the same way or things won't work the way that you expect them to work. So we have our linkage between our class and our main. Let's see how to run our applications, and obviously if we run our application right now, and we haven't done anything yet nothing will happen. That's another point that we have to learn. How do we run our application? So far it was magic that I was working on. The way we run our application is going through our control, and then clicking on test movie, and enter. Command enter would then run my application. So, <strong>command enter</strong> is really how we want to run our application most of the time as we're testing it. As we run things, if we have any mistakes, we're going to see things in our compiler errors, and our output. . Let's link back to that. We saw the compiler error, but if we go back now into our main.as and we know that it's linked together, and the way we know is, we have our class that is main, and if we click on this edit class definition, this pencil tool thingy, it will take us into our main.as. In our main.as, if we had any errors, let's say we by mistake didn't add a bracket; let's just delete this bracket, and don't worry about what it is and why it's there but realize it is has to be there. If we try to run our application now, again by clicking on our command enter, we're going to see that we're going to automatically get a compiling error telling us that there is something that it's missing. We're not going to dig into that right now, but it basically means that we're missing what we have to have there. While if we run it with what is missing, then everything is fine. So that was our compiling errors. Let's see how we could trigger things into our output. With that said, it brings us to: where is the area that we could type in? I'm just going to run through what we have here really quickly, and we're not really going to dig too deep into it right now because it's really early on. We're just going to assume that this code always has to be here, but let's just see this. Our package is basically telling Flash what directory our main is in. Right now, our main is sitting in the exact same directory. We're gonna see how we can work with setting it in different packages in future videos. For our sake and purpose, we always open a curly bracket to contain something. Everything inside of this curly bracket area, and I'm just going to highlight it, everything inside of here is part of this package. Don't worry about what a package is. Now inside of this package is, a movie clip we're importing which is basically our base foundation block, which is our root, our application, where we're actually switching our root to be our movie clip, and a movie clip has all the functionalities and all the code kind of built into it that Flash needs to know how to run our application. For now that's all we really need to know about it. Here, we're defining a new class which is our new object. I'm really running through it very very vaguely, and the reason is because there's a lot of details we would have to get into to be able to really understand these things, and in these intro videos, we're really not going to touch object oriented programming, but we're gonna work inside of the environment of an object oriented program. In other words, what we're doing is, we're defining a new object that is then created dynamically as we're running the application; we're creating a new object and this object is actually our application. Inside, between, as you could see your public, function, main, open round bracket close round bracket, open curly bracket close curly bracket. Between our open curly bracket and close curly bracket of our main function is where we will put all of our code from now on. What I want to do is, now that we know that, and don't worry about it, really don't worry about why, just assume that you just have to have all this, and all your code has to come right here. All your code has to come where I am typing right now. Now, I'm going to teach you a quick command which in Flash is called a <strong>function</strong>. We're going to run our function, this quick function, we're not going to go into the details of what functions are, we're going to look at that in the future videos in this release. We're just going to see how could we trigger things to output into the output panel, and the way we do that, we're just going to type trace, we're going to open a round bracket, we're going to click on shift, comma to create a double quote, and we're going to type very very cheesy, the words "hello world," close our quote, same type, double quote, close our round bracket and then put here a semicolon. That's all we really need to be able to run our first application. What this will do is send this string, this value to our output panel, and if I run my application, again using my command enter, I'm going to see in my output panel "Hello World", and it's not part of our application, users can't see it, but us, as we're testing our application, we could see our "Hello World". Now, we were working in our object oriented world. Obviously we haven't really dug much into this world, and what everything here actually means, What is a class? What is an <a href="http://everythingfla.com/course/basics/objects">object</a>? What is a movie clip? What are functions, and why are we inside of a function when we're making these calls? What are packages, and so on? We're not really going to answer those questions in these initial videos, we're just deliberately sitting inside of the object oriented kind of area to make it is easier, and kind of getting used to being in there as we decrypt and slowly slowly understand what the different pieces are that are here. </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