Click on any phrase to play the video from that point.
[place holder]
If you're unfamiliar with ActionScript, then I'd like to introduce you to your new best friend,
the Code Snippets panel.
It allows you to add prebuilt ActionScript code snippets to your project
that you can then modify further.
It makes adding interactivity a breeze.
And that's what I want to do with this file.
I want to add some interactivity, for instance, on this button right here.
So with that button selected, notice it already has an instance name Button Begin.
Now I'm going to open up the Code Snippets panel,
so Window, Code Snippets.
You can see all of the code snippets listed in here, divided up into various folders.
Some of the new ones in Flash CS5.5 are these Mobile Touch Events,
Gesture Events, Mobile Actions, AIR for Mobile, and even AIR.
Actually, there was over 20 new code snippets added.
But what I want to do is I want to go ahead and add just a simple tap event
to this button right here.
So as I select that code snippet, I'm given this heads up display
where I can see a description, so I'll click on that button.
It says tapping on an object executes a function containing whatever code I want.
Or I could even look at the code itself.
So we have a description in here again, as well as instructions.
And right down here we have the actual code.
So if you'll notice right in here, look, it already has the name of that button.
If I decide to change it to the other button, all I need to do is click and drag on that name
and point to that other button, and it will add that name right in there.
So just using this pick whip tool I'm able to point to the appropriate button,
and then I'm good to go.
Scroll down a little further.
Notice there is some additional code in here as well.
But I'd say this is good to go, and I want to go ahead and add it to this project.
So I'm going to click Insert.
Notice how that animates over.
Code Snippet Inserted.
I can click on that tag, and now it takes me to the Actions panel where that code snippet is.
Right up here is a code snippet that I already had added,
but right down here you'll notice here's my code snippet that I just added to my project.
And I can come in here and edit it further.
So for my Button Begin, instead of changing the alpha of the button,
what I can do is just delete all that code and do a gotoAndStop.
And in this case, I want to make sure it goes to frame 10 and stops.
I scroll up. Notice how I actually have two of these lines.
The input mode is being set to touch point.
I don't really need two, so I can eliminate that one.
But as you can tell, I can easily come in here and even eliminate all of those comments
once I understand what this code does.
So overall, I'd say that looks good.
I can tighten it up a little more.
And this code is set to go.
I'm going to go ahead and close that Actions panel
and just kind of scrub through this project a little more,
because next up what I have is I have this list right here.
And with that list selected I'm going to go into my Code Snippets panel,
and I'll add another code snippet right in here.
In this case, what I want to do is I want to add a pan event
so when the user moves their finger across their screen
it's going to slide that list.
I can get more info, or I could even show the code right here.
But watch what happens if I try to insert this code snippet on this list
that doesn't have an instance name.
If I click Insert, it does tell me that I need to replace instance name here
with an actual name of an instance.
So it's nice that it gives me some guidance.
I can go ahead and point to that list,
and once I release, it gives me the opportunity to give it an instance name,
and I'll just call it list.
Click OK.
It puts list right in here, and if I select that again, it will appear in my Properties panel.
But at this point I'm just going to go ahead and click Insert.
It animates over, shows me exactly where it places that code,
and I can dive a little deeper into this code as well.
In this case, I want this list to move its y position but not its x position,
so I can just eliminate that line entirely.
And in fact, what I can do is I can take this code snippet,
and I can modify it further if I want to.
And if you do modify code even further and you know you want to reuse it,
you can always take this code and save it back to the Code Snippets panel.
So with this code selected, I can go to the Code Snippets panel,
select this flyout menu, and I can create a new code snippet.
So select that first option right there,
and this is a pan up and down.
Description: pans content selected.
Auto Fill. Click right there.
And right down here I can check this box
because I want to automatically replace instance name here
with the new instance that I apply this code snippet to.
So instead of lists, I want to make it more flexible by typing in instance name here,
just like that.
All right. I'll click OK.
It creates that code snippet and puts it in its own little custom folder
already set up for use next time.
So that really is going to help my workflow and production and speed in creating projects.
But overall, I'd say this project is set up.
And really, I just want to go ahead and test this project out on a device,
so I'm going to go to File, Publish Settings, make sure it's set to AIR for Android,
and I'll just double check my player settings.
It's going to make an APK. It's going to be full screen.
If I go into deployment right down here, it's going to install the application
on the connected Android device and then launch it immediately as well.
And with that all set up and my device connected,
I'm going to go ahead and click Publish.
So let's take a look at my Motorola Atrix right here.
You can see that it launches that project immediately.
You have this nice animation.
I can click that Begin button, go directly to that list,
I can scroll through that content, pan through that information,
and you can see that's good to go--
all done with code snippets that were prebuilt.
All I did is I just modified those code snippets.
So I really hope you try this out, have some fun with it.
You'll realize it's very powerful, and it will get you up and running fast.
Thanks so much for watching.
[place holder]



