A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Is this your code? Parallax source author needed

  1. #1
    Senior Member
    Join Date
    Jun 2004
    Posts
    209

    Is this your code? Parallax source author needed

    I really need to reference the author of this parallax code but annoyingly Ive lost the forum post and Ive looked and searched for hours but I cannot find it.

    Here is the code

    Code:
    stop();
    var paused = false;
    var active;
    msgBox._visible = false;
    var btnList = new Array();
    function toggleEnabled() {
    	for (i in btnList) {
    		btnList[i].enabled = !btnList[i].enabled;
    	}
    }
    myPress = function (mc, num) {
    	btnList.push(mc);
    	mc.num = num
    	mc.onPress = function() {
    		if (!paused) {
    			paused = true;
    			this.gotoAndStop("dn");
    			active = this;
    			toggleEnabled();
    			msgBox._visible = true;
    			msgBox.play();
    			msgBox.msgs.gotoAndStop(active.num)
    			msgBox.btnClose.onPress = function() {
    				msgBox.play();
    				paused = false;
    				active.gotoAndPlay("up");
    				toggleEnabled();
    				msgBox._visible = false;
    			};
    		}
    	};
    };
    //
    moveIt = function (wc) {
    	wc.imageStartX = 0;
    	wc.imageEndX = -wc._width + Stage.width;
    	wc.StartMouseX = 0;
    	wc.EndMouseX = Stage.width;
    	wc.MouseRangeX = wc.EndMouseX - wc.StartMouseX;
    	wc.PanRangeX = wc.imageEndX - wc.imageStartX;
    	// 
    	wc.imageStartY = 0;
    	wc.imageEndY = -wc._height + Stage.height;
    	wc.StartMouseY = 0;
    	wc.EndMouseY = Stage.height;
    	wc.MouseRangeY = wc.EndMouseY - wc.StartMouseY;
    	wc.PanRangeY = wc.imageEndY - wc.imageStartY;
    	// 
    	wc.onEnterFrame = function() {
    		if (!paused) {
    			wc.rX = (_root._xmouse - wc.StartMouseX) / wc.MouseRangeX;
    			wc.rX = Math.max(0, Math.min(1, wc.rX));
    			wc._x += ((wc.rX * wc.PanRangeX + wc.imageStartX) - wc._x) / 9;
    			// 
    			wc.rY = (_root._ymouse - wc.StartMouseY) / wc.MouseRangeY;
    			wc.rY = Math.max(0, Math.min(1, wc.rY));
    			wc._y += ((wc.rY * wc.PanRangeY + wc.imageStartY) - wc._y) / 9;
    		}
    	};
    };
    //Call the function for each MC that is going to move.  Be sure that the 
    //registration point of each MC is set to the upper left corner.
    moveIt(bg);
    moveIt(mid);
    moveIt(fg);
    //Set for each button that will be used, first parameter is button MC.
    //Second parameter is the frame number of the msgs MC to display.
    myPress(mid.btn1, 1);
    myPress(fg.btn1, 2);
    myPress(fg.btn2, 3);
    The file was called just parallax I think. It has an image of a field and some message boxes etc. I havent used it in the same way, but I hope someone can claim ownership!

    see attached file! If anyone knows the author or has the post, please inform me!

    Cheers
    Attached Files Attached Files

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    I could be mistaken, but i think it was dawsonk. try sending him a pm.

    gparis

  3. #3
    Senior Member
    Join Date
    Jun 2004
    Posts
    209
    Still no one knows? This is very strange. I pmed, but got no reply.

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    Maybe he's busy if you have a question, go ahead and ask, maybe someone else will be able to answer.

    gparis

  5. #5
    Senior Member
    Join Date
    Jun 2004
    Posts
    209
    Thanks, but Im just wanting to credit the owner, for once I have no questions

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