www.webdeveloper.com
Results 1 to 2 of 2

Thread: Minor Tweak Needed for slideshow code.

  1. #1
    Join Date
    Mar 2006
    Posts
    95

    Minor Tweak Needed for slideshow code.

    Thanks to the help of some very knowledgeable forum members I was able to successfully get my web project up and running. (www(dot)tatuvalkonenphotography(dot)com)

    Now I need to make a slight adjustment to my code (which I will post below).

    The photographer has requested that the photographs fade in when clicked rather than just appearing. He says it will give a more polished look to the site.

    I know this can be done by tweaking the action script. Please check out the site and note that each image is being loaded in a movie clip when the corresponding button is clicked on the right hand side. The action script is:


    Code:
    myXML.load("portraits.xml");
                             myXML.onLoad = function(success){
                                   if(success){
                                         trace(this.getBytesLoaded());
                                   }
                             }          
    
    
    
    
    
    var ssx:XML = new XML();
    ssx.ignoreWhite = true;
    
    var currentIndex:Number = 0;
    var captions:Array = new Array();
    var urls:Array = new Array();
    
    ssx.onLoad = function(success){
    	if (success) {
    		var ss:Array = ssx.firstChild.childNodes;
    		for (i=0;i<ss.length;i++) {
    			urls.push("images1/" + ss[i].attributes.url);
    		}
    		portraits_mc.loadMovie(urls[currentIndex]);
    		caption_txt.text = captions[currentIndex];
    
    	}
    	else
    	{
    		trace("XML file failed to load. Please try again later.");
    	}
    }
    
    ssx.load("portraits.xml");
    
    
    function img1() {
    	portraits_mc.loadMovie(urls[0]);
    }
    portraits_btn1.onRelease = img1;
    
    function img2() {
    	portraits_mc.loadMovie(urls[1]);
    }
    portraits_btn2.onRelease = img2;
    
    function img3() {
    	portraits_mc.loadMovie(urls[2]);
    }
    portraits_btn3.onRelease = img3;
    
    function img4() {
    	portraits_mc.loadMovie(urls[3]);
    }
    portraits_btn4.onRelease = img4;
    
    function img5() {
    	portraits_mc.loadMovie(urls[4]);
    }
    portraits_btn5.onRelease = img5;
    
    function img6() {
    	portraits_mc.loadMovie(urls[5]);
    }
    portraits_btn6.onRelease = img6;
    
    function img7() {
    	portraits_mc.loadMovie(urls[6]);
    }
    portraits_btn7.onRelease = img7;
    
    function img8() {
    	portraits_mc.loadMovie(urls[7]);
    }
    portraits_btn8.onRelease = img8;
    
    function img9() {
    	portraits_mc.loadMovie(urls[8]);
    }
    portraits_btn9.onRelease = img9;
    
    function img10() {
    	portraits_mc.loadMovie(urls[9]);
    }
    portraits_btn10.onRelease = img10;
    
    function img11() {
    	portraits_mc.loadMovie(urls[10]);
    }
    portraits_btn11.onRelease = img11;
    
    function img12() {
    	portraits_mc.loadMovie(urls[11]);
    }
    portraits_btn12.onRelease = img12;
    
    function img13() {
    	portraits_mc.loadMovie(urls[12]);
    }
    portraits_btn13.onRelease = img13;
    
    function img14() {
    	portraits_mc.loadMovie(urls[13]);
    }
    portraits_btn14.onRelease = img14;
    
    function img15() {
    	portraits_mc.loadMovie(urls[14]);
    }
    portraits_btn15.onRelease = img15;
    
    function img16() {
    	portraits_mc.loadMovie(urls[15]);
    }
    portraits_btn16.onRelease = img16;
    
    function img17() {
    	portraits_mc.loadMovie(urls[16]);
    }
    portraits_btn17.onRelease = img17;
    
    function img18() {
    	portraits_mc.loadMovie(urls[17]);
    }
    portraits_btn18.onRelease = img18;

  2. #2
    Join Date
    Feb 2008
    Location
    NW Washington State
    Posts
    1,856
    Hey CK19!
    Wish I could say that itís just a minor code change, but itís probably more than that.
    I did a quick check for the needed code but didnít find it yet. But the process goes like thisÖ since you will have two images showing at the same time, you know that you will need two separate ďcontainersĒ or _mc to display them. The fade in/out comes from alpha control of the that mc (0 to 100). The second, or overlapping mc always needs to be on top, so youíll need to give it a higher level than the image itís replacing.
    In case I canít find the code, check out,
    www.gotoandlearn.com
    or
    www.flashkit.com
    Best wishes,
    EfV

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles