Frame 1
if (controller == null) {
var controller = com.rmgconnect.HSBC.HSBC10F5009.Controller.getInstance();
controller.init(this);
}
stop();
Symbol 4 MovieClip Frame 1
stop();
Symbol 4 MovieClip Frame 30
stop();
Symbol 6 MovieClip Frame 1
stop();
Symbol 6 MovieClip Frame 6
stop();
Symbol 23 MovieClip Frame 60
stop();
Symbol 25 MovieClip Frame 1
count = 0;
Symbol 25 MovieClip Frame 2
count++;
Symbol 25 MovieClip Frame 10
stop();
_parent.controller.wait([{t:getTimer(), wait:1000}, {obj:this, func:play, param:null}]);
Symbol 25 MovieClip Frame 119
stop();
Symbol 25 MovieClip Frame 313
if (count == 3) {
stop();
}
Symbol 25 MovieClip Frame 396
stop();
_parent.controller.reset();
Symbol 32 MovieClip Frame 1
stop();
Symbol 32 MovieClip Frame 35
if (this.active) {
gotoAndPlay ("Tickle loop");
} else {
play();
}
Symbol 39 Button
on (release) {
getURL (_root.clickTag, "_blank");
}
Symbol 40 MovieClip [__Packages.com.rmgconnect.HSBC.HSBC10F5009.Controller] Frame 0
class com.rmgconnect.HSBC.HSBC10F5009.Controller
{
static var instance;
var timeline, cursor, copy, bearA, bearB, blink, btn, hotspot, zeroInteractionNotify, zeroInteractionNotifyFrameFound, inactiveNotify, trackInterval, inactiveTimer, zeroInteractionInterval, zeroInteractionDefaultTimer, dir;
function Controller () {
}
static function getInstance() {
if (instance == null) {
instance = new com.rmgconnect.HSBC.HSBC10F5009.Controller();
}
return(instance);
}
function init(timeline) {
showText("invoke Controller");
this.timeline = timeline;
cursor = timeline.Cursor;
copy = timeline.Copy;
bearA = timeline.bearA;
bearB = timeline.bearB;
blink = timeline.blink;
btn = timeline.btn;
hotspot = timeline.hotspot;
bearB._visible = false;
zeroInteractionNotify = false;
zeroInteractionNotifyFrameFound = false;
cursor.stop();
copy.stop();
bearA.stop();
bearB.stop();
blink._visible = true;
hotspot._alpha = 0;
hideMouse();
copy.framelabel = {strokehim:119, onlybear:129};
btn.onRollOut = mx.utils.Delegate.create(this, hideMouse);
btn.onRollOver = mx.utils.Delegate.create(this, showMouse);
cursor.onMouseMove = mx.utils.Delegate.create(this, followMouse);
inactiveNotify = false;
copy.play();
setContent();
zeroInteractionRun();
}
function reset() {
clearInterval(trackInterval);
userInteracts = false;
inactiveTimer = getTimer();
showText("*** invoke reset - playing times " + (counter + 1));
if (counter < (playtimes - 1)) {
trace("- AD RESETS -");
setContent();
if (((copy._currentframe < copy.framelabel.onlybear) && (cursor.hitTest(hotspot))) && (cursor._visible)) {
copy.gotoAndStop("rolloverstate");
} else {
copy.play();
}
inactiveNotify = false;
zeroInteractionNotify = false;
zeroInteractionNotifyFrameFound = false;
zeroInteractionRun();
} else {
showText("- AD COMPLETES -");
setContent();
}
counter++;
}
function zeroInteractionRun() {
clearInterval(zeroInteractionInterval);
if (!userInteracts) {
if (((copy._currentframe >= copy.framelabel.strokehim) && (copy._currentframe < copy.framelabel.onlybear)) && (!zeroInteractionNotifyFrameFound)) {
showText((("User not interacting - start final wait " + Math.round(zeroInteractionWait / 1000)) + " sec from frame ") + copy._currentframe);
zeroInteractionDefaultTimer = getTimer();
zeroInteractionNotifyFrameFound = true;
}
if ((((getTimer() - zeroInteractionDefaultTimer) > zeroInteractionWait) && (!zeroInteractionNotify)) && (zeroInteractionNotifyFrameFound)) {
showText("User not interacting - period expired");
adPayoff();
zeroInteractionNotify = true;
}
zeroInteractionInterval = setInterval(this, "zeroInteractionRun", 20);
}
}
function showMouse() {
cursor._visible = true;
Mouse.hide();
showText("invoke showMouse");
}
function hideMouse() {
cursor._visible = false;
Mouse.show();
showText("invoke hideMouse");
}
function followMouse() {
cursor._x = _xmouse;
cursor._y = _ymouse;
}
function setContent() {
showText("invoke setContent");
setupRolloverTickle();
}
function bearTurns() {
showText("invoke bearTurns");
bearA.play();
}
function setupRolloverTickle() {
showText("invoke setupRolloverTickle");
showText("activate hotspot tracking");
trackHotSpot();
bearB.onEnterFrame = mx.utils.Delegate.create(this, tickleBear);
}
function clickThrough() {
}
function adPayoff() {
showText("invoke adPayoff");
hotspot._visible = false;
bearA.gotoAndStop(1);
blink._visible = true;
copy.gotoAndPlay("rolloverstate");
}
function trackHotSpot() {
clearInterval(trackInterval);
if (cursor.hitTest(hotspot) && (cursor._visible)) {
if (bearA._currentframe != bearA._totalframes) {
bearA.play();
} else if (bearA._visible) {
showText("switch bear clips");
bearA._visible = false;
bearB._visible = true;
inactiveTimer = getTimer();
}
blink._visible = false;
if (copy._currentframe < copy.framelabel.onlybear) {
copy.gotoAndStop("rolloverstate");
}
if (cursor.active != true) {
showText("switch cursor tickling");
if (cursor._currentframe == 1) {
cursor.gotoAndPlay("ticklestart");
} else {
cursor.play();
}
}
userInteracts = true;
cursor.active = true;
} else {
if (cursor.active) {
showText("tickling done");
inactiveTimer = getTimer();
resetBear();
}
cursor.active = false;
}
if (((((getTimer() - inactiveTimer) > 2000) && (!inactiveNotify)) && (userInteracts)) && (copy._currentframe == copy.framelabel.onlybear)) {
showText("*** User has been inactive for 4 sec");
adPayoff();
inactiveNotify = true;
}
trackInterval = setInterval(this, "trackHotSpot", 20);
}
function resetBear() {
showText("invoke resetBear");
bearB.play();
}
function tickleBear() {
if (cursor.active) {
dir = ((dir == null) ? 1 : (dir));
if ((dir == -1) && (bearB._currentframe > 1)) {
bearB.prevFrame();
}
if ((dir == -1) && (bearB._currentframe == 1)) {
dir = 1;
}
if ((dir == 1) && (bearB._totalframes > bearB._currentframe)) {
bearB.nextFrame();
}
if ((dir == 1) && (bearB._totalframes == bearB._currentframe)) {
dir = -1;
}
}
if ((!cursor.active) && (bearB._totalframes == bearB._currentframe)) {
bearB._visible = false;
bearA._visible = true;
if (bearA._currentframe > 1) {
bearA.prevFrame();
}
}
}
function wait(a) {
clearInterval(a[0].interval);
if ((getTimer() - a[0].t) > a[0].wait) {
if (typeof(a[1].func.toLowerCase()) == "string") {
a[1].obj[a[1].func].apply(a[1].obj, a[1].param);
} else {
a[1].func.apply(a[1].obj, a[1].param);
}
clearInterval(a[0].interval);
} else {
a[0].interval = setInterval(this, "wait", 100, a);
}
}
function showText(str) {
trace(str);
}
var userInteracts = false;
var zeroInteractionWait = 8000;
var counter = 0;
var playtimes = 3;
}
Symbol 41 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object
{
var func;
function Delegate (f) {
super();
func = f;
}
static function create(obj, func) {
var _local2 = function () {
var _local2 = arguments.callee.target;
var _local3 = arguments.callee.func;
return(_local3.apply(_local2, arguments));
};
_local2.target = obj;
_local2.func = func;
return(_local2);
}
function createDelegate(obj) {
return(create(obj, func));
}
}