Hey,
When I place my carousel code/script on another frame than one it does not show. Does anyone, just from seeing my code/script spot a possible reason?
stop ();
//*************************************IMPORTS****************************************\\
import mx.transitions.Tween;
import mx.transitions.easing.*;
import mx.utils.Delegate;
import flash.filters.BlurFilter;
//*************************************CAROUSEL****************************************\\
var blur:BlurFilter = new BlurFilter (0, 0, 1);
var numOfItems:Number;
var radiusX:Number = 300;
var radiusY:Number = 70;
var centerX:Number = (Stage.width / 2);
var centerY:Number = (Stage.height / 2);
var speed:Number = 0.0015;
var speed2 = speed + 0.05;
var perspective:Number = 114;
var home:MovieClip = this;
var tooltips:Array = new Array ("tooltip1", "tooltip2", "tooltip3", "tooltip4", "tooltip5", "tooltip6", "tooltip7", "tooltip8", "tooltip9", "tooltip10", "tooltip11");
var const:Array = new Array ("const1", "const2", "const3", "const4", "const5", "const6", "const7", "const8", "const9", "const10", "const11");
var tooltip:MovieClip = this.attachMovie ("tooltip", "tooltip", 10000);
tooltip._alpha = 0;
//**********************CAROUSEL XML*******************************\\
this.onLoad = function () {
numOfItems = 11;//11 items
for (var i = 0; i < numOfItems; i++) {
var t = home.attachMovie ("item", "item" + i, i + 1);
t._alpha = 85;
t.angle = i * ((Math.PI * 2) / numOfItems);
t.onEnterFrame = mover;
t.toolText = tooltips*;
t.const = const*;
home.tooltip._xscale = home.tooltip._yscale = this._parent._xscale;
t.icon.inner.attachMovie ("bitmap" + i,"bitmap",1000 + i);
t.r.inner.attachMovie ("bitmap" + i,"whatever" + i,6000 + i);
t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
}
};
//********************CAROUSEL TOOLTIP***********************\\
function over () {
home.tooltip.tipText.text = this._parent.toolText;
home.tooltip._x = this._parent._x + 4;
home.tooltip._y = this._parent._y - this._parent._height / 2;
home.tooltip.onEnterFrame = Delegate.create (this, moveTip);
home.tooltip._alpha = 95;
var s = (home.tooltip._y - perspective) / (centerY + radiusY - perspective);
home.tooltip._xscale = home.tooltip._yscale = s * 700;
home.tooltip._xscale = home.tooltip._yscale = this._parent._xscale;//Scaling Tooltip
}
function out () {
delete home.tooltip.onEnterFrame;
delete home.tooltip.tipText.text;
home.tooltip._alpha = 0;
}
function released () {
home.tooltip._alpha = 0;
for (var i = 0; i < numOfItems; i++) {
var t:MovieClip = home["item" + i];
t.xPos = t._x;
t.yPos = t._y;
t.theScale = t._xscale;
delete t.icon.onRollOver;
delete t.icon.onRollOut;
delete t.icon.onRelease;
delete t.onEnterFrame;
if (t != this._parent) {
//If it's not the item we clicked on, fade it away
var tw:Tween = new Tween (t, "_xscale", Strong.easeOut, t._xscale, 0, 1, true);
var tw2:Tween = new Tween (t, "_yscale", Strong.easeOut, t._yscale, 0, 1, true);
var tw3:Tween = new Tween (t, "_alpha", Strong.easeOut, 100, 0, 1, true);
} else {
//If it is the item we clicked on
blur.blurX = 0.25;
blur.blurY = 0.25;
t.filters = [blur];
t._alpha = 100;
if (t.const == "const1" or "const2" or "const3" or "const4" or "const5" or "const6" or "const7" or "const8" or "const9" or "const10" or "const11") {
t.icon.inner.bitmap.gotoAndStop (2);
}
//Enlarge the object
var tw:Tween = new Tween (t, "_xscale", Strong.easeOut, t._xscale, 466.5, 1, true);
var tw2:Tween = new Tween (t, "_yscale", Strong.easeOut, t._yscale, 466.5, 1, true);
var tw3:Tween = new Tween (t, "_x", Strong.easeOut, t._x, 350, 1, true);
var tw4:Tween = new Tween (t, "_y", Strong.easeOut, t._y, 240, 1, true);
var tw5:Tween = new Tween (theText, "_alpha", Strong.easeOut, 0, 100, 1, true);
theText.text = t.const;
var s:Object = this;
var pixel:Object = t.icon.inner.bitmap.instance1.btn;
tw.onMotionStopped = function () {
item0.icon.inner.bitmap.vectpage1.btn.onRelease = Delegate.create (s, unReleashed);
item1.icon.inner.bitmap.vectpage1.btn.onRelease = Delegate.create (s, unReleashed);
item2.icon.inner.bitmap.vectpage1.btn.onRelease = Delegate.create (s, unReleashed);
item3.icon.inner.bitmap.vectpage1.btn.onRelease = Delegate.create (s, unReleashed);
item4.icon.inner.bitmap.vectpage1.btn.onRelease = Delegate.create (s, unReleashed);
item5.icon.inner.bitmap.vectpage1.btn.onRelease = Delegate.create (s, unReleashed);
item6.icon.inner.bitmap.vectpage1.btn.onRelease = Delegate.create (s, unReleashed);
item7.icon.inner.bitmap.vectpage1.btn.onRelease = Delegate.create (s, unReleashed);
item8.icon.inner.bitmap.vectpage1.btn.onRelease = Delegate.create (s, unReleashed);
item9.icon.inner.bitmap.vectpage1.btn.onRelease = Delegate.create (s, unReleashed);
item10.icon.inner.bitmap.vectpage1.btn.onRelease = Delegate.create (s, unReleashed);
};
}
}
}
function unReleashed () {
delete this.onRelease;
var tw5:Tween = new Tween (theText, "_alpha", Strong.easeOut, 100, 0, 0.6, true);
for (var i = 0; i < numOfItems; i++) {
var t:MovieClip = home["item" + i];
if (t != this._parent) {
var tw:Tween = new Tween (t, "_xscale", Strong.easeOut, 0, t.theScale, 1, true);
var tw2:Tween = new Tween (t, "_yscale", Strong.easeOut, 0, t.theScale, 1, true);
var tw3:Tween = new Tween (t, "_alpha", Strong.easeOut, 0, 85, 1, true);
} else {
t._alpha = 85;
var tw:Tween = new Tween (t, "_xscale", Strong.easeOut, 100, t.theScale, 1, true);
var tw2:Tween = new Tween (t, "_yscale", Strong.easeOut, 100, t.theScale, 1, true);
var tw3:Tween = new Tween (t, "_x", Strong.easeOut, t._x, t.xPos, 1, true);
var tw4:Tween = new Tween (t, "_y", Strong.easeOut, t._y, t.yPos, 1, true);
t.icon.inner.bitmap.gotoAndStop (1);//Return to pixel version
tw.onMotionStopped = function () {
for (var i = 0; i < numOfItems; i++) {
var t:MovieClip = home["item" + i];
t.icon.onRollOver = Delegate.create (t.icon, over);
t.icon.onRollOut = Delegate.create (t.icon, out);
t.icon.onRelease = Delegate.create (t.icon, released);
t.onEnterFrame = mover;
}
};
}
}
}
function moveTip () {
home.tooltip._x = this._parent._x;
home.tooltip._xscale = home.tooltip._yscale = this._parent._xscale;
home.tooltip._y = this._parent._y - this._parent._height / 2;
}
//********************IMAGE MOVER***********************\\
//Circle Area
function mover () {
this._x = Math.cos (this.angle) * radiusX + centerX;
this._y = Math.sin (this.angle) * radiusY + centerY;
var s:Number = (this._y - perspective) / (centerY + radiusY - perspective);
this._xscale = this._yscale = s * 100;
this.angle += this._parent.speed;
this.swapDepths (Math.round (this._xscale) + 100);
//Blur
blur.blurX = Math.round (Math.sin (this.angle - Math.PI) * 1.50);
blur.blurY = Math.round (Math.sin (this.angle - Math.PI) * 1.50);
this.filters = [blur];
}
//Speed
this.onMouseMove = function () {
if (_ymouse <= 380) {
speed = (this._xmouse - (centerX) - 10) / 8300;
speed2 = (this._xmouse - (centerX / 3 + 500) - 10) / 1900;
}
};