# How to unload this movie from cash?

**URL:** <https://forum.kirupa.com/t/how-to-unload-this-movie-from-cash/291257>\
**Category:** flash\
**Created:** [June 26, 2009, 8:33pm UTC](https://forum.kirupa.com/t/how-to-unload-this-movie-from-cash/291257 "2009-06-26T20:33:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![felix\_portugal](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@felix\_portugal](https://forum.kirupa.com/u/felix_portugal)\
**Post date:** [June 26, 2009, 8:33pm UTC](https://forum.kirupa.com/t/how-to-unload-this-movie-from-cash/291257/1 "2009-06-26T20:33:25Z")

</div>

import mx.transitions.Tween;  
import mx.transitions.easing.\*;

var myGalleryXML = new XML();  
myGalleryXML.ignoreWhite = true;  
myGalleryXML.load(“gallery.xml”);

myGalleryXML.onLoad = function() {  
gallery\_x = myGalleryXML.firstChild.attributes.gallery\_x;  
gallery\_y = myGalleryXML.firstChild.attributes.gallery\_y;  
gallery\_width = myGalleryXML.firstChild.attributes.gallery\_width;  
gallery\_height = myGalleryXML.firstChild.attributes.gallery\_height;

myImages = myGalleryXML.firstChild.childNodes;  
myImagesTotal = myImages.length;

thumb\_height = myGalleryXML.firstChild.attributes.thumb\_height;  
thumb\_width = myGalleryXML.firstChild.attributes.thumb\_width;

full\_x = myGalleryXML.firstChild.attributes.full\_x;  
full\_y = myGalleryXML.firstChild.attributes.full\_y;

callThumbs();  
createMask();  
scrolling();

};

function callThumbs() {  
createEmptyMovieClip(“container\_mc”,getNextHighest Depth());  
container\_mc.\_x = gallery\_x;  
container\_mc.\_y = gallery\_y;

var clipLoader = new MovieClipLoader();  
var preloader = new Object();  
clipLoader.addListener(preloader);

for (i=0; i\<myImagesTotal; i++) {  
thumbURL = myImages.attributes.thumb\_url;  
myThumb\_mc = container\_mc.createEmptyMovieClip(i, container\_mc.getNextHighestDepth());  
myThumb\_mc.\_y = thumb\_height\*i;  
clipLoader.loadClip(“thumbs/”+thumbURL,myThumb\_mc);

preloader.onLoadStart = function(target) {  
target.createTextField(“my\_txt”,target.getNextHigh estDepth(),0,0,100,20);  
target.my\_txt.selectable = false;  
};

preloader.onLoadProgress = function(target, loadedBytes, totalBytes) {  
target.my\_txt.text = Math.floor((loadedBytes/totalBytes)\*100);  
};

preloader.onLoadComplete = function(target) {  
new Tween(target, “\_alpha”, Strong.easeOut, 0, 100, .5, true);  
target.my\_txt.removeTextField();  
target.onRelease = function() {  
callFullImage(this.\_name);  
};

target.onRollOver = function() {  
this.\_alpha = 50;  
};

target.onRollOut = function() {  
this.\_alpha = 100;  
};

};  
}  
}

function callFullImage(myNumber) {

myURL = myImages[myNumber].attributes.full\_url;  
myTitle = myImages[myNumber].attributes.title;  
createEmptyMovieClip(“fullImage\_mc”,getNextHighest Depth());  
fullImage\_mc.\_x = full\_x;  
fullImage\_mc.\_y = full\_y;

var fullClipLoader = new MovieClipLoader();  
var fullPreloader = new Object();  
fullClipLoader.addListener(fullPreloader);

fullPreloader.onLoadStart = function(target) {  
target.createTextField(“my\_txt”,fullImage\_mc.getNe xtHighestDepth(),0,0,200,20);  
target.my\_txt.selectable = false;  
};

fullPreloader.onLoadProgress = function(target, loadedBytes, totalBytes) {  
target.my\_txt.text = Math.floor((loadedBytes/totalBytes)\*100);  
};

fullPreloader.onLoadComplete = function(target) {  
new Tween(target, “\_alpha”, Strong.easeOut, 0, 100, .5, true);  
target.my\_txt.text = myTitle;  
};

fullClipLoader.loadClip(“full\_images/”+myURL,fullImage\_mc);

}

function createMask() {

createEmptyMovieClip(“mask\_mc”,getNextHighestDepth ());

mask\_mc.\_x = gallery\_x;  
mask\_mc.\_y = gallery\_y;

mask\_mc.beginFill(0x000000,100);  
mask\_mc.lineTo(gallery\_width,0);  
mask\_mc.lineTo(gallery\_width,gallery\_height);  
mask\_mc.lineTo(0,gallery\_height);  
mask\_mc.lineTo(0,0);

container\_mc.setMask(mask\_mc);

}

function scrolling() {  
onEnterFrame = function() {

container\_mc.\_y += Math.cos(((mask\_mc.\_ymouse)/mask\_mc.\_height)\*Math.PI)\*15;

if (container\_mc.\_y\>mask\_mc.\_y) {  
container\_mc.\_y = mask\_mc.\_y;  
}

if (container\_mc.\_y\<(mask\_mc.\_y-(container\_mc.\_height-mask\_mc.\_height))) {  
container\_mc.\_y = mask\_mc.\_y-(container\_mc.\_height-mask\_mc.\_height);  
}

};

}
