I am trying to take ten images, load them into an array, and then show them one at a time,fading out each one in turn. I keep getting this error.
ReferenceError: Error #1056: Cannot create property alpha on String.
at fl.transitions::Tween/setPosition()
at fl.transitions::Tween/set position()
at fl.transitions::Tween()
at images_fla::MainTimeline/goPlay()
my code
import fl.transitions.Tween;
import fl.transitions.easing.*;
play_btn.addEventListener(MouseEvent.CLICK, goPlay)
var images = new Array();
images[0] = "1.jpg";
images[1] = "2.jpg";
images[2] = "3.jpg";
images[3] = "4.jpg";
images[4] = "5.jpg";
images[5] = "6.jpg";
images[6] = "7.jpg";
images[7] = "8.jpg";
images[8] = "9.jpg";
images[9] = "10.jpg";
function goPlay(e:MouseEvent) {
for (var i:int = 0; i <10; i++) {
loadWindow.source = images[i];
var myTween:Tween = new Tween(images[i], "alpha", None.easeOut, 1, 0, 15, true);
}
}
The first parameter of the Tween object is a string, and fails because strings don’t have an
alphaproperty. Try passing the actualloadWindowobject instead of theimages[i].