Categories
Flash

More Casting Calls for Dummies

From the very basic Flash Class…

In flash everything is an object, buttons, MovieClips, text boxes.
Objects are built from blueprints called Classes
Classes have properties and methods (or functions)

Flash needs to know what classes the object is associated with

Objects are built from Classes so I (Mark) am built from the Man class

I’m also built from these other classes
Vermonter
Armenian
ComicBookGeek
Dad

So I can do all the things involved with this like, garden,eatBaklava, washDishes, readComics, helpWithHomework, cook, doWash

These are the equivalent of flash’s _mc.gotoAndStop, _mc.play() _mc.stop().

With the main timeline it is a container that holds all of our display objects, Flash needs to be told how to think of it

So on Sundays, having been busy with my many responsibilities, I have to be told to think like a man

Man(Mark).watchFootball()
Man(Mark).drinkBeer()
Man(Mark).burp()

This is called casting to class.

So to get flash ‘s main timeline or root t thinklike a movieclip we need to say

MovieClip(root).gotoAndStop(“end”)

Categories
Teaching

Casting Timelines as Movie Clips to get them to work!

I think there are no global variables in timelines any more in AS 3… I can declare a variable at the top and a nested movie clip can’t find it, sighhh. It seems easier to work in classes by the day, of course teaching classes is a bear. Teaching classes, teaching Flash, and teaching programming all at once is a very big bear.

In rewriting a Flash class for AS 3 all my strategies for revealing the structure of Flash by example need to be re-worked

When an undefined property or function or undefined something is showing up it is often because Flash is treating the object as a display container and not a movie clip, to get this to work cast the reference as a MovieClip

MovieClip(this.parent).gotoAndPlay

more at <a href=”http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip”>Casting</a>

And to get nested MovieClips to work with ActinScript ont he timeline you have to name them at the start of the MovieClip, it seems that each movieclip is a class in the program so any variables not declared (movie clips on the timeline are objects to reference them they need a name) can be renamed eventually, my head is spinning spinning spinning on getting this to work.

 

Categories
Drawing Flash Teaching

Flash full screen

[kml_flashembed movie=”http://www.markbadger.org/drawing/ffullScreenTest.swf” height=”480″ width=”480″ allowfullscreen=”true”/]

The Defender, a hero for the ACLU

Categories
Teaching

Old school is cool school

Gorgeous paintings from turn of the century illustrator William Lee Hankey, check it out for more!

Powered by ScribeFire.