This week we’re looking at adding interactivity to masks like used in the examples below:
~
I grabbed these images of a flash designer/developers site : http://www.peteshand.net/ (hopefully he doesn’t mind us borrowing them)
~
~
~
Sep 16
Posted by Andy in Lecture Notes, Lecture Updates, Semester 1, Semester 2, Uncategorized | No Comments
This week we’re looking at adding interactivity to masks like used in the examples below:
~
I grabbed these images of a flash designer/developers site : http://www.peteshand.net/ (hopefully he doesn’t mind us borrowing them)
~
~
~
Apr 6
Posted by Andy in Lecture Notes, Lecture Updates, Semester 1, Semester 2, Uncategorized | No Comments
Here are the source files for all the examples we looked over last fri.
~
First is the completed version of the click drag explode example we were working on in class.
Download click drag explode complete Source Files
Number of Downloads: 36
~
Everything else including more basic examples of drag drop and the loader class is in the download below
~
Number of Downloads: 16
Apr 3
Posted by Andy in Lecture Notes, Lecture Updates, Semester 1, Semester 2, Uncategorized | No Comments
This week we’re covering adding and removing children to the display list, which we’ve already used the basics of with addChild and removeChild. We’ll also be going through alot of the other methods available for parenting objects and get into some drag and drop and hit test functionality. Hopefully if there’s time we’ll cover loading and unloading external swfs as well. ~ The example we’re going to make is this one below which builds on some of the previous topics we’ve learned about event propogation, mouseEvents and enter frame events.
~
-Click on the “new star” button to add a star to the white container.
-rollover the stars to make them spin -click and drag the stars around the stage
-drag the star over the skull and cross bone to explode it and remove it.
-turn the boundaries of the draggable area on or off with the “toggle Boundary” button
Download week Click Drag Explode starter files
Number of Downloads: 50
Download Size: 732.7 kB Download Updated: April 3, 2009
Mar 30
Posted by Andy in Lecture Notes, Lecture Updates, Semester 1, Semester 2, Uncategorized | No Comments
Below are the examples for the exercises we were doing in week 4.
The name of the ftp client I showed you at the end was “FileZilla”
and it is available for free from:
~
http://filezilla-project.org/download.php?type=client
~
Download week 4 examples Source Files
Number of Downloads: 39
Download Size: 32.5 kB Download Updated: March 30, 2009
Mar 21
Posted by Andy in Lecture Notes, Lecture Updates, Semester 1, Semester 2, Uncategorized | 1 Comment
This is an update to the example we did in class about adding MovieClips from the library and removing them from the stage. After the class I realized there was an easier way to write this that acutally used less AS3. The AS3 used for this example is below it along with the source files for download.
//makesure you have a MovieClip in the Library exported for ActionScript with the class: Star //create a new variable and datatype it as a Star (the MovieClip you have in the library) var newStar:Star; //add a mouseDown listener to the stage that will call the function addRemoveStar stage.addEventListener(MouseEvent.MOUSE_DOWN, addRemoveStar); //BestPractice (no stage / weak reference): this.addEventListener(MouseEvent.MOUSE_DOWN, addRemoveStar, false, 0, true); //write the function addRemoveStar function addRemoveStar(e:MouseEvent) //BestPractice(return void): function addRemoveStar(e:MouseEvent):void { //create a variable named objectClicked and store the target of the MouseDown Event //(it will either be the stage or something that has been added to the stage like a newStar) var objectClicked = e.target; //create an if statement to find out if the target of the mouseDown event was the stage or a newStar if(objectClicked == stage) { //when the target of the mouseDown event is the stage, create a new instance of the Star called newStar newStar= new Star; //position the newStar at the x and y coordinates of the mouse newStar.x = mouseX; newStar.y = mouseY; //add the newStar to the stage stage.addChild(newStar); } //when the target of the mouseDown event is not the stage it means it is a newStar else { //remove the newStar that was clicked (the target of the mouseDown event) stage.removeChild(objectClicked); } }
Download starClick Source Files
Number of Downloads: 34
Download Size: 6.3 kB
Download Updated: March 21, 2009
Mar 20
Posted by Andy in Lecture Notes, Lecture Updates, Semester 1, Semester 2, Uncategorized | No Comments
~
http://www.sonacom.fr/sonacom.html
http://www.pearljamtengame.com/
~
~
~
If your like I was when I started learning AS3 with no prior programming experience then the previous paragraph and a lot of the information out there about AS3 probably means absolutely nothing to you. Don’t worry this 1st semester course is going to be about making AS3 as easy as possible for you to learn and give you the foundations from which you will be able to make all sorts of things in flash.
~
Rather than confuse you with a whole bunch more introductory technical talk (that didn’t start to really make sense to me until after about a year of using AS3), we’re going to jump straight in and start making things move and interact.
~
We’re going to use the smallest amount of code possible while keeping it basic which means that not everything we learn at first is going to be considered “Best Practice”. As we get more used to using AS3 I’ll introduce the extra things you should do when writing your AS3. Keep in mind that for most people using AS3 (definitely including me) no matter how long they’ve been programming there is probably a better or more efficient way of writing the code but as long as the finished product does what you want it to then the code is correct… (Author of Essential ActionScript 3 Colin Moock said something along those lines when I saw him present in Sydney last year)
~
~
The obvious place to start is using AS3 to control the playback of the Stage and MovieClips.
~
The blue bits are the parts you keep and the green parts need to be changed.
~
stop()
Stops the playhead in the movie clip or main timeline at the Keyframe (F6) the AS3 is written on.
~
Starts playing the SWF file at the specified frame.
~
gotoAndStop(frame number or name)
Brings the playhead to the specified frame of the movie clip and stops it there.
~
~
One of the most important things about learning to program AS3 is learning to use the Help Docs. This can be hard at first because they can seem very hard to understand but it’s worth getting into the habit of using the help docs all the time.
~
To find out the rest of the “methods” (ways in which we can control timelines like: “stop()“) for MovieClips:
1. Type MovieClip into the actions panel. (it should be blue)
2. With the cursor somewhere in side the word hit F1 on the keyboard.
3.This will launch the help docs at the page with all the information about MovieClips.
4.To see other Methods that can be used with MovieClips go down to the “Public Methods” section.
5. The ones listed are Methods specific to MovieClips but there are a whole lot of extra ones that can be used with MovieClips because MovieClips are based on other Objects that have Methods of there own. Don’t worry if that didn’t make sense, just click
Show Inherited Public Methods to see the rest of the things you can get MovieClips to do with AS3.
You are currently browsing the archives for the Lecture Updates category.
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Aug | ||||||
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | |||
Arclite theme by digitalnature | powered by WordPress