(EDIT) You might have to clear your cache - the intro skips if you’ve seen it once!(/EDIT)
Hi all… Here are 2 sites - the same swf, but the intro movie (I hate intro movies) on this first runs fine on my local machine, but runs all goofy on the server…
http://www.anman.net/tpi/tpi_flash_site2.swf
http://www.technicalproductions.com/[COLOR=#385863]tpi_flash_site2.swf[/COLOR]
In the first I use
myMovie._alpha = += .5;
(for example) to move my movie clips.
In the second I use primarily the Tween class.
For some reason when you use the first method, the transitions are smoother when the motion is slow and that’s why I wanted to use it (client wanted slow motion).
So here’s the code from the first movie - is there a way I can optimize this and make it work better?:
this.powMsg.onEnterFrame = function() {
this._alpha += 3.35;
if (this._alpha>=100) {
delete this.onEnterFrame;
}
};
//------ Pop Pictures -----------------
var intervalPics:Number = 1.5;
function picturePop() {
clearInterval(pictureInterval);
_root.opImg1.gotoAndPlay(2);
}
pictureInterval = setInterval(this, "picturePop", intervalPics*1000);
//----------Fade You have.. Fade in Img Bar & You Are...---------------------
var interval:Number = 3;
function fadeYouHaveOut() {
clearInterval(mySetInterval);
//
this.powMsg.onEnterFrame = function() {
this._alpha -= 3.35;
if (this._alpha<=0) {
delete this.onEnterFrame;
}
};
//
this.youAre.onEnterFrame = function() {
this._alpha += 1.7;
if (this._alpha>=100) {
delete this.onEnterFrame;
}
};
//
this.imgBar.onEnterFrame = function() {
if (this._y>=-400) {
this._y += 2.5;
}
};
//
this.imgBar.imgBarSrc.onEnterFrame = function() {
this._alpha += 7;
if (this._alpha>=100) {
delete this.onEnterFrame;
}
};
}
mySetInterval = setInterval(this, "fadeYouHaveOut", interval*1000);
//------------ Fade in Businesses ----------------------------------------------
var interval1:Number = 3.5;
function fadeBuSiIn() {
clearInterval(mySetInterval1);
//
this.buSi.onEnterFrame = function() {
this._alpha += 1.7;
if (this._alpha>=100) {
delete this.onEnterFrame;
}
};
}
mySetInterval1 = setInterval(this, "fadeBuSiIn", interval1*1000);
//-------Fade In Entertainers -------------------------------------
var interval2:Number = 4;
function fadeenTerIn() {
clearInterval(mySetInterval2);
//
this.enTer.onEnterFrame = function() {
this._alpha += 1.7;
if (this._alpha>=100) {
delete this.onEnterFrame;
}
};
}
mySetInterval2 = setInterval(this, "fadeenTerIn", interval2*1000);
//--------------- Fade In Event Planners --------------------------------------
var interval3:Number = 4.5;
function fadevEntIn() {
clearInterval(mySetInterval3);
//
this.evEnt.onEnterFrame = function() {
this._alpha += 1.7;
if (this._alpha>=100) {
delete this.onEnterFrame;
}
};
}
mySetInterval3 = setInterval(this, "fadevEntIn", interval3*1000);
//----------- Fade in Public Places -----------------------------------------
var interval4:Number = 5;
function fadepuBlicIn() {
clearInterval(mySetInterval4);
//
this.puBlic.onEnterFrame = function() {
this._alpha += 1.7;
if (this._alpha>=100) {
delete this.onEnterFrame;
}
};
}
mySetInterval4 = setInterval(this, "fadepuBlicIn", interval4*1000);
//-----------Fade "with short and..." in-------------------------------------------
var interval6:Number = 5.5;
function fadegoalsIn() {
clearInterval(mySetInterval6);
//
this.goals.onEnterFrame = function() {
this._alpha += 1.7;
if (this._alpha>=100) {
delete this.onEnterFrame;
}
};
}
mySetInterval6 = setInterval(this, "fadegoalsIn", interval6*1000);
//--------------- Fade out just about everything, Fade in "we are" and "the reality" --------------------
var interval7:Number = 9;
function fadegoalsOut() {
clearInterval(mySetInterval7);
//
this.youAre.onEnterFrame = function() {
this._alpha += -3.35;
if (this._alpha<=0) {
delete this.onEnterFrame;
}
};
//
this.buSi.onEnterFrame = function() {
this._alpha += -3.35;
if (this._alpha<=0) {
delete this.onEnterFrame;
}
};
//
this.enTer.onEnterFrame = function() {
this._alpha += -3.35;
if (this._alpha<=0) {
delete this.onEnterFrame;
}
};
//
this.puBlic.onEnterFrame = function() {
this._alpha += -3.35;
if (this._alpha<=0) {
delete this.onEnterFrame;
}
};
//
this.evEnt.onEnterFrame = function() {
this._alpha += -3.35;
if (this._alpha<=0) {
delete this.onEnterFrame;
}
};
//
this.goals.onEnterFrame = function() {
this._alpha += -3.35;
if (this._alpha<=0) {
delete this.onEnterFrame;
}
};
//
this.team.onEnterFrame = function() {
this._alpha += 1.34;
if (this._alpha>=100) {
delete this.onEnterFrame;
}
};
//
this.weAreOnly.onEnterFrame = function() {
this._alpha += 3.34;
if (this._alpha>=100) {
delete this.onEnterFrame;
}
};
//
this.imgBar.imgBarSrc.onEnterFrame = function() {
this._alpha += -7;
if (this._alpha<=0) {
delete this.onEnterFrame;
}
};
//imgBarAlphaOut = new mx.transitions.Tween(this.imgBar, "_alpha", mx.transitions.easing.None.easeNone, 100, 0, .5, true);
}
mySetInterval7 = setInterval(this, "fadegoalsOut", interval7*1000);
//---------- Fade out "reality team" fade in Tpi logo-------------------------------------
var interval8:Number = 12;
function fadeTpiIn() {
clearInterval(mySetInterval8);
//
this.team.onEnterFrame = function() {
this._alpha += -3.35;
if (this._alpha<=0) {
delete this.onEnterFrame;
}
};
//
this.Tpi.onEnterFrame = function() {
this._alpha += .84;
if (this._alpha>=100) {
delete this.onEnterFrame;
}
};
}
mySetInterval8 = setInterval(this, "fadeTpiIn", interval8*1000);
//----------- go to and play main movie --------------------------
var interval9:Number = 19;
function goToMovie() {
bytes_loadedIntro = Math.round(_root.getBytesLoaded());
bytes_totalIntro = Math.round(_root.getBytesTotal());
if (bytes_loadedIntro == bytes_totalIntro) {
this.gotoAndStop("movie");
} else {
this.gotoAndPlay("preloader");
}
}
mySetInterval9 = setInterval(this, "goToMovie", interval9*1000);
//----------------------------------------------------------------
stop();