[FONT=Times New Roman][SIZE=3]Hi[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]There is a great tutorial under the topic Flash MX2004 – “Adding thumbnails”.[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]It’s about how to make a photo slideshow with scrollable thumbnails using Flash and XML. And it’s function is simple too, just click on a thumbnail and larger image fades in above.[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]If photograph is taken as landscape everything is fine but if it happens to be upright or portrait, it appears on left side of the picture_MC. [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]Is there any way to make upright images appearing in the middle of picture_MC?[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]Here is the code.[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]function loadXML(loaded) { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]if (loaded) { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]xmlNode = this.firstChild; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]image = []; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]description = []; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]thumbnails = []; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]total = xmlNode.childNodes.length; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]for (i=0; i<total; i++) { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]thumbnails* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]thumbnails_fn(i); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]firstImage(); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} else { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]content = “file not loaded!”; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]xmlData = new XML(); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]xmlData.ignoreWhite = true; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]xmlData.onLoad = loadXML; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]xmlData.load(“images.xml”); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]///////////////////////////////////// [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]listen = new Object(); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]listen.onKeyDown = function() { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]if (Key.getCode() == Key.LEFT) { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]prevImage(); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} else if (Key.getCode() == Key.RIGHT) { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]nextImage(); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]}; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]Key.addListener(listen); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]previous_btn.onRelease = function() { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]prevImage(); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]}; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]next_btn.onRelease = function() { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]nextImage(); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]}; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]///////////////////////////////////// [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]p = 0; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]this.onEnterFrame = function() { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]filesize = picture.getBytesTotal(); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]loaded = picture.getBytesLoaded(); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]preloader._visible = true; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]if (loaded != filesize) { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]preloader.preload_bar._xscale = 100*loaded/filesize; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} else { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]preloader._visible = false; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]if (picture._alpha<100) { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]picture._alpha += 10; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]}; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]function nextImage() { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]if (p<(total-1)) { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]p++; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]if (loaded == filesize) { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]picture._alpha = 0; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]picture.loadMovie(image[p], 1); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]desc_txt.text = description[p]; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]picture_num(); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]function prevImage() { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]if (p>0) { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]p–; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]picture._alpha = 0; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]picture.loadMovie(image[p], 1); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]desc_txt.text = description[p]; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]picture_num(); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]function firstImage() { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]if (loaded == filesize) { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]picture._alpha = 0; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]picture.loadMovie(image[0], 1); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]desc_txt.text = description[0]; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]picture_num(); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]function picture_num() { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]current_pos = p+1; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]pos_txt.text = current_pos+" / "+total; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]function thumbNailScroller() { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]// thumbnail code! [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]this.createEmptyMovieClip(“tscroller”, 1000); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]scroll_speed = 10; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]tscroller.onEnterFrame = function() { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._heig ht)) { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]thumbnail_mc._x -= scroll_speed; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} else if ((_root._xmouse<=200) && (thumbnail_mc.hitTest(hit_left))) { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]thumbnail_mc._x += scroll_speed; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} else { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]delete tscroller.onEnterFrame; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]}; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]} [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]function thumbnails_fn(k) { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]thumbnail_mc.createEmptyMovieClip(“t”+k, thumbnail_mc.getNextHighestDepth()); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]tlistener = new Object(); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]tlistener.onLoadInit = function(target_mc) { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]target_mc._x = hit_left._x+(eval(“thumbnail_mc.t”+k)._width+5)*k; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]target_mc.pictureValue = k; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]target_mc.onRelease = function() { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]p = this.pictureValue-1; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]nextImage(); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]}; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]target_mc.onRollOver = function() { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]this._alpha = 50; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]thumbNailScroller(); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]}; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]target_mc.onRollOut = function() { [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]this._alpha = 100; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]}; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]}; [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]image_mcl = new MovieClipLoader(); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]image_mcl.addListener(tlistener); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]image_mcl.loadClip(thumbnails[k], “thumbnail_mc.t”+k); [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]}[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]Thank you for any answer.[/SIZE][/FONT]