Hi. I’m an AS newbie. I received a flash file of a slider to change out one of the photos. I was able to change the photo but the published file won’t show any of images. Here is the link to the file Test.fla .
It uses two greensock classes as well (included) which weren’t included when the client sent the file over so I had to find and download it myself. It outputs “-440.6 1” which is over my head. Please help. Thank you in advance!
Here is the AS.
import gs.TweenMax;
import gs.easing.*;
var randomNum = Math.floor(Math.random()*3);
//var currpos = 528.4;
var currpos = 489.4;
if (randomNum == 1) {
currpos = currpos-930;
TweenMax.to(allimages, .5, {_x: currpos, ease:Sine.easeOut, onComplete :resetleft});
TweenMax.to(allimages, .5, {_alpha: 100, delay: .5});
TweenMax.to(ds, .5, {_alpha: 100});
}
else if (randomNum == 2) {
currpos = currpos;
TweenMax.to(allimages, .5, {_x: currpos, ease:Sine.easeOut, onComplete :resetleft});
TweenMax.to(allimages, .5, {_alpha: 100, delay: .5});
TweenMax.to(ds, .5, {_alpha: 100});
}
else {
currpos = 930+currpos;
TweenMax.to(allimages, .5, {_x: currpos, ease:Sine.easeOut, onComplete :resetleft});
TweenMax.to(allimages, .5, {_alpha: 100, delay: .5});
TweenMax.to(ds, .5, {_alpha: 100});
}
trace (currpos);
trace (randomNum);
leftarrow.onRollOver = function(){
//TweenMax.to(leftarrow, .25, {_x:57, ease:Sine.easeOut});
TweenMax.to(leftarrow.arrowcolor, .25, {tint:0xff0000});
}
leftarrow.onRollOut = function(){
//TweenMax.to(leftarrow, .25, {_x:67, ease:Sine.easeOut});
TweenMax.to(leftarrow.arrowcolor, .25, {tint:0x675A4F});
}
leftarrow.onRelease = function(){
currpos = currpos + 930;
TweenMax.to(allimages, .5, {_x: currpos, ease:Sine.easeOut, onComplete :resetleft});
leftarrow.enabled = false
}
function resetleft() {
leftarrow.enabled = true
if(currpos >= 2500) {
currpos = 489.4;
TweenMax.to(allimages, 0, {_x: 489.4});
}
}
rightarrow.onRollOver = function(){
//TweenMax.to(rightarrow, .25, {_x:1000, ease:Sine.easeOut});
TweenMax.to(rightarrow.arrowcolor, .25, {tint:0xff0000});
}
rightarrow.onRollOut = function(){
//TweenMax.to(rightarrow, .25, {_x:990, ease:Sine.easeOut});
TweenMax.to(rightarrow.arrowcolor, .25, {tint:0x675A4F});
}
rightarrow.onRelease = function(){
currpos = currpos - 930;
TweenMax.to(allimages, .5, {_x: currpos, ease:Sine.easeOut, onComplete :reset});
rightarrow.enabled = false
}
function reset() {
rightarrow.enabled = true
if(currpos <= -1860) {
currpos = 489.4;
TweenMax.to(allimages, 0, {_x: 489.4});
}
}
allimages.image1.familybtn.onRollOver = function(){
TweenMax.to(allimages.image1.familybtn.textcolor, .25, {tint:0xff0000});
}
allimages.image1.familybtn.onRollOut = function(){
TweenMax.to(allimages.image1.familybtn.textcolor, .25, {tint:0x675A4F});
}
allimages.image1.familybtn.onRelease = function(){
getURL("http://www.google.com/", "_self");
}
allimages.image2.strengthbtn.onRollOver = function(){
TweenMax.to(allimages.image2.strengthbtn.textcolor, .25, {tint:0xff0000});
}
allimages.image2.strengthbtn.onRollOut = function(){
TweenMax.to(allimages.image2.strengthbtn.textcolor, .25, {tint:0x675A4F});
}
allimages.image2.strengthbtn.onRelease = function(){
getURL("http://www.yahoo.com/", "_self");
}
allimages.image2L.strengthbtn.onRollOver = function(){
TweenMax.to(allimages.image2L.strengthbtn.textcolor, .25, {tint:0xff0000});
}
allimages.image2L.strengthbtn.onRollOut = function(){
TweenMax.to(allimages.image2L.strengthbtn.textcolor, .25, {tint:0x675A4F});
}
allimages.image2L.strengthbtn.onRelease = function(){
getURL("http://www.googlemaps.com/", "_self");
}
allimages.image3.hardworkbtn.onRollOver = function(){
TweenMax.to(allimages.image3.hardworkbtn.textcolor, .25, {tint:0xff0000});
}
allimages.image3.hardworkbtn.onRollOut = function(){
TweenMax.to(allimages.image3.hardworkbtn.textcolor, .25, {tint:0x675A4F});
}
allimages.image3.hardworkbtn.onRelease = function(){
getURL("http://www.espn.com/", "_self");
}
allimages.image3L.hardworkbtn.onRollOver = function(){
TweenMax.to(allimages.image3L.hardworkbtn.textcolor, .25, {tint:0xff0000});
}
allimages.image3L.hardworkbtn.onRollOut = function(){
TweenMax.to(allimages.image3L.hardworkbtn.textcolor, .25, {tint:0x675A4F});
}
allimages.image3L.hardworkbtn.onRelease = function(){
getURL("http://www.nfl.com/", "_self");
}