Skip to content

Schnitzel recipe and MovieClips

September 19, 2006

I like good food.
What I like the most is our familly tredition to have a schnitzel and french fries lunch every friday. I woldn’t trade it for anything. My mom makes the best schnitzels in the world. Mmmmmm… I’m hungry. I’m going to eat something, don’t go away.

Ahhh Tanks for staying. 😀
To make schintel you’ll need a good chicken breasts cut to a piece in a size of a normal shoe sole. Some people like to beat it to make it thinner, my mom never do it, that way it stays jucy and moisture. For the crust you’ll need a flour, some scrambled eggs and bread crums.
Now take a piece of meet, put it in the flour then pass it to the eggs for a second layer, and then the bread crums. Make sure it is covered perfectly by the materials before you pass it to the next one. Now just put it in a boiled oil until it get brown from both of it sides.
Delichious!

BUT WAIT! What does it have to do with MovieClips?!
Well, That exactly is the concept behind the core of my framework.
To achive the three goals I designated to the framework: Easy and uniform events for movieclips, extends the movie clip abillity without extending the movieclip and keeping the movie clip identity – I made the core like a schnitzel recipe:

First I made a MovieClipWrapper. Not very usefull class to use, but crusial for the identity of the movieclip in the framework. It is the glue of the latter parts.
It can take as an argument a refference to a movie clip, then it just wrap it. or a refference and a name, then it wraps the clip inside the refference, or a clip and a name and a depth, then it creates an empty movie clip, or a clip and a name and a depth and a linkage, to attach a librery symbol.
It also has the commands to create a child a remove a child with the same aguments. And most important, keep a refference to the MovieClipWrapper hirarchy, with _parent and _children that is parralel to the wrapped movie clip hirarchy.

The second layer actually extends the wrapper. It is the MovieClipEvents class. By using an extended delegate class I was abel to unify all the movie clip native events like “onPress” or “onEnterFrame” that was a simple non intuitive and non OOP friendly callback function, to a united “addClipEvent” witch works the same as “addEventListener” that we know from EventDispatcher or the UI components, but for movie clip events. addEventListener still exist, for general event dispatching, but I porpusly made a uniqu function for movie clip events.

And now the bread crums of the framework, the third layer, extending the second one: MovieClipCommander. Stuck strongly to the movie clip from the Wrapper, and abel to handle complex events from the Events, and using ServiceProvider introduced before, this class enable you to easly manage services, or extentions, or plugins for a movie clip – and still keep its identity.

After creating the MovieClipService class witch is an abstract plugin, with all the code of attaching and interacting with ServiceProvider and MovieClipCommander already implemented in it. All needs to be done, is create a class that extends MovieClipService, and….. Thats it!

I know its very vage right now. I’ll try to explain again:
There are no operative actions in MovieClipCommander, and no need to extend it. To make a custome MovieClip behaviour you need to extend MovieClipService, and register your class to the commander using “registerExtention”. That is it. The power discernable when two or more extentions are registered to a commander.

Its not quite obvious yet. Stay tuned for more posts to get a better explenation, and, hopely soon, download the framework.

Till then, have fun. Enjoy your schnitzel. 🙂

Advertisements
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: