I have a weird issue on a mouseover in a peice. I believe it because of an onEnterFrame not ending and it animating over and over again, but i cannot find the issue. If you play with http://www.akacom.com/rfp10.swf you’ll see that it only happens if you mouse over when their decreasing size.
oh well, here you go:
/////////////////////////
//imports
/////////////////////////
import flash.display.*;
import mx.transitions.Tween;
import mx.transitions.easing.*;
import flash.filters.BlurFilter;
/////////////////////////
//init
/////////////////////////
txlogo._visible = false;
snblogo._visible = false;
burblers._visible = false;
Stage.scaleMode = "noScale";
Stage.align = "LT";
HPosition();
VPosition();
loadBitmapSmoothed("bg.jpg", anmc);
/////////////////////////
//scaling
/////////////////////////
var VPositioner:Number = (Math.round((Stage.width-768)/2));
var HPositioner:Number = (Math.round((Stage.width-1024)/2));
function VPosition() {
if (Stage.height>=412) {
//var VPositioner:Number = (Math.round((Stage.height-768)/2));
//setProperty(topright, _y, 0-VPositioner);
//setProperty(topleft, _y, 0-VPositioner);
setProperty(txlogo, _y, (Stage.height)-80);
setProperty(snblogo, _y, (Stage.height)-80);
//setProperty(bottomright, _y, (768+VPositioner)-96);
}
}
function HPosition() {
if (Stage.width>=612) {
//var HPositioner:Number = (Math.round((Stage.width-1024)/2));
//setProperty(topleft, _x, 0-HPositioner);
//setProperty(topleft, _x, (Stage.width-HPositioner)-120);
setProperty(snblogo, _x, (Stage.width)-180);
//setProperty(topright, _x, 0-HPositioner);
//setProperty(bottomright, _x, 0-HPositioner);
}
}
var resizeListener:Object = new Object();
Stage.addListener(resizeListener);
resizeListener.onResize = function() {
HPosition();
VPosition();
};
/////////////////////////
//bg image
/////////////////////////
function loadBitmapSmoothed(url:String, target:MovieClip) {
var bmc:MovieClip = target.createEmptyMovieClip("bmc", target.getNextHighestDepth());
var listener:Object = new Object();
listener.tmc = target;
listener.onLoadInit = function(mc:MovieClip) {
mc._visible = false;
var bitmap:BitmapData = new BitmapData(mc._width, mc._height, true);
this.tmc.attachBitmap(bitmap, this.tmc.getNextHighestDepth(), "auto", true);
bitmap.draw(mc);
target.createEmptyMovieClip("cover", target.getNextHighestDepth());
target.cover._x = target.cover._y=0;
target._visible = false;
drawRectangle(target.cover, target._width, target._height, 0x000000, 30);
function drawRectangle(target_mc:MovieClip, boxWidth:Number, boxHeight:Number, fillColor:Number, fillAlpha:Number):Void {
with (target_mc) {
beginFill(fillColor, fillAlpha);
moveTo(0, 0);
lineTo(boxWidth, 0);
lineTo(boxWidth, boxHeight);
lineTo(0, boxHeight);
lineTo(0, 0);
endFill();
}
}
createEmptyMovieClip("whitebox", _root.getNextHighestDepth());
whitebox._x = whitebox._y=0;
drawRectangle(whitebox, 100, 100, 0x000000, 100);
function drawRectangle(target_mc:MovieClip, boxWidth:Number, boxHeight:Number, fillColor:Number, fillAlpha:Number):Void {
with (target_mc) {
beginFill(fillColor, fillAlpha);
moveTo(0, 0);
lineTo(boxWidth, 0);
lineTo(boxWidth, boxHeight);
lineTo(0, boxHeight);
lineTo(0, 0);
endFill();
}
}
//burblers._x = burblers._y = 0
if (Stage.height/Stage.width>target._height/target._width) {
img_prop = target._width/target._height;
target._height = Stage.height;
target._width = Stage.height*img_prop;
target._y = (Stage.height/2)-(target._height/2);
target._x = (Stage.width/2)-(target._width/2);
} else {
img_prop = target._height/target._width;
target._width = Stage.width;
target._height = Stage.width*img_prop;
target._y = (Stage.height/2)-(target._height/2);
target._x = (Stage.width/2)-(target._width/2);
}
burblers._y = 0;
burblers._x = 100;
////////////////////////
xspacing = 100;
yspacing = 100;
depth = 10;
whitebox._visible = false;
smoothness = 90;
//Calculate positions and values
amH = Math.ceil(anmc._width/whitebox._width);
amV = Math.ceil(anmc._height/whitebox._height);
//Create grid
for (i=0; i<amV; i++) {
for (var k = 0; k<amH; k++) {
whitebox.duplicateMovieClip("box"+depth, depth);
var cur:MovieClip = eval("box"+depth);
cur._x = xspacing*k;
cur._y = yspacing*i;
depth++;
}
}
function fadeOut(startboxnr, speed) {
fadeMC(startboxnr, speed);
}
function fadeMC(mcnr, speed) {
var thebox:MovieClip = eval("box"+mcnr);
thebox.onEnterFrame = function() {
this._alpha -= speed;
if (this._alpha<=smoothness) {
this.onEnterFrame = null;
if (this == _level0.box100) {
pulse(1);
}
continueFade(this, speed);
mcnr += 1;
fadeOut(mcnr, speed);
}
};
}
function continueFade(mc, speed) {
mc.onEnterFrame = function() {
this._alpha -= speed;
if (this._alpha<=0) {
delete this.onEnterFrame;
}
};
}
fadeOut(10, 10);
anmc._visible = true;
txlogo._visible = true;
snblogo._visible = true;
burblers._visible = true;
var stage_listener:Object = new Object();
stage_listener.onResize = function():Void {
if (Stage.height/Stage.width>anmc._height/anmc._width) {
img_prop = anmc._width/anmc._height;
anmc._height = Stage.height;
anmc._width = Stage.height*img_prop;
anmc._y = (Stage.height/2)-(anmc._height/2);
anmc._x = (Stage.width/2)-(anmc._width/2);
} else {
var img_prop:Number = anmc._height/anmc._width;
anmc._width = Stage.width;
anmc._height = Number(Stage.width)*img_prop;
anmc._y = (Stage.height/2)-(anmc._height/2);
anmc._x = (Stage.width/2)-(anmc._width/2);
}
burblers._width = Stage.width-310;
burblers._height = Stage.height-200;
};
Stage.addListener(stage_listener);
};
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(listener);
loader.loadClip(url, bmc);
}
///////////////////////////////
//load sections
///////////////////////////////
for (i=1; i<17; i++) {
var itemmc:MovieClip = eval("burblers."+i);
trace(itemmc);
itemmc._alpha = 0;
}
function pulse(item:Number) {
var itemmc:MovieClip = eval("burblers."+item);
itempulse(itemmc);
new Tween(itemmc, "_alpha", Regular.easeInOut, 0, 100, .5, true);
var myTween:Tween = new Tween(itemmc, "blurX", none, 5, 0, 2, true);
myTween.onMotionChanged = function() {
itemmc.filters = [new BlurFilter(itemmc.blurX, 0, 3)];
};
iteminteractions(itemmc, item);
doit = function () {
if (item<16) {
item++;
pulse(item);
clearInterval(timer);
trace (timer)
}
};
timer = setInterval(doit, 800);
}
function itempulse(item:MovieClip) {
scaler(item);
item.onRollOut = function() {
delete this.onEnterFrame;
new Tween(item.box, "_alpha", Regular.easeInOut, item.box._alpha, 0, 1, true);
new Tween(item, "_xscale", Regular.easeInOut, item._xscale, 100, 1, true);
new Tween(item, "_yscale", Regular.easeInOut, item._yscale, 100, 1, true);
var myTween:Tween = new Tween(item, "blurX", none, item.blurX, 5, 1, true);
myTween.onMotionChanged = function() {
item.filters = [new BlurFilter(item.blurX, 0, 3)];
};
scaler(item);
};
function scaler(item) {
item.grow = true;
blurX = 10;
item.onEnterFrame = function() {
if (this._xscale<120 && this.grow == true) {
this._xscale = this._yscale+.25;
this._yscale = this._yscale+.25;
this.onRollOver = function() {
delete this.onEnterFrame;
new Tween(this.box, "_alpha", Regular.easeInOut, this.box._alpha, 70, .5, true);
new Tween(this, "_xscale", Regular.easeInOut, this._xscale, 140, .5, true);
new Tween(this, "_yscale", Regular.easeInOut, this._yscale, 140, .5, true);
var myTween:Tween = new Tween(this, "blurX", none, this.blurX, 0, .5, true);
myTween.onMotionChanged = function() {
this.filters = [new BlurFilter(this.blurX, 0, 3)];
};
};
}
if (this._xscale == 120 && this.grow == true) {
this.grow = false;
var myTween:Tween = new Tween(item, "blurX", none, 0, 5, 1, true);
myTween.onMotionChanged = function() {
item.filters = [new BlurFilter(item.blurX, 0, 3)];
};
this.onRollOver = function() {
delete this.onEnterFrame;
new Tween(this.box, "_alpha", Regular.easeInOut, this.box._alpha, 70, .5, true);
new Tween(this, "_xscale", Regular.easeInOut, this._xscale, 140, .5, true);
new Tween(this, "_yscale", Regular.easeInOut, this._yscale, 140, .5, true);
var myTween:Tween = new Tween(this, "blurX", none, this.blurX, 0, .5, true);
myTween.onMotionChanged = function() {
this.filters = [new BlurFilter(this.blurX, 0, 3)];
};
};
}
if (this._xscale>100 && this.grow == false) {
this._xscale = this._yscale-.25;
this._yscale = this._yscale-.25;
this.onRollOver = function() {
delete this.onEnterFrame;
new Tween(this.box, "_alpha", Regular.easeInOut, this.box._alpha, 70, .5, true);
new Tween(this, "_xscale", Regular.easeInOut, this._xscale, 140, .5, true);
new Tween(this, "_yscale", Regular.easeInOut, this._yscale, 140, .5, true);
var myTween:Tween = new Tween(this, "blurX", none, this.blurX, 0, .5, true);
myTween.onMotionChanged = function() {
this.filters = [new BlurFilter(this.blurX, 0, 3)];
};
};
}
if (this._xscale == 100 && this.grow == false) {
this.grow = true;
var myTween:Tween = new Tween(item, "blurX", none, 5, 0, 2, true);
myTween.onMotionChanged = function() {
item.filters = [new BlurFilter(item.blurX, 0, 3)];
};
this.onRollOver = function() {
delete this.onEnterFrame;
new Tween(this.box, "_alpha", Regular.easeInOut, this.box._alpha, 70, .5, true);
new Tween(this, "_xscale", Regular.easeInOut, this._xscale, 140, .5, true);
new Tween(this, "_yscale", Regular.easeInOut, this._yscale, 140, .5, true);
var myTween:Tween = new Tween(this, "blurX", none, this.blurX, 0, .5, true);
myTween.onMotionChanged = function() {
this.filters = [new BlurFilter(this.blurX, 0, 3)];
};
};
}
};
}
}
////////////////////////
function opensection(num:Number) {
}
swf: http://www.akacom.com/rfp10.swf
fla: http://www.akacom.com/rfp10.fla