I found this great rotator on Flashkit.
http://www.flashkit.com/movies/Scripting/Using_External_Files/Dynamic_-Jason_Ca-12196/index.php
Love the user interface. Unfortunately it is using FlasVars in the object code to load images. That won’t work for me, and I would prefer to load subSWFs. I can’t figure out what I need to do to convert it.
<param name=“FlashVars” value="imageOne=image1.jpg&imageTwo=image2.jpg&imageThree=image3.jpg
//This is needed in order to take advantage of the tween function
import mx.transitions.Tween;
//This hides the 3 grow bars from sight
TimeBar_mc1g._alpha = 0;
TimeBar_mc2g._alpha = 0;
TimeBar_mc3g._alpha = 0;
btn_play._alpha = 0;
hoverClick._alpha = 0;
adPause = false;
img2_mc._alpha = 0;
img3_mc._alpha = 0;
img1_mc.loadMovie("http://****/img/"+ _level0.imageOne);
img2_mc.loadMovie("http://****/img/"+_level0.imageTwo);
img3_mc.loadMovie("http://****/img/"+_level0.imageThree);
type1_mc.type1_var="> "+_level0.typeOne;
type2_mc.type2_var="> "+_level0.typeTwo;
type3_mc.type3_var="> "+_level0.typeThree;
type2_mc._y = 270;
type3_mc._y = 270;
url1 = "http://"+_level0.linkOne;
url2 = "http://"+_level0.linkTwo;
url3 = "http://"+_level0.linkThree;
//These are the default settings. the adInterval needs to change to a flash var once this is working
barHeight = 100
adInterval = _level0.interval;
currentCount = 0;
barCount = 0;
whichAd = 1;
timer_txt.text = currentCount;
//This is the counter that handles the seconds
timer = setInterval(countDown, 1000);
//This is the timer that handles the growth of the progress bars
barTimer = setInterval(growBar, 100);
// the natural progression throught the 3 ads
function countDown() {
currentCount++;
if (currentCount >= adInterval) {
timer = clearInterval(timer);
barCount = 0;
resetTimer();
}
}
// this is the timer that allows the bars to grow at a faster pace than the ad numbers. Not sure why /6 works, it should be /10 but whatever...
function growBar() {
barCount++;
if(whichAd == 1){
TimeBar_mc1g._alpha = 100;
TimeBar_mc1._yscale= 100/(adInterval/(barCount/6));
TimeBar_mc2g._alpha = 0;
TimeBar_mc3g._alpha = 0;
} else if(whichAd == 2){
TimeBar_mc2g._alpha = 100;
TimeBar_mc2._yscale= 100/(adInterval/(barCount/6));
TimeBar_mc1g._alpha = 0;
TimeBar_mc3g._alpha = 0;
} else if(whichAd == 3){
TimeBar_mc3g._alpha = 100;
TimeBar_mc3._yscale= 100/(adInterval/(barCount/6));
TimeBar_mc1g._alpha = 0;
TimeBar_mc2g._alpha = 0;
} else {
whichAd = 1;
}
}
// This is triggered via the countDown function
function resetTimer(){
currentCount = 0;
whichAd++;
timer = setInterval(countDown, 1000);
changeNextImage();
}
function changeNextImage(){
if (img1_mc._alpha >0){
fadeOutImages(img1_mc, type1_mc);
fadeInImages(img2_mc, type2_mc);
}
else if (img2_mc._alpha >0){
fadeOutImages(img2_mc, type2_mc);
fadeInImages(img3_mc, type3_mc);
} else {
fadeOutImages(img3_mc, type3_mc);
fadeInImages(img1_mc, type1_mc);
}
}
//This is triggered by the clicking of one of the buttons
function changeAd(adNumber){
if (adPause == false){
timer = clearInterval(timer);
timer = clearInterval(barTimer);
currentCount = 0;
whichAd = adNumber;
timer = setInterval(countDown, 1000);
barTimer = setInterval(growBar, 100);
barCount = 0;
}else{
currentCount = 0;
whichAd = adNumber;
timer = setInterval(countDown, 1000);
barTimer = setInterval(growBar, 100);
barCount = 0;
adPause = false
btn_play._alpha = 0;
btn_pause._alpha = 100;
}
}
// This changes the display to ad number 1
btn_1b.onPress =function (){
changeAd(1);
if (img2_mc._alpha >0){
fadeOutImages(img2_mc, type2_mc);
}
else if (img3_mc._alpha >0){
fadeOutImages(img3_mc, type3_mc);
}
fadeInImages(img1_mc, type1_mc);
}
// This changes the display to ad number 2
btn_2b.onPress =function (){
changeAd(2);
if (img1_mc._alpha >0){
fadeOutImages(img1_mc, type1_mc);
}
else if (img3_mc._alpha >0){
fadeOutImages(img3_mc, type3_mc);
}
fadeInImages(img2_mc, type2_mc);
}
// This changes the display to ad number 3
btn_3b.onPress =function (){
changeAd(3);
if (img1_mc._alpha >0){
fadeOutImages(img1_mc, type1_mc);
}
else if (img2_mc._alpha >0){
fadeOutImages(img2_mc, type2_mc);
}
fadeInImages(img3_mc, type3_mc);
}
hoverClick.onRollOver = function(){
if (adPause == false){
btn_play._alpha = 100;
btn_pause._alpha = 0;
timer = clearInterval(timer);
timer = clearInterval(barTimer);
adPause = true
}
}
hoverClick.onPress = function(){
if(whichAd == 1){
getURL(url1);
}
if(whichAd == 2){
getURL(url2);
}
if(whichAd == 3){
getURL(url3);
}
}
hoverClick.onRollOut = function(){
btn_play._alpha = 0;
btn_pause._alpha = 100;
timer = setInterval(countDown, 1000);
barTimer = setInterval(growBar, 100);
adPause = false;
}
btn_play.onPress = function(){
if (adPause == false){
btn_play._alpha = 100;
btn_pause._alpha = 0;
timer = clearInterval(timer);
timer = clearInterval(barTimer);
adPause = true
} else {
btn_play._alpha = 0;
btn_pause._alpha = 100;
timer = setInterval(countDown, 1000);
barTimer = setInterval(growBar, 100);
adPause = false;
}
}
function fadeOutImages(whatImage, whatType){
var alpha_out_interval:Number = setInterval(fadeOutImage, 20, whatImage);
var text_out_interval:Number = setInterval(moveOutText, 20, whatType);
function fadeOutImage(target_mc:MovieClip):Void {
target_mc._alpha -= 5;
if (target_mc._alpha <= 0) {
target_mc._visible = false;
clearInterval(alpha_out_interval);
}
}
function moveOutText(target_type_mc:MovieClip):Void {
if (target_type_mc._y <= 200) {
target_type_mc._y = 270;
clearInterval(text_out_interval);
}else{
target_type_mc._y -= 2;
}
}
}
function fadeInImages(whatImage, whatType){
var alpha_in_interval:Number = setInterval(fadeInImage, 20, whatImage);
var text_in_interval:Number = setInterval(moveInText, 20, whatType);
function fadeInImage(target_mc:MovieClip):Void {
target_mc._visible = true;
target_mc._alpha += 5;
if (target_mc._alpha >= 100) {
clearInterval(alpha_in_interval);
}
}
function moveInText(target_type_mc:MovieClip):Void {
if (target_type_mc._y <= 230) {
target_type_mc._y = 230;
clearInterval(text_in_interval);
}else{
target_type_mc._y -= 2;
}
}
}