////Listener for fullImage_mc
var fClip = new Object();
fClip.onLoadInit = function(target_mc:MovieClip) {
target_mc.onRelease = function() {
getURL(_root.FullImageLink);
};
};
function callFullImage(myNumber) {
myURL = myImages[myNumber].attributes.full_url;
myTitle = myImages[myNumber].attributes.title;
_root.createEmptyMovieClip("fullImage_mc",_root.getNextHighestDepth());
fullImage_mc._x = _root.full_x;
fullImage_mc._y = _root.full_y;
////store the link from XML in _root.FullImageLink
_root.FullImageLink = myImages[myNumber].attributes.thelink;
////////////////////////////////////////////////////
target_mc.onRelease = function() {
if( _root.FullImageLink != "" && _root.FullImageLink != null )
{ // If the link is not blank or null, then load it; otherwise, do nothing
getURL(_root.FullImageLink);
}
if( _root.FullImageLink == "" && _root.FullImageLink == null )
{useHandCursor = false;}
};
var fullClipLoader = new MovieClipLoader();
var fullPreloader = new Object();
fullClipLoader.addListener(fullPreloader);
var myCaption:TextFormat = new TextFormat();
myCaption.size=10;
myCaption.font= "Arial";
myCaption.align= "center";
fullClipLoader.addListener(fClip);
fullPreloader.onLoadStart = function(target) {
target.createTextField("my_txt",target.getNextHighestDepth,0,301,186,50);
target.my_txt.selectable = false;
target.my_txt.wordWrap = true;
target.my_txt.setNewTextFormat(myCaption);
};
fullPreloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);
};
fullPreloader.onLoadComplete = function(target) {
target.my_txt.text = myTitle;
};
fullClipLoader.loadClip("photos_full/"+myURL,fullImage_mc);
}
|