ActionScript
iShares Isometric Game Banner
by Scott King on Feb.04, 2010, under ActionScript, Flash
This is a Banner ad for iShares, it contains a small Isometric building block game. The aim is to create the 3D iShares logo out of the scattered building blocks. This game was built on top of an AS2 Isometric engine I developed to be lite weight for the purposes of serving through banner hosting and media companies.
It has an autoplay feature which kicks in after 30seconds and it has an “Auto Build” feature, click the button in the bottom left to activate.
Add some Sex to your Tweens with this new easing equation
by Scott King on Feb.04, 2010, under ActionScript, Flash
I was having a beer with one of my very talented colleagues Robert Shearing (robshearing.com) and we got to talking about the make-up of the various easing equations for usage in Tween engines such as TweenLite. Most of these equations are still based on Robert Penner’s original 11 easing equations: Circ, Cubic, Elastic, Expo, Linear, Quad, Quart, Quint and Sine.
After a few beers we decided that we needed to create a new Easing equation. We figured that is if Quint was to the power of 5, then logically we create an equation to the power of 6.. but what to call it.. after a few more beers we figured if Quart is the power of 4 and Quint is the power of 5 then the power of 6 should be simply called “Sex”. Coincidentally, this is also the Latin word for six.
This gives us a new, slightly sharper Ease and the bonus ability to have some really cool easing combinations such as Sex.EaseIn, Sex.EaseOut and everyones favorite, Sex.EaseInOut.
Get the [Source].
Enjoy your new equation, if you use it on a project please drop us a link in the comments below and please remember, always practice safe Sex.
ActionScript 3 / Flash: Simple FPS Counter Class with Average FPS, FPS Threshold, etc
by Scott King on Jan.11, 2010, under ActionScript, Flash
I wanted a nice, simple, small FPS counter that displayed an Average FPS over a set number of frames, eg: 22fps average over 10 frames.
I managed to find a basic class that I modified to include an average FPS parameter and a threshold parameter that turns the FPS Background to RED if the FPS drops below the threshhold.
Source: [fps_example]
Safari blocking popups from Flash – fix
by Scott King on Oct.02, 2009, under ActionScript, JavaScript
I dont understand why Apple can make the best hardware in the world, and then proceed to create the worst software to put on it. Safari (like iTunes) is full of bugs, one of the most obivously yet most poorly documented is the problem that causes Safari to block pop-up windows from Flash even after a user has clicked to intiate the popup.
Here’s the fix:
ActionScript:
import flash.net.*;
...
mybutton.addEventListener(MouseEvent.CLICK, openPopup);
function openPopup(event:Event) {
var jsPopFunc:String = "popupWin";
var _winURL:String = "http://www.rivastakeout.com/staging/stake-your-claim/form.php";
var _winTarget:String = "_self";
var _winWidth:Integer = 600;
var _winHeight:Integer = 400;
var _winName:String = "popup";
var _winParams:String = "location=0,status=0,scrollbars=1";;
var result:Boolean;
if (ExternalInterface.available) {
result=Boolean(ExternalInterface.call(jsPopFunc , _winURL, _winTarget, _winWidth, _winHeight, _winName, _winParams));
}
if (!result) {
var request:URLRequest=new URLRequest(_winURL);
try {
navigateToURL(request, _popupWin);
} catch (e:Error) {
trace("Error occurred!");
}
}
}
JavaScript:
function popupWin(winURL, width, height, name, params){
var left = Math.floor((screen.width - width)/2);
var top = Math.floor((screen.height - height)/2);
var winParms = "top=" + top + ",left=" + left + ",height=" + height + ",width=" + width;
if(!name){
name = "newWin";
}
if(!params){
params = "location=0,status=0,scrollbars=0";
}
if (params){
winParms += "," + params;
}
var newWin = window.open(winURL, name, winParms);
if (newWin) {
return true;
}
else{
return false;
}
}
Further reading:
http://www.ultrashock.com/forums/actionscript/popups-from-flash-solution-92036.html
Accessing ActionScript MouseWheel scroll Delta for all screen resolutions
by Scott King on Aug.04, 2009, under ActionScript
While some of you may have known this already but the delta value (booth AS3 & AS1/2) depends on the Operating Systems’ scroll settings, namely the scroll speed which can be different from system to system. Some systems scroll 3 lines at a time, some 7, some scroll an entire page.
So the best way to normalize this is by using Math.abs() like so:
var scroll = delta / Math.abs(delta);

Site Preview: Crust Pizza
by Scott King on Aug.04, 2009, under ActionScript, CSS, Design, Flash
A preview of the new Crust site featuring quite a cool Carousel I created from pre-rendered FLV video. I did a version of this Carousel in Papervision 3D but decided to run with a 3D pre-rendered version as the level of interactivity didnt require a full PV3D application.
The Carousel uses 2 small FLVs, one for the scrolling and one for the box opening. I simply loop part of the scrolling video to allow the boxes to slide multiple times and reverse the videos for animating the slide in the opposite direction or to close the box lids. I then load the Pizza PNG itself under a dynamic mask on top of the FLV along with the Pizza information from an XML web service. Video rendering by Jonathan Miranda.
ActionScript 3, Tweenlite, Bulkloader.
Cool effect. Check it out at:
http://www.scottking.com.au/portfolio/crust/
Site Launch – Olympus PEN ver 2
by Scott King on Aug.04, 2009, under ActionScript, CSS, Flash
Last week I launched version 2 of our Olympus PEN promotional site. This site has a range of Flash including a Flickr based Papervision 3D Gallery and competition, 360 Product spinners, YouTube videos and informational panels.
Design: Jonathan Miranda, Glen McPherson, Aliza Nordin
Disable the yellow Flash form tab highlights
by Scott King on Jun.25, 2009, under ActionScript, Flash
Flash has built-in functionality to allow a user to tab around the page elements using their Tab key on their keyboard, just as you would with a normal HTML site.
Flash highlights the focused Flash element with a 2px yellow border around the element.
Often designers will want to disable this highlighting effect so as to not disrupt their design. This can be achieved witha few simple lines of ActionScript:
Be mindful of your implementation as this script uses a _root reference.
Button.prototype.tabEnabled=false;
for(var obj in _root){
_root[obj].tabEnabled = false;
_root[obj]._focusrect=false;
}
More Mini Banner games for GlaxoSmithKline
by Scott King on Jun.18, 2009, under ActionScript, Flash
Two more banner games I created for Glaxo Smith Klines range of anti-smoking products, Nicabate.
This time I took on Pac Man and Space Invaders, Nicabate style.
- ActionScript2 (Flash Player 7)
- TweenLite
- AutoPlay timeout features
- Build time: 2 days per banner
Pac Man
Space Invaders
Site launch: Olympus new PEN Camera
by Scott King on Jun.18, 2009, under ActionScript, CSS, Flash
Olympus have released a revolutionary new camera and required a new mini-site to be built to conincide with the launch of the new camera named the PEN. Unforntaly, we were only given 2 days to build the mini-site which included a online competition for photographers to upload pictures int a competition. A good job on a very tight deadline.
View the site at:
















