A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: i know im missing something simple...

  1. #1
    Senior Member
    Join Date
    Jan 2003
    Location
    New York/London
    Posts
    367

    i know im missing something simple...

    please see file attached... its a tutorial from kirupa that im testing to see if i can make use of it.... I put the scrolling movie in an MC called myThumbs.
    and in the AS i added the myThumbs to the scrolling function as seen below... problem is... it wont scroll

    any help?

    Code:
    function thumbNailScroller() {
    	// thumbnail code! 
    	this.createEmptyMovieClip("tscroller", 1000);
    	scroll_speed = 10;
    	tscroller.onEnterFrame = function() {
    		if ((_root._ymouse>=myThumbs.thumbnail_mc._y) && (_root._ymouse<=myThumbs.thumbnail_mc._y+myThumbs.thumbnail_mc._height)) {
    			if ((_root._xmouse>=(myThumbs.hit_right._x-40)) && (myThumbs.thumbnail_mc.hitTest(myThumbs.hit_right))) {
    				myThumbs.thumbnail_mc._x -= scroll_speed;
    			} else if ((_root._xmouse<=(myThumbs.hit_left._x+40)) && (myThumbs.thumbnail_mc.hitTest(myThumbs.hit_left))) {
    				myThumbs.thumbnail_mc._x += scroll_speed;
    			}
    		} else {
    			delete tscroller.onEnterFrame;
    		}
    	};
    }
    function thumbnails_fn(k) {
    	myThumbs.thumbnail_mc.createEmptyMovieClip("t"+k, myThumbs.thumbnail_mc.getNextHighestDepth());
    	tlistener = new Object();
    	tlistener.onLoadInit = function(target_mc) {
    		target_mc._x = myThumbs.hit_left._x+(target_mc._width+5)*k;
    		target_mc.pictureValue = k;
    		target_mc.onRelease = function() {
    			p = this.pictureValue-1;
    			nextImage();
    		};
    		target_mc.onRollOver = function() {
    			this._alpha = 50;
    			thumbNailScroller();
    		};
    		target_mc.onRollOut = function() {
    			this._alpha = 100;
    		};
    	};
    	image_mcl = new MovieClipLoader();
    	image_mcl.addListener(tlistener);
    	image_mcl.loadClip(thumbnails[k], "myThumbs.thumbnail_mc.t"+k);
    }
    thanks in advance....
    Attached Files Attached Files

  2. #2
    Senior Member
    Join Date
    Jan 2003
    Location
    New York/London
    Posts
    367
    ok .. so im abit further along no... i managed to get the scroller working... but the
    Code:
    } else {
    			trace("else");
    			delete tscroller.onEnterFrame;
    		}
    is not happening


    Code:
    function thumbNailScroller() {
    	// thumbnail code! 
    	trace("function play");
    	this.createEmptyMovieClip("tscroller", 1000);
    	scroll_speed = 10;
    	tscroller.onEnterFrame = function() {
    		if ((_root._ymouse>=this.myThumbs.thumbnail_mc._y) && (_root._ymouse<=this.myThumbs.thumbnail_mc._y+this.myThumbs._height)) {
    			trace("big if");
    			if ((_root._xmouse>=(myThumbs.hit_right._x-40)) && (myThumbs.thumbnail_mc.hitTest(myThumbs.hit_right))) {
    				myThumbs.thumbnail_mc._x -= scroll_speed;
    				trace("if");
    			} else if ((_root._xmouse<=(myThumbs.hit_left._x+40)) && (myThumbs.thumbnail_mc.hitTest(myThumbs.hit_left))) {
    				myThumbs.thumbnail_mc._x += scroll_speed;
    				trace("else if");
    			}
    		} else {
    			trace("else");
    			delete tscroller.onEnterFrame;
    		}
    	};
    }

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