Hi..I have an Xml gallery built with thumbnails
I would like to use the tween Max or the tween Lite class to fade my images in as the gallery loads and when the thumbnail is clicked for the main image to fade in also.
I know you have to import the files at the top of the .fla
import com.greensock.*;
import com.greensock.plugins.*;
import com.greensock.TweenLite;
And apply target, a duration, and an object.
but i dont where or how to apply these to my code.
Any suggestions would be greatly appreciated.
Thanks in advance.
import flash.display.MovieClip;
import com.greensock.*;
import com.greensock.plugins.*;
import com.greensock.TweenMax;
import flash.events.MouseEvent;
import fl.transitions.*;
import fl.transitions.easing.*;
var imageLoader:Loader;
var xml:XML;
var xmlList:XMLList;
var xmlLoader:URLLoader = new URLLoader();
var numClips:int=6;
var columns:int=2;
xmlLoader.load(new URLRequest("data/images.xml"));
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
function xmlLoaded(event:Event):void {
xml=XML(event.target.data);
xmlList=xml.children();
for (var i:int = 0; i < xmlList.length(); i++) {
imageLoader = new Loader();
imageLoader.load(new URLRequest(xmlList[i].attribute("thumb")));
imageLoader.x = 6 +( i % columns )*600;
imageLoader.y = 6 +(Math.floor(i/columns)*106);
imageLoader.name=xmlList[i].attribute("source");
addChild(imageLoader);
imageLoader.addEventListener(MouseEvent.CLICK, showPicture);
}
}
function showPicture(event:MouseEvent):void {
imageLoader = new Loader();
imageLoader.load(new URLRequest(event.target.name));
imageLoader.x=158;
imageLoader.y=6;
addChild(imageLoader);
}