Friday, January 16, 2009
LookieLoads
Today somebody sent me a great site which just puts the artwork of website preloaders on display. It sounds like a joke but really when you just take a minute to look at what is essentially miniature artwork - it gives it a whole new spin (pun intended).
PrettyLoaded
It's also a great site for preloader inspiration.
PrettyLoaded
It's also a great site for preloader inspiration.
Labels: flash, inspiration, look book, preloader
Wednesday, December 3, 2008
Knowing your roots
The best way to grasp something is to explain it to somebody else. SO - I just learned this today and thus this blog is my "explanation to somebody else" (that might be useful to somebody in a google search one day.)
With AS3 came the elimination of "root". I had just learned AS2 roots and then boom... you've got to start all over because there ain't know root no mores!
Basically - in AS2 you can put all of your code on frame 1 of the main timeline - including your functions and global variables. Then if you make nested movieclips (as I do.. nested with nested within nested) you could call up to the function or movieclip in the main timeline by prefacing it with "root." Like so: "root.book_mc.gotoAndPlay("page1");"
Pretty simple once you got the hang of it. It was rather like a man in a sewer calling up to his buddy on the street level to say "Hey, throw me down a bottle of water." Or "Hey, can you call my wife and tell her I'll be late to dinner?"
Well now in ActionScript 3 there is no "root." (Well, actually there IS a root but it does something different that I just don't understand.) Instead you use "MovieClip(this.parent)". Or "MovieClip(this.parent.parent)" if you're nested two deep. (Or MovieClip(this.parent.parent.parent.parent.parent)...etc... although I don't know how far down you can drill before everything just explodes.)
For example - let's say that I have a MovieClip called "book_mc" and inside of that I have a MovieClip called "pages_mc" and inside of THAT I have another MovieClip called "words_mc". Now let's say that inside of "words_mc" I have a MovieClip called "button_mc". And when I click on this button I want the book to go and play it's animation of the book closing. (This blog would be helpful with graphic explanations... but alas... no graphics for you!)
In my code I would first clarify where exactly I was by using a trace statement (within an MouseEvent.CLICK function) like so: "trace (this.parent.name)" This is saying, "Hello button upon which I have just clicked... what is your Mom's name?" (Where "trace (this.name)" would yield a result of "button_btn", by putting the "parent" in there I would instead yield "words_mc".)
OK so now I know that I'm inside of words_mc. And I already know that words_mc is inside of pages_mc which is inside of book_mc. So in order to tell the book to close I would have to write something like "MovieClip(this.parent.parent.parent).gotoAndPlay("closeBook")". In order to call a FUNCTION on the main timeline I would write something like "MovieClip(this.parent.parent.parent).functionNameHere();"
These periods, btw, are actually "dots" and what I'm doing here is called "dot syntax."
Got it now?? Good. Instead of the man in the sewer this is more like some annoying guy at a mixer who is REALLY INTO genealogy, "Hi, who's your Mom? And who is her Mom? And what was her Dad's name? And his Dad? Yeah, I was wondering, could you please ask your Great Great Great Grandfather to send a message to Marty McFly? Awesome!"
(But I don't mean to confuse you... we're not actually time travelling. It's more like the man in the sewer saying, "Hey, I'm on this ladder, and this ladder is attached to a truck, and the truck is on the road and the road is in the universe and we are ALL in the Matrix!")
Damn! I better understand this now.
(Also check this FlashKit.com forum post for another, cleaner, way to do it in a more OOP way.)
With AS3 came the elimination of "root". I had just learned AS2 roots and then boom... you've got to start all over because there ain't know root no mores!
Basically - in AS2 you can put all of your code on frame 1 of the main timeline - including your functions and global variables. Then if you make nested movieclips (as I do.. nested with nested within nested) you could call up to the function or movieclip in the main timeline by prefacing it with "root." Like so: "root.book_mc.gotoAndPlay("page1");"
Pretty simple once you got the hang of it. It was rather like a man in a sewer calling up to his buddy on the street level to say "Hey, throw me down a bottle of water." Or "Hey, can you call my wife and tell her I'll be late to dinner?"
Well now in ActionScript 3 there is no "root." (Well, actually there IS a root but it does something different that I just don't understand.) Instead you use "MovieClip(this.parent)". Or "MovieClip(this.parent.parent)" if you're nested two deep. (Or MovieClip(this.parent.parent.parent.parent.parent)...etc... although I don't know how far down you can drill before everything just explodes.)
For example - let's say that I have a MovieClip called "book_mc" and inside of that I have a MovieClip called "pages_mc" and inside of THAT I have another MovieClip called "words_mc". Now let's say that inside of "words_mc" I have a MovieClip called "button_mc". And when I click on this button I want the book to go and play it's animation of the book closing. (This blog would be helpful with graphic explanations... but alas... no graphics for you!)
In my code I would first clarify where exactly I was by using a trace statement (within an MouseEvent.CLICK function) like so: "trace (this.parent.name)" This is saying, "Hello button upon which I have just clicked... what is your Mom's name?" (Where "trace (this.name)" would yield a result of "button_btn", by putting the "parent" in there I would instead yield "words_mc".)
OK so now I know that I'm inside of words_mc. And I already know that words_mc is inside of pages_mc which is inside of book_mc. So in order to tell the book to close I would have to write something like "MovieClip(this.parent.parent.parent).gotoAndPlay("closeBook")". In order to call a FUNCTION on the main timeline I would write something like "MovieClip(this.parent.parent.parent).functionNameHere();"
These periods, btw, are actually "dots" and what I'm doing here is called "dot syntax."
Got it now?? Good. Instead of the man in the sewer this is more like some annoying guy at a mixer who is REALLY INTO genealogy, "Hi, who's your Mom? And who is her Mom? And what was her Dad's name? And his Dad? Yeah, I was wondering, could you please ask your Great Great Great Grandfather to send a message to Marty McFly? Awesome!"
(But I don't mean to confuse you... we're not actually time travelling. It's more like the man in the sewer saying, "Hey, I'm on this ladder, and this ladder is attached to a truck, and the truck is on the road and the road is in the universe and we are ALL in the Matrix!")
Damn! I better understand this now.
(Also check this FlashKit.com forum post for another, cleaner, way to do it in a more OOP way.)
Labels: actionscript3, flash, tutorials
Sunday, November 23, 2008
Transparent PNGs
PNGs are beautiful things ... except when it comes to IE6. Bleh! Here they are - so pretty and beautiful... and then you open up your damn site in IE6 and you get that ugly grey box. Well thanks to a friend at school I now know the solution and that solution lives here: http://www.twinhelix.com/css/iepngfix . I cannot even BEGIN to tell you what the hell is going on in that code that that generous person has coded for general use but I know that it is revolutionary and magical (for me). (FYI - as of this moment, 2492 other people have bookmarked that link on Delicious.)
(Not as revolutionary and magical as when I learned how to make transparent backgrounds in Flash but still it opens up whole new worlds.)
(Not as revolutionary and magical as when I learned how to make transparent backgrounds in Flash but still it opens up whole new worlds.)
Labels: flash, illustrator, photoshop, png, transparency, webdesign





