Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addimage (loadUrl,id) {
- trace("1addImage called for id " + id);
- var mcl:MovieClipLoader = new MovieClipLoader();
- var mcl_listener:Object = new Object();
- mcl_listener.onLoadInit = function(imageHolder){
- trace("current image container is " + imageHolder);
- // do the scaling now. You'll get proper "final" dimensions
- oldWidth = imageHolder._width;
- oldHeight = imageHolder._height;
- thumbWidth = 150;
- aspectRatio = thumbWidth / oldWidth * 100;
- thumbHeight = oldHeight / 100 * aspectRatio
- imageHolder._width = thumbWidth;
- imageHolder._height = thumbHeight;
- trace(imageHolder._width + " imageHolder width " + aspectRatio);
- imageHolder.onRollOver = function () {
- trace("expanding thumb");
- imageHolder._width = oldWidth;
- imageHolder._height = oldHeight;
- }
- imageHolder.onRollOut = function() {
- trace("shrinking thumb");
- imageHolder._width = thumbWidth;
- imageHolder._height = thumbHeight;
- }
- }
- mcl.addListener(mcl_listener);
- for ( i = 0 ; i <= data.image.length ; i++ ) {
- var mcl_listener[i]:Object = new Object();
- mcl.addListener(mcl_listener[i]);
- var imageHolder:MovieClip = createEmptyMovieClip('imageHolder' + id, imageContainer.getNextHighestDepth());
- mcl.loadClip(loadUrl, imageHolder);
- }
- }
Add Comment
Please, Sign In to add comment