Wednesday, August 22, 2007

I've been thinking about this post in relation to flash and websites and the lack of detail that most websites have. I spend most of my time laying out boxes and dealing with functional things that I dont make many things this rich in detail. I've seen a few things that have tried but the thing that sicks in my mind from the post is how so many print designers are trying so hard to push the idea of motion and energy into things that are flat. The great thing about flash is that you can make these things move and animate, the thing that is difficult is to make this animation this perfected, dynamic and rich. Some would say that doing it on the timeline is where it is at but I feel like I need to write some classes to dynamically create this type of effect to any element on any event. Imagine you click submit and rather then getting a progress bar you get a sparking explosion of light and graphs. All it is doing is distracting the user from the time that it is taking to save what they have submitted but why not use this time to impress them with visuals. I've been making flash sites for a long time and the thing that sells is this stuff, some would argue that it is annoying but it is also the same thing that gets people hooked. It's not for everything but for some audiences there is nothing better. Stay tuned!

Labels:

Wednesday, August 15, 2007

I WON THE FLASH ON THE BEACH CONTEST

I'M GOING TO FLASH ON THE BEACH!!!!!!!!!!!!

FlashCoderNY the flash group that I'm a part of has a sister group in FlashBrighton, they are part of Flash on the Beach and as part of this whole thing the good people in Brighton held a contest to make an awesome banner to get tickets to the event. The New York group judged the Brighton banners and they judged ours and it turned out that I WON!!!! Here is what I made,



Can't say it is the greatest thing I've ever made but this birthday card for a friend that I just made might be!

Labels:

ActionScript 3 access movie clips like you did in AS2

So the old way of getting to movieclips was kind of nice, you could just use there name and drill through things. There is now in AS3 a separation between classes and displayobjects so now you can use the dot syntax on class instances like so... this.class1.class2.class3 but you can't do the same with movie clips like you could... _root.mc1.mc2.mc3 you have to this.getChildByName("mc1").getChildByName("mc2").getChildByName("mc");

Personally I think this isn't as great so I made this.

Use it something like this.
var mc:DisplayObject = getElement("this.parent.myClip.childClip.childClip2", this);


public function getElement( path:String,
thisElement:DisplayObjectContainer = null ) : DisplayObject {
var pathArray:Array = path.split(".");
var baseElement:*;

if( pathArray[0] == "root" ) baseElement = target;
else if( pathArray[0] == "this" ) baseElement = thisElement;
else if( pathArray[0] == "parent" ) baseElement = thisElement.parent;

var pathObject:* = baseElement;
var currentPart:int = 1;
loop();
function loop() : void {
if( currentPart != pathArray.length ){
if( pathArray[0] == "parent" ) pathObject = pathObject.parent;
else pathObject = pathObject.getChildByName( pathArray[currentPart++] );
loop();
}
}
return pathObject;
}


I was thinking adding nextSibling type calls might be nice also but this does what I wanted for now.

Labels: ,

ActionScript 3 Search through the display list for something

Search through the display list and return the first movie clip with this name. it helps if your names are all unique.


public function getElementById( n:String, c:DisplayObjectContainer = null ) : DisplayObject {
if( c == null ) { c = target; }
var returnValue:DisplayObject;
if( c.name == n ){
returnValue = target;
}else{
if( c.getChildByName( n ) ) { returnValue = c.getChildByName( n ); }
else{ loop( n, c ); }
}
function loop( id:String, container:DisplayObjectContainer ) : * {
for (var i:uint=0; i < container.numChildren; i++) {
const child:* = container.getChildAt(i);
if( container.getChildAt(i) is DisplayObjectContainer ) {
if( child.getChildByName( id ) ){ returnValue = child.getChildByName( id ); break; }
else{ loop( id, DisplayObjectContainer(child) ); }
}

}
}
return returnValue;
}


Search through the display list and return the object.

Labels: