Complete step by step guide on how to build a flash application from scratch. Learn every dynamic of the file structure, and how to run the application you build. This is basically a summary video for the videos you have already watched, and should by now, hopefully feel somewhat comfortable.
Nothing is new, but what we're going to do right now is build our
application from scratch assuming that we've
never downloaded the file. If you're very comfortable
with all the new videos that we've done so far,
then you don't really have to watch this video,
but if you feel like having a little
bit more rehearsal before we actually start programming,
so let's do it!
what we want to do first is, let's create a new
folder,
and let's call it my "project files",
and in my project files folder i'm going to create 2
new folders.
One will be my deploy,
and the next item will be my source.
So I have my source and I have my deploy.
Next thing is I want to open up my Flash,
and now i'm working on Flash CS5,
and i'm going to create a new ActionScript 3.0 file.
Created a new ActionScript 3.0 file and
now I want to save it. So i'm going to go to file> save as,
i'm going to make sure i'm in my source folder, in my
desktop,
project files, source
and i'm going to call it main.fla,
and i'm going to save it.
Now that I saved my main, I want to create... first
of all I want to change my publish settings,
so i'm going to go to file> publish settings,
and then in my flash configuration, i'm going to change
it to one folder back,
deploy, and another slash.
Same thing here,
dot dot, one folder back, deploy, slash,
and I want to change it from main to index,
and i'm going to click ok,
and i'm going to save my file again,
i'm going to go to my file,
and i'm going to publish it. Just make sure that when we go back
in here that in our deploy, we have our main,
and we have our index.html.
Perfecto! So back in our main, we want to create
now our *.as file in which we are going
to store all of our ActionScript.
So we're going to go and click on file> new
and then i'm going to select an ActionScript 3.0 class.
I'm going to click okay.
Because i'm working with
flash CS5, it's going to generate for
me some stuff dynamically so I want to call
it main, my class, and i'm going to click ok,
and it's going to automatically create
a lot of things for me that I need,
so I don't have to type them myself.
But let's assume that it didn't, just for people
that are
not running on CS5. So i'm just going to delete
all those goodies.
Let's start typing.
First of all we're going to create a new package,
we're going to open a bracket,
and we're going to close a bracket. Flash CS5 automatically
is gonna
do that extra goody of closing the bracket for
me.
I'm going to type now, import, space, Flash dot, display dot, movie clip.
Now we're going to create a new class. So we're going to set up our
public class, we're going to call it main,
extends movie clip.
Now don't worry about what this all means.
It's really just about making sure you have
all this for now,
and what we recommend is just to download the
source
anyways, because until you really understand what
it is,
it doesn't really mean too much to type it,
but it's good practice, it doesn't hurt.
Next thing we want to do, is we want to create
our function.
public, function, main,
we want to make sure that the names all match up,
uppercase M, all the rest lowercase,
and public main, this time around we're going to open a round
bracket, close a around bracket,
open curly bracket,
and then close a curly bracket.
There we go! We have everything set up. All that's
left is we wanna save the file.
So we're going to click on file> save,
we're going to take it in the same folder, we're going to call it
main.as.
Now back to our main.fla, we will want
to go into our publish settings,
and then in our class set it to be main.
Let's just make sure that it works. Click
on edit class definition,
and we see that they're linked together,
and just to prove it we're going to put here a little
trace on line 6.
So this is basically what we've done in all
the past videos only really quickly.
It would be really good practice
to just get used to typing it. It does not hurt at
all to know how to do it even if we do
understand all the intricacies
of what's inside
here for now. As time goes by, as the
courses as we evolve as programmers,
we're going to completely understand every single line here.
So just run it, see our "Hello world"
and this is a wrap!