Banner ads have buttons that ad serving systems use the following syntax to dynamically assign a URL
on (release) {
if (_root.clickTAG.substr(0,5) == “http:”) {
getURL(_root.clickTAG, “_blank”);
}
}
The clicktag button covers the stage (ad size) and prevents other mouse events like panning. Are there any hacks to get around this? I have a FLA that uses the following AS but the mandatory click tage button disables it the panning functionality.
import mx.utils.Delegate;
import flash.geom.Rectangle;
class com.McPan {
private var __mc:MovieClip;
private var __mcp:MovieClip;
private var __ease:Number;
private var __control:MovieClip;
private var __yDiff:Number;
private var __yRatio:Number;
private var __yPos:Number;
private var __xDiff:Number;
private var __xRatio:Number;
private var __xPos:Number;
private var __imgW:Number;
private var __imgH:Number;
private var __rect:Rectangle;
private var __ptX:Number;
private var __ptY:Number;
private var __motionActive:Boolean = true;
//new McPan(yourMovieClip, easing, clipX, clipY, aperature_width, aperature_height, initial_x_Offset, initial_y_Offset, cachImageOrNot);
//---------------------------------------------------------------------------------
//----------------------------------------- constructor
//---------------------------------------------------------------------------------
public function McPan(_mc:MovieClip, _ease:Number, _clipX:Number, _clipY:Number, _apertureW:Number, _apertureH:Number, _xoff:Number, _yoff:Number, _cache:Boolean) {
// your clip to pan
__mc = _mc;
// amount of easing - .7 works well
__ease = _ease;
// store the clip's parent in a variable, it will be used for _xmouse, _ymouse
__mcp = __mc._parent;
// get the initial width and height of the images
__imgW = __mc._width;
__imgH = __mc._height;
// position the clip to x, y
__mc._x = _clipX;
__mc._y = _clipY;
// turn on cache on/off based on passed parameter
_cache!=undefined ? __mc.cacheAsBitmap = _cache : __mc.cacheAsBitmap = false ;
// I decided to run the onEnterframe within another clip vs. __mc
// just incase __mc contained an animation or some other onEnterFrame events
__control = __mc.createEmptyMovieClip("controller", __mc.getNextHighestDepth());
// create a new rectangle - position your clip to the offsets and aperature width / height
__rect = new Rectangle(_xoff, _yoff, _apertureW, _apertureH);
// set the clip's scrollRect
__mc.scrollRect = __rect;
// button events to control movement start / stop
__mc.onRollOver = Delegate.create(this,initiateMovement);
__mc.useHandCursor = false;
}
//---------------------------------------------------------------------------------
//----------------------------------------- private methods
//---------------------------------------------------------------------------------
private function killMovement():Void {
delete __control.onEnterFrame;
}
private function initiateMovement():Void {
delete __mc.onRollOver;
__control.onEnterFrame = Delegate.create(this,moveToMouse);
}
private function moveToMouse():Void {
__mc.scrollRect = calcXY(__mcp._xmouse,__mcp._ymouse)[0];
if(!__mc.hitTest(__mcp._xmouse, __mcp._ymouse, true)) {
killMovement();
if(__motionActive) {
__mc.onRollOver = Delegate.create(this,initiateMovement);
}
}
}
private function moveToPoint():Void {
var ar:Array = calcXY(__ptX,__ptY);
__mc.scrollRect = ar[0];
if(Math.abs(ar[1]-ar[0].x)<1) {
if(Math.abs(ar[2]-ar[0].y)<1) {
delete __control.onEnterFrame;
}
}
}
private function calcXY(XP:Number,YP:Number):Array {
// calculate the X offset / positions
__xDiff = XP-__mc._x;
__xRatio = __xDiff/__rect.width;
__xPos = __xRatio*(__imgW-__rect.width);
// calculate the Y offset / positions
__yDiff = YP-__mc._y;
__yRatio = __yDiff/__rect.height;
__yPos = __yRatio*(__imgH-__rect.height);
// set the rectangles offsets
__rect.x = __xPos-(__xPos-__rect.x)*__ease;
__rect.y = __yPos-(__yPos-__rect.y)*__ease;
return [__rect, __xPos, __yPos];
}
//---------------------------------------------------------------------------------
//----------------------------------------- public methods
//---------------------------------------------------------------------------------
public function slideToPoint(x:Number,y:Number):Void {
__ptX = x;
__ptY = y;
killMovement();
__control.onEnterFrame = Delegate.create(this,moveToPoint);
}
public function stopMotion():Void {
killMovement();
__motionActive = false;
delete __mc.onRollOver;
}
public function startMotion():Void {
killMovement();
__motionActive = true;
__mc.onRollOver = Delegate.create(this,initiateMovement);
}
}