Posts tagged as "AS2"
  • AS2 :: Animator Class

    Nothing special here. This is just a helper class for the TileMaker class. It only has (1) method animate which I made static so you don’t have to create instances of this class.

    import mx.transitions.Tween;
    import mx.transitions.easing.*;
     
    class org.thesourcecode.effects.Animator extends MovieClip
    {
     
    	private function Animator(){ super(); }
     
    	static public function animate( clip:MovieClip, newx:Number, newy:Number, tweenType:Function )
    	{
    		var xTween:Tween =READ MORE
  • AS2 :: XMLMenu Class

    Goal: minimize the amount of code rewrite involved in creating XML-based menus in Flash. You can customize the Class to match the structure of your XML file.

    class org.thesourcecode.utils.XMLMenu extends MovieClip
    {
    	//declare your variables
    	private var _i:Number;
    	private var _j:Number;
    	private var _mainTL;
    	private var _btns:XML;
    	private var _butz:Array;
    	private var _tmpX:Number;
    	private var _tmpY:Number;
    	private var _btn;
    	private var _xmlfile:String;
    	private var _menutarget:MovieClip;
    	private var _space:Number;
    	private var _vertical:Boolean;
     
    	public function XMLMenu()
    	{
     
    	}//endREAD MORE
  • AS2 :: CuePoints Class

    Goal: Wanted to simplify cue point usage for FLVs that needed text captions. The repetitive static code is placed in the class file leaving the dynamic stuff for the FLA.

    import mx.utils.Delegate;
     
    class org.thesourcecode.utils.CuePoints
    {
    	private var _vid;
    	private var _arr:Array;
    	private var _ct:TextField;
    	private var _cf:Function;
     
    	public function CuePoints( co:Object )
    	{
    		_vid = co.video;
    		_arr = co.cues;
    		_ct =READ MORE
  • AS2 :: TileMaker Class

    Came up with this one after a number of posts over @ gotoAndLearn() about making grids from XML files. Since I’m all about reusability, I devised an easy way to create animated thumnail tiles for an XML photo gallery could be an XML video galleryREAD MORE

  • AS2 :: FlashCookie Class

    Goal: Create a simple way to incorporate SharedObjects into Flash-based forms.

    class org.thesourcecode.utils.FlashCookie
    {
       private var _mainTL:MovieClip;
       private var _cookie:SharedObject;
       private var _cookieName:String;
       private var _chips:Object;
     
       public function FlashCookie( newCookie:String,target:MovieClip )
       {
          this._cookieName = newCookie;
          _cookie = SharedObject.getLocal( _cookieName );
          _mainTL = target;
       }
     
       public function bakeCookie( obj:Object ):Void
       {
          var i:String;
          for (i in obj)
          {
             _cookie.data[ i ] = obj[ i ];
             _cookie.flush();
          }
       }
     
       public function getChip( str:String ):String
       {
          return _cookie.data[ str ];
       }
     
       public function getChips():Object
       {
          _chips = _cookie.data;
          return _chips;
       }
     
       public function getCookieName():String
       {
          return _cookieName;READ MORE
  • AS2 :: Guestbook Class

    Goal: To devise an easy way to add user interaction to a full-Flash site, in this case a guestbook.

    class org.thesourcecode.utils.Guestbook
    {
    	private var _earl:String;
    	private var _display;
    	private var _getEntries:LoadVars;
    	private var _sender:LoadVars;
    	private var _receiver:LoadVars;
    	private var _refresh:LoadVars;
    	private var _mainTL:MovieClip;
    	private var _validname:Boolean;
    	private var _validemail:Boolean;
    	private var _validcity:Boolean;
    	private var _validmsg:Boolean;
    	private var _array:Array;
    	private var _uri:String;
     
    	public function Guestbook( target:MovieClip )
    	{
    		_mainTL = target;
    	}//end constructor
     
    	//retreive the specified posts
    	public function getPosts( url:String, target, min:Number, max:Number )
    	{
    		_earlREAD MORE
  • AS2 :: BackgroundFill Class

    Goal: To devise an easy reusable way to create seamless backgrounds for full-screen Flash movies whether it be gradients or bitmaps. Works with a “bg” Object customized to your needs.

    import flash.display.BitmapData;
    import flash.geom.Matrix;
     
    class org.thesourcecode.utils.BackgroundFill
    {
    	private var _main:MovieClip;
    	private var _sub:MovieClip;
    	private var _w:Number;
    	private var _h:Number;
    	private var _gradient:Object;
    	private var _bitmap:String;
    	private var _fillType:String;
    	private var _colors:Array;
    	private var _alphas:Array;
    	private var _ratios:Array;
    	private var _matrix:Matrix;
    	private var _tile:BitmapData;READ MORE
Get Adobe Flash playerPlugin by wpburn.com wordpress themes