Archive for the 'tutorial' Category

Adobe Feeds and some Link Lovin

So last night I was watching twitter and saw that Adobe got up the MXNA feeds.adobe.com! This is a great resource for flash developers or anything Adobe and more. It gives you a great centralized location to find great information on application development and creativity from many different backgrounds. Take a look for your self!

Also stealing a bit of a great idea from a favorite blog of mine (eismann-sf.com/news) I've decided to start posting some of my favorite links I have discovered. Not sure how often this is going to happen but it will  be easier for you all to find some fun links I found on here, instead of having to check my messy del.icio.us account!

With that said enjoy the links:
http://www.derailer.org/paparazzi/ - screenshot util for OSX that captures whats outside the view port.
http://twistori.com/ - twitter experiment
http://dev.papervision3d.org/ - papervision developers resource
http://tinyurl.com/68ppww - inspirational PDF magazines from smash magazine
http://www.footloosemoose.com/michael_wp/ - flash developer blog

Google Analytics + Flash = Easy Peasy…

You're clients will love it! And in the end you will know more about the sites you build and how to better drive traffic to certain areas! Win! Win!

googleanalytics.jpg

Ok so I have been using Google Analytics for quite sometime now and I must say i love it! So if you don't know by now Google provides FREE website statistics that go above and beyond any stat tracking systems I have seen to date. Well that is for something that is FREE. Anyway I want encourage all of you to get out there and start using Google Analytics for all your flash site going forward. Its really very simple to implement into your flash sites and even track individual events that occur in each of your sites. Please see analytics.google.com for more information on setting up your personal analytics with google and to get the Javascript needed for the code below to work. With that said let's get on to some actionscript!

googleAnalytics.as (right click - save as)

 
/// GOOGLE ANALYTICS SIMPLE TRACKING
/// Script by: corban baxter
 
import flash.external.ExternalInterface;
 
function gaTracking(page) {
	ExternalInterface.call("pageTracker._trackPageview", page);
}
 
//end

Code for simple call

 
gaTracking("/flash/home"); //sends event to google's analytics system

Now what you can understand from this is... You can call this function during ANY event function etc that you so desire. And any string combination that you want to pass to it is fair game. Use best practices when passing in the strings though so its easier for you and your clients to read when you all are reviewing the numbers. Ok so thats that! Cheers!

Tutorials and rapid flash development.

This weekend while I was doing some work around my place I got the idea to create a post page of the tutorials/examples I have available on this site. Right now there is only a few pieces on this page but its going to become a quick easy way for all my visitors to find the posts I have written about action script. Specifically code examples I have built and that I want to share with all of you. I have a lot of plans to build quite a bit in this area this year. My hope is to keep updating so that it can grow into a resource for students, other developers or anyone wanting to learn more about actionscript and flash. So keep an eye out over the next few weeks as I plan to build quite a few flash projects that are simple yet have real world appeal!

Mostly you are going to find examples on SWX, Fuse, GAIA (as I learn it) and anything flash related that I find relevant to rapid site development. You might also find a few random posts on wordpress and iphone development as these are things I am becoming more and more interested in!

Rapid development is a topic I really plan on diving more and more into as my site grows. When I start talking about rapid flash site development you will see me using a lot of open source products that are easy to use for beginners to advanced developers! It will help bring your companies costs down in developing flash sites and will bring down the man hours. Enabling you to keep clients happy with beautiful crisp sites and keep your pockets full! Which is what keeps us happy and keeps our tummies full. ;) I really can't wait to share the knowledge I have learned thus far with all of you. And I REALLY hope you all can share some of you knowledge here with all of us too! So keep commenting and I can't wait to share all this info with you all!

Quick lil combo box

So today I saw that Yahoo dropped their set of ASTRA components for AS3. And... WOW is all I can say. I'm so glad to see a company like Yahoo doing this. Giving back to our community in an open source way! Its really beautiful and makes them really feel like family. Almost as much if not more than Adobe. It's just wild to see them doing almost more than Adobe does to push flash! I am thrilled to see them sharing with our community!

So just for fun I have decided to post my not so AS3 or OOP combo box. Its my first try and I built it in about 2 hours but its a great start. Its built with AS2 of course since I haven't made the leap of faith to AS3. But it works and serves its purpose. It would be really easy to extend this and make it much more dynamic and have TONS more functionality but hey its free and it will get you moving in the right direction.

So the reason I built it was it seemed like the component most art directors like to have custom designed drop downs and one of the most common in forms. All of the drop down components I have found and tried to edit have just been a 'pain in my arse'. So this is my super simple and sleek lil version. Easily editable and here for your grabin'. :) I know its not ASTRA but hey it is what it is!

Download Here


Flickr Slideshow - Take 1 (swx+fuse)

Ok so, 1, remember going into this... In no way did I ever say I was a programmer. I am a scripter at heart. Quick down and dirty, rapid development is my game and its worked well so far. There are plenty of better was to build this and extend it. All of which I would like to hear about! So here goes my version of an incredibly quick build of a simple swx+fuse image slide show! Enjoy!

So this is a simple copy, paste and your ready to go! But that's not why I am sharing the code. This was built to show whats possible and to get you started on building your own bigger, faster and stronger version of the same thing. I really encourage all of you to share with us what you have done with this code and how we can all become better coders ourselves from sharing and collaborating.

The following code will allow you to pull recent public photos or even photos from your favorite user and just the change of a methodType. Also please be sure to have the SWX class files in your project folder when running this code. Enjoy!

Update: some of the color coating is off on my style sheet. I will be updating later. Sorry. :(

Update 2: I had some requests for people to see it working. So here you go! Enjoy!

flickrgallery.swf

 
/*
 
SWX + Fuse - Take 1
 
by: Corban Baxter
 
url: blog.projectx4.com		This was written to give some developers simple a quick fix and insite
 
into rapid flash development with some great tools such as swx and fuse.
 
*/
 
import com.mosesSupposes.fuse.*;
ZigoEngine.register(Fuse, FuseFMP, PennerEasing, FuseItem);
 
import org.swxformat.SWX;
//setup the SWX object please see swxformat.org
var swx:SWX = new SWX();
swx.gateway = "http://www.swxformat.org/php/swx.php"; //please change to your domain running swx.
swx.encoding = "GET";
//swx.debug = true;
swx.timeout = 2;
 
var userName:String = "yourUserNameGoesHere"; //used for getUserPhotos method
var photoStyle:String = "small";
var numPhotos:Number = 100;
var page:Number = 1;
var myPhotos:Array;
var currentImage:Number;
var img:String;
//var methodType:String = "getUserPhotos"; //get specfic user photos
var methodType:String = "swxPhotosGetRecent"; //get public photos
var extras:String = "tags"; //comma delimited for getting extra photo info, see service for options
var images:MovieClip = this.createEmptyMovieClip("images", this.getNextHighestDepth());
var back_mc:MovieClip = images.createEmptyMovieClip("back_mc", images.getNextHighestDepth());
var front_mc:MovieClip = images.createEmptyMovieClip("front_mc", images.getNextHighestDepth());
 
function getPhotos():Void {
if(methodType == "getUserPhotos"){
 
var callParameters:Object = {
serviceClass:"Flickr",
method: methodType,
args:[userName, photoStyle, numPhotos, page],
result:[this, resultHandler],
timeout:[this, timeOutHandler],
fault:[this, faultHandler]
};
 
}else{
 
var callParameters:Object = {
serviceClass:"Flickr",
method: methodType,
args:[photoStyle, extras, numPhotos, page],
result:[this, resultHandler],
timeout:[this, timeOutHandler],
fault:[this, faultHandler]
 
};
 
}
 
swx.call(callParameters);
 
}
 
function resultHandler(event:Object) {
 
//callback to run when app has loaded the flickr image array requested
 
//trace(newline+newline+"RESULT: "+event.result);
 
myPhotos = event.result.photo;
total = myPhotos.length;
currentImage = random(total);
 
loadImage(currentImage);
 
}
 
function timeOutHandler() {
 
//do something when call fails to respond in allowed timeout period
 
//getPhotos();
 
trace("timed out");
 
}
 
function faultHandler(event:Object) {
 
//user or system error please give feedback to the users
 
//this would need to be some php call but you understand the point...
 
//getURL("mailto:hello@yourdomain.com?subject='were having flickr gallery issues'");
 
trace("critacl error");
 
}
 
var mclListener:Object = new Object();
 
mclListener.onLoadComplete = function(target_mc:MovieClip) {
 
target_mc._alpha = 0;
 
};
 
mclListener.onLoadInit = function(target_mc:MovieClip) {
 
trace(target_mc._height);
 
//fade up image and rerun the loop
 
var f:Fuse = new Fuse();
f.push({ target: target_mc, ease: "easeOutQuad", time: 1, _alpha: 100 }); //fade up front_mc
f.push({ func: setBackImage, args: img }); //places loaded image in back_mc to create a cross fade look for next iteration
f.push({ delay: 2 });
f.push({ func: loadImage, args: currentImage });
f.start();
 
};
 
mclListener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
 
trace(target + ": " + bytesLoaded + " bytes of " + bytesTotal);
 
}
 
var image_mcl:MovieClipLoader = new MovieClipLoader();
 
image_mcl.addListener(mclListener);
 
function loadImage(num:Number):Void {
 
var total:Number = myPhotos.length;
img = myPhotos[num].src;
image_mcl.loadClip(img, images.front_mc);
currentImage++;
if(currentImage == total){
currentImage = 0;
}
 
}
 
function setBackImage(img:String):Void{
trace(images.back_mc);
images.back_mc.loadMovie(img);
}
 
getPhotos();



Bad Behavior has blocked 252 access attempts in the last 7 days.