Tag: Flash Back’

An homage to Shep….

 - by cathcw

Flash Back Week 2…

I had a gchat conversation with a good friend at the Berkman Center today.  It reminded me of the fun we had this summer in the Sheep Cave (the name for the office where some of the Herdict team sit).

I’m in the middle of some Flash animation assignments at the moment, specifically to make a object move when the mouse is clicked,  I haven’t completely managed to nail the assignment yet – but in the meantime – this one is for the Sheep Cave.  Click around on the screen to make the sheep move).  I’d like him to glide rather than leap – more soon…

Shep

Code here:

package {
import flash.display.MovieClip;
import flash.events.MouseEvent;

public class cath_2v2 extends MovieClip {
// sheep is a class variable
// this way the function “comeToMe” knows it
private var sheep:MovieClip;

public function cath_2v2() {
sheep = new Sheep();
addChild(sheep);
stage.addEventListener(MouseEvent.MOUSE_DOWN, comeToMe);
}

private function comeToMe(event:MouseEvent):void {
// make the sheep movieclip goes where the mouse was clicked
sheep.x = event.stageX;
sheep.y = event.stageY;
}

}
}

A bit Flash…

 - by cathcw

Danny Rozin has a new exhibition at Bitforms in NYC, you should go see it, its wonderful.  Danny taught me Introduction to Computational Media last year.  It was an introductory class in Processing.  I was widely acknowledged to be the worst in the class.  Possibly the entire year.  On Saturday, at his exhibition opening evening, I proudly told Danny that in a fit of tenacity I was having another crack at a programming class, to which he replied, looking quite panic stricken “not one of mine though?”

Danny, you’re spared this semester, am taking Veronque Brossier’s Flash Back class “aimed at programming novices or at students who would just like to try Introduction to Computational Media again …

More fully (from the ITP website):

“Programming is often viewed as an arcane art, an esoteric skill that is far removed from design and user experience. With the advent and evolution of higher-level programming languages, however, the power of coding is becoming accessible to an increasingly broad audience of designers, artists, and enthusiasts. This course explores the use of programming as a tool to sculpt interactive experiences, in the context of Macromedia Flash’s Actionscript programming language. Students focus on core programming concepts, and use these basic concepts to prototype personal projects. While the focus of the course is on developing with Actionscript, the concepts learned are common to all programming languages. This class is aimed at programming novices or at students who would just like to try Introduction to Computational Media again in a different, higher level language and environment. It also fulfills the ICM requirement for those who have not yet taken it.”

Essentially, I’d really like to be able to discuss coding intelligently with programmers (very hopeful), even though I probably won’t be coding in the future.  I’m desperate to figure my arrays, classes and variables.  Also, everyone here at ITP seems to know what Flash – I really don’t want to be a dumbass on this one anymore.

Class examples: week 1

We covered the basics this week, variables, classes, inheritance – parents, children etc.  In addition, an overview of how to create .fla and .as files in Flash.  Main example here:

package {
import flash.display.MovieClip;
public class Main extends MovieClip {
public function Main() {
trace(“hello”);
trace(myCircle); // this assumes that a movieClip with that name is on the stage
var white = new White(); // this assumes that a movieClip with the LINKAGE name “White” is in the library
addChild(white);
var yellow = new Yellow(); // this assumes that a movie clip with the LINKAGE name “Yellow” is in the library
white.addChild(yellow);
}
}
}

Assignment

Create a fla, create a few shapes, convert them to movieclips (they will appear in the library), create a documentClass (put fla and documentClass in one same folder), add the name of the documentClass in the fla under the properties panel, write a trace statement to make sure that fla is linked to the document class, place a movie clip on the stage and give it an instance name, trace that it is visible in your class and change one of its properties (x or y coordinates), remove movie clip from stage, give it a linkage name in the library, now attach the movie using code only, trace its presence, add it to the displayList, now add another movie clip inside the first movie clip (remember the egg example).

Being completely new to this program, I started with the basic introductory tutorial on the Flash site.  The task was to create an animated symbol, in this case, a bouncing ball.

Next, the assignment above.

Step one: create .fla file called cw_1v2.fla and create 2 symbols (green oval called my_circle and blue one called my_circle_2

Step two: substitute into the above code as follows:

package {
import flash.display.MovieClip;

public class cw_1v2 extends MovieClip {

public function cw_1v2() {
trace(“hello”);
//trace(); // this assumes that a movieClip with that name is on the stage
var my_circle = new My_circle();// this assumes that a movieClip with the LINKAGE name “My_circle” is in the library
addChild(my_circle);
var my_circle_2 = new My_circle_2();// this assumes that a movie clip with the LINKAGE name “My_circle_2” is in the library
my_circle.addChild(my_circle_2);
}
}
}

Step three: at this point, I had not realized I had to link the .fla and the .as files via naming the document class cw_1v2 via file –> publish settings –> settings

Step four: remember to create linkage names otherwise nothing will happen….

Step five: publish as an html as before.

Finished result looks like this:

.swf file