A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] AK Gallery Question

  1. #1
    Senior Member etuom's Avatar
    Join Date
    Sep 2006
    Location
    Minnesota
    Posts
    193

    resolved [RESOLVED] AK Gallery Question

    Here is a question about Necro's AK Gallery. First, a little background...

    Using the Ak Gallery, I resized the screen and thumbnails so I could display the pictures I wanted on a movie 700 wide. everything worked and then I saved it.

    Then I inserted this file into my existing movie at frames 7 and 8. I changed the code on the first action script from gotoandPlay (2) to gotoandPlay (8). (see below) When I play the movie I cannot get to frame 8 where the pictures are suppose to load but it shoots me back to key frame 2 and stops. Does anyone have an idea what I am missing?

    here is the code for key frame 7

    Code:
     // Photo Gallery by Necromanthus
    wdt = 1;
    hgt = 1;
    imgs = new XML();
    imgs.ignoreWhite = true;
    imgs.load("Images/images.xml");
    gal = 0;
    gallery = [" "];
    imglst = function() {
    	for (i=0; i<imgs.firstChild.childNodes.length; i++) {
    		node = imgs.firstChild.childNodes[i];
    		atrb = node.attributes;
    		if (node.nodeName == "vars") {
    			wdt = atrb.wdt;
    			wdt++;
    			wdt--;
    			hgt = atrb.hgt;
    			hgt++;
    			hgt--;
    		}else if (node.nodeName == "img") {
    			if (gallery[gal] != atrb.gal){
    				gallery.push(atrb.gal);
    				gal += 1;
    				this["images"+gal] = new Array();
    				this["infos"+gal] = new Array();
    			}
    			this["images"+gal].push(atrb.file);
    			this["infos"+gal].push(atrb.info);
    		}
    	}
    }
    first = function() {
    	if (imgs.loaded) {
    		imglst();
    		gotoAndPlay(8);
    	}
    }
    init = setInterval(first, 33);
    stop();

    here is the code for key frame 8

    Code:
    clearInterval(init);
    gal = 1;
    info = "";
    cgal = "";
    scr._alpha = 0;
    speed = 4;
    pic = 0;
    this.onEnterFrame = function() {
    	if(thmbs.hitTest(_xmouse,_ymouse,true)){
    		thmbs._x += (350 - _xmouse)/40;//half the width of movie, speed
    		if (thmbs._x > 200 ){			
    			thmbs._x = 200;
    		}else if (thmbs._x < (224- thmbs._width)){
    			thmbs._x = 224 - thmbs._width;
    		}
    	}
    	if (scr._alpha>speed && fadeOut) {
    		scr._alpha -= speed;
    	}
    	if (scr._alpha<speed) {
    		if (pic > 0){
    			scr.loadMovie("Images/"+this["images"+gal][pic-1]);
    			info = "<font color='#ff8060'>Description : </font><b>"+this["infos"+gal][pic-1]+"</b>";
    			cgal = "<font color='#ff8060'>Gallery : </font><b>"+gallery[gal]+"</b>";
    			fadeOut = false;
    			fadeIn = true;
    		}
    	}
    	if (scr._alpha<100 && fadeIn && !fadeOut) {
    		if ((scr._alpha += speed) > 100){
    			scr._alpha = 100;
    		}else{
    			scr._alpha += speed;
    		}
    	} else {
    		fadeIn = false;
    	}
    	if (scr._width != wdt){
    		scr._width = wdt;
    	}
    	if (scr._height != hgt){
    		scr._height = hgt;
    	}
    };
    for(i=1;i<=this["images"+gal].length;i++){
    	if (i>1){
    		thmbs.thmb1.duplicateMovieClip("thmb"+i, i);
    		thmbs["thmb"+i]._x = 84*(i-1);
    	}
    	thmbs["thmb"+i].pic = i;
    	thmbs["thmb"+i].ldr.loadMovie("Images/thumbs/"+this["images"+gal][i-1]);
    }
    stop();
    Could someone look over this code and tell me if I am missing something?

    Also, does inserting a fun file present problems that may be related to this. It seems the code wants to continue going to key frame 2 as originally made.

    Oh, forgot to mention that the info and gallery text boxes are not used but are still in the code.
    Thanks
    Last edited by etuom; 07-12-2009 at 04:34 PM.

  2. #2
    undead creature necromanthus's Avatar
    Join Date
    Feb 2002
    Location
    ROM
    Posts
    1,890
    Quote Originally Posted by etuom View Post
    Then I inserted this file into my existing movie at frames 7 and 8. I changed the code on the first action script from gotoandPlay (2) to gotoandPlay (8). (see below) When I play the movie I cannot get to frame 8 where the pictures are suppose to load but it shoots me back to key frame 2 and stops. Does anyone have an idea what I am missing?
    It works just fine, but you have to be sure the keyframes 1...6 do not have tweens.
    Otherwise you need to calculate the current frame or to use frame labels.

    cheers

  3. #3
    Senior Member etuom's Avatar
    Join Date
    Sep 2006
    Location
    Minnesota
    Posts
    193
    Quote Originally Posted by necromanthus View Post
    ... you have to be sure the keyframes 1...6 do not have tweens.
    That was it!

    Thanks, works great.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center