Posts Tagged ‘panels’

Capping Machine V.2

Tuesday, April 28th, 2009

Capping Machine V.2 – used for capping expandable panels (or anything really) on rich media platforms uses the Adobe Shared Objects and the date functionality. Set the “var capNum = 5;” with etc value to set the amount of times the panel will be seen/capped. Its compatible with all browsers and OS esp Vista – have fun ;)

Also checkout my AIR #Shared Objects application – remove your flash cookies quickly & easily.

////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////

/*
	Capping Machine V.2
	kurt grung 3L3373.com
*/

trace('-------------------------\n Capping Machine V.2 int\n-------------------------');

//settings
var campaignName = "cappingMachineV2"; //project name
var capNum = 5; //ammount of times you want the panel to be seen

//stamp
myDate = new Date();
dd = myDate.getDate();
mm = myDate.getMonth();
stampDD = (dd);
stampMM = (mm);

//check
userData = SharedObject.getLocal(campaignName, "/");
if (userData.data.stampdd != undefined) {

	trace('stored data detected - ckeck');
	trace('todays time stamp = d/'+stampDD+" m/"+stampMM);
	trace('stored time stamp = d/'+userData.data.stampdd+" m/"+userData.data.stampmm);

	//check
	userData = SharedObject.getLocal(campaignName, "/");	

	if (stampDD > userData.data.stampdd || stampMM > userData.data.stampmm) {

		trace('new date data detected - rest data & display float for today');
		//
		var userData:SharedObject = SharedObject.getLocal(campaignName, "/");
		userData.data.stampdd = stampDD;
		userData.data.stampmm = stampMM;
		userData.data.numx = 1;
		//
		trace('saved new user data - seen ad # '+userData.data.numx+'Xs.');
		//
		EB.ExpandPanel("float");

	} else {
		trace('data match found - start MPU');

		//
		if( userData.data.numx < capNum ){

			numX = userData.data.numx;
			userData.data.numx = numX+1;
			trace('seen ad # '+userData.data.numx+'Xs.');

			EB.ExpandPanel("float");
		}

		//go and play animation/frame etc.
	}
} else {

	//sateOne - reset back to default state
	EB.ExpandPanel("float");

	//clear and save new Objs
	userData.clear();
	var userData:SharedObject = SharedObject.getLocal(campaignName, "/");
	userData.data.stampdd = stampDD;
	userData.data.stampmm = stampMM;
	userData.data.numx = 1;

	trace('displayed float today - saving data - seen ad # '+userData.data.numx+'Xs.');
}

//btns
delBtn.onRelease = function() {
	userData.clear();
	//
	trace('delete shared objects');
};

////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
Vote in HexoSearch
  • Categories

  • Recent Comments

  • Recent Posts

  • Tumblr

  • Flickr Recent Photos

    cherry tree woodstonja_gravestonesPockey Chimp FlavourAUTO FTW! :)darkdaystayouttiger kittenbirdofpreyfirst photo i took with my 1000dself_portrait_02
  • XFIRE (wkly hrs pld)

  • Last.FM

  • Tags

    .MP4 Actionscript Action Script Advertising AS2 AS3 backtrack BT4 bug Call of Duty capcom centOS COD count down countdown crossdomain Eyeblaster eyeblaster HD f4v Flash h264 HD high definition Install internet explorer Linux loadMovie MIME MIME Types MW2 Nazi Zombies pc PHP ports preloader release date rich media shared objects SWF SWFOBJECT timer torrents Video video/mp4 win7