AS3 Escape / Unescape Method

August 13th, 2010
var data:String = "< \"Hello World!\" />";
trace("data= "+data);

var escaped:String = escape(data);
trace("escaped= "+escaped);

var pattern:RegExp = /\+/g;
var unescaped:String = unescape(data).replace(pattern, " ");
trace("unescaped= "+unescaped);

/*
	Output ++
	data= < "Hello World!" />
	escaped= %3C%20%22Hello%20World%21%22%20/%3E
	unescaped= < "Hello World!" />
*/
Vote in HexoSearch

Call of Duty: Black Ops CountDown Timer iPhone Web Applications

August 10th, 2010

Just watched the lastest COD: BlackOps multiplayer trailer, can’t wait for this looks amazing. I am going to setup a countdown timer for BlackOps like I did for MW2 was very popular and allot of people used and enjoyed it :)

This time around going to make an iPhone application too!

Vote in HexoSearch

OpenSSL Install Guide for centOS 5 Linux

June 13th, 2010

How to install OpenSSL onto CentOS 5

wget http://www.openssl.org/source/openssl-1.0.0a.tar.gz && tar xzf openssl-1.0.0a.tar.gz && cd openssl-1.0.0a && ./config && make && make test && make install

Download latest source: http://www.openssl.org/source/

Vote in HexoSearch

VMware for variable “config.version” is not valid in encoding “windows-1251″.

June 7th, 2010

If you are getting this error –

VMware for variable "config.version" is not valid in encoding "windows-1251".

To fix this, install the Russian language pack on Windows 7 and then your good to go.

Vote in HexoSearch

AS3 Loading Images Externally

May 11th, 2010
var imgPath:String="http://93.97.40.201/snapshot/snaps/19cdeb13f7c46bfafa75beeca361c916.png";

var _loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
_loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgress);
_loader.load(new URLRequest(imgPath));

function onProgress(e:ProgressEvent):void {
 var _progress:String="Loading "+e.bytesLoaded+" of "+e.bytesTotal;
 var _percent:Number=Math.round(100*e.bytesLoaded/e.bytesTotal);
 trace(_percent + "%");
}
function onComplete(e : Event):void {
 var loaderInfo:LoaderInfo=e.target as LoaderInfo;
 var displayObject:DisplayObject=loaderInfo.content;
 stage.addChild(displayObject);
 trace("Loading Complete!");
}
Vote in HexoSearch

AS3 Video Code Snippets

May 6th, 2010

Few handy code Snippets for when using AS3 & Video.

This can be used with FLVPlayBack Component (just remove the vars/addChilds etc):

import fl.video.*;
var myVideo:FLVPlayback = new FLVPlayback();
myVideo.source = "video.flv";
myVideo.skin = "SkinOverPlayStopSeekFullVol.swf";
myVideo.addEventListener(VideoEvent.COMPLETE, completePlay);
function completePlay(e:VideoEvent):void {
myVideo.alpha=0.2;
}
addChild(myVideo);

Net Stream Version:

var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream=new NetStream(nc);
ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
ns.play("video.flv");
function asyncErrorHandler(event:AsyncErrorEvent):void {
	// ignore error
}

var vid:Video = new Video();
vid.attachNetStream(ns);
addChild(vid);

pauseBtn.addEventListener(MouseEvent.CLICK, pauseHandler);
playBtn.addEventListener(MouseEvent.CLICK, playHandler);
stopBtn.addEventListener(MouseEvent.CLICK, stopHandler);
togglePauseBtn.addEventListener(MouseEvent.CLICK, togglePauseHandler);

function pauseHandler(event:MouseEvent):void {
	ns.pause();
}
function playHandler(event:MouseEvent):void {
	ns.resume();
}
function stopHandler(event:MouseEvent):void {
	// Pause the stream and move the playhead back to
	// the beginning of the stream.
	ns.pause();
	ns.seek(0);
}
function togglePauseHandler(event:MouseEvent):void {
	ns.togglePause();
}

ns.addEventListener(NetStatusEvent.NET_STATUS, statusHandler);
function statusHandler(event:NetStatusEvent):void {

	trace(event.info.code);
	/*
	NetStream.Play.Start
	NetStream.Buffer.Empty
	NetStream.Buffer.Full
	NetStream.Buffer.Empty
	NetStream.Buffer.Full
	NetStream.Buffer.Empty
	NetStream.Buffer.Full
	NetStream.Buffer.Flush
	NetStream.Play.Stop
	NetStream.Buffer.Empty
	NetStream.Buffer.Flush
	*/
	switch (event.info.code) {
		case "NetStream.Play.Start" :
			trace("Start [" + ns.time.toFixed(3) + " seconds]");
			break;
		case "NetStream.Play.Stop" :
			trace("Stop [" + ns.time.toFixed(3) + " seconds]");
			break;
	}
}
Vote in HexoSearch

Python MySQLdb install guide for cPanel/centOS

April 26th, 2010

Guide to getting MySQLdb installed for Python/MySQL to work on cPanel(11)/centOS(5.4). First you need to check if you need any of these installed (I didn’t).

yum install python-devel
yum install MySQL-devel
yum install zlib-devel
yum install openssl-devel

This one I did need was, python-setuptools this basically allows to; Download, build, install, upgrade, and uninstall Python packages - as it says on the Python website.

yum install python-setuptools.noarch

Ok lets get started. run this from your cmd line/bash.

wget http://downloads.sourceforge.net/project/mysql-python/mysql-python-test/1.2.3c1/MySQL-python-1.2.3c1.tar.gz && tar xzf MySQL-python-1.2.3c1.tar.gz && cd MySQL-python-1.2.3c1 && python setup.py build && sudo python setup.py install

That’s it your done! :) BTW, this is what I am running environment wise.

cPanel  11.25.0-R44718 - WHM 11.25.0 - X 3.9
CENTOS 5.4 i686 standard
Vote in HexoSearch

AS3/AS2 Dynamic Gradient Mask Effect

April 11th, 2010

maskMovieClip = Instance name of your mask movie clip this is where you add the gradient/radial colour/type.
movieClip = Instance name of your movie clip you want masking.

AS3

movieClip.mask = maskMovieClip;
maskMovieClip.cacheAsBitmap = true;
movieClip.cacheAsBitmap = true;

AS2

movieClip.cacheAsBitmap = true;
maskMovieClip.cacheAsBitmap = true;
mask.cacheAsBitmap = true;
movieClip.setMask("maskMovieClip");
Vote in HexoSearch

iPhone SDK 3.3 on OSX 10.5.5

March 5th, 2010

Can’t get? iPhone SDK 3.3 with xCode 2.1.4 running inside Mac OSX 10.5.5, I have it running on VMware with Mac OSX 10.5.5 here’s how:

Download iPhone SDK 3.3 with xCode 2.1.4 from Apple here.

Then do the following:

Edit the version number from 10.5.5 to 10.5.7 inside the “SystemInfo.plist” file which is located here:

/System/Library/Core Services/SystemInfo.plist

Now you can install the latest iPhone SDK without any crappy messages coming up :)

Vote in HexoSearch

Joomla (1.5) Banner Manager, SWF Banners Click Throughs and Impressions aren’t been tracked

February 22nd, 2010

Recently came accross this problem a client was having. SWF Banners weren’t clicking through neither were impressions been tracked from the Joomla: Banner Manager module, If your have having this problem do the following..

Go to and edit:

/modules/mod_banners/helper.php

Replace:


         $html =   "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" border=\"0\" width=\"$width\" height=\"$height\">
                  <param name=\"movie\" value=\"$imageurl\"><embed src=\"$imageurl\" loop=\"false\" pluginspage=\"http://www.macromedia.com/go/get/flashplayer\" type=\"application/x-shockwave-flash\" width=\"$width\" height=\"$height\"></embed>
               </object>";

With:

         /*  Old Flash Code
         $html =   "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" border=\"0\" width=\"$width\" height=\"$height\">
                  <param name=\"movie\" value=\"$imageurl\"><embed src=\"$imageurl\" loop=\"false\" pluginspage=\"http://www.macromedia.com/go/get/flashplayer\" type=\"application/x-shockwave-flash\" width=\"$width\" height=\"$height\"></embed>
               </object>";
         */   

//HW: BOF New Flash Code that works with Clickthroughs, AND does not hide menus etc (WMODE)
         $clickurl = $item->clickurl;
         $html_flash =   "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" border=\"0\" width=\"$width\" height=\"$height\">
                  <param name=\"movie\" value=\"$imageurl\">
                  <param name=\"wmode\" value=\"opaque\">
               <embed src=\"$imageurl\" pluginspage=\"http://www.macromedia.com/go/get/flashplayer\" type=\"application/x-shockwave-flash\" width=\"$width\" height=\"$height\" wmode=\"opaque\"></embed>
               </object>";
         if ($clickurl != '') {  //Add a GIF based clickthrough IF there is a link supplied in the 'Click url' for this banner in the banner manager.
            $html = '<div style="position:relative;z-index:1;" style="background:#fff;">';  //Add the banner clickthrough
            $html .= $html_flash;
            $html .= '<a href="'.$link.'" target="_blank" style="display:block;position:absolute;width:'.$width.'px;height:'.$height.'px;z-index:9999;top:0px;left:0px;border:none;background:none;"><img src="images/spacer.gif" style="width:'.$width.'px;height:'.$height.'px;" alt="Banner Campaign" /></a>   '; //replace this with the path to your spacer.gif (needs to be a transparent PNG/GIF).
            $html .= '</div>';
         } else {  //Otherwise use the orignal code, so that the flash banner still goes to the right place... (instead of a blank page!)
            $html .= $html_flash;
         }
         //HW: EOF New Flash Code that works with Clickthroughs, AND does not hide menus etc (WMODE)

Now upload a transparent Spacer GIF/PNG to the following location, or point the above code to the desired location of choice:

images/spacer.gif

That’s it your good to go!

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