2007年10月17日 星期三

ActionScript for photo website

This is the action script for the photo flash website

http://yl372.aisites.com/mm3301/MM3301_wk2.html

(Developing a compelling navigation/sequencing concept)
However, you have to figure out the x and y location for each photo


background_mc.targetX = background_mc._x;
background_mc.targetY = background_mc._y;
background_mc.onEnterFrame = function() {
this._x -= ( this._x - this.targetX ) * .23;
this._y -= ( this._y - this.targetY ) * .23;
};

background_mc.set_target = function( newX, newY ) {
this.targetX = newX;
this.targetY = newY;
};

b_0.onRelease = function() {
background_mc.set_target( -550, -500 );
};

b_1.onRelease = function() {
background_mc.set_target( 1200, 1550 );
};

b_2.onRelease = function() {
background_mc.set_target( -650, 1000 );
};

b_3.onRelease = function() {
background_mc.set_target( 1650, -550 );
};

b_4.onRelease = function() {
background_mc.set_target( 500, 400 );
};