WebデザインノートBOOK

Webクリエイターに関する勉強を書き記したブログになります。

Webデザインノート|ActionScript課題F005〜F019

ActionScript課題集

答え合わせ等にご活用ください。
※たまにhtmlファイルが「403 Forbidden」で見れなくなります。
 そうした場合は、
 WebデザインLab|かだいページにてご覧ください。


課題F005
var point;
point = 300;
osaru_mc.onRelease = function() {
	osaru_mc._x = point;
}

F005.html リストへ戻る


課題F006
osaru_mc.onRelease = function() {
	var movePoint;
	movePoint = 20;
	
	osaru_mc._x += movePoint;
	osaru_mc._xscale += movePoint;
	osaru_mc._yscale += movePoint;
	osaru_mc._rotation += movePoint;
}

F006.html リストへ戻る


課題F007
osaru.onEnterFrame = function() {
	_root.osaru._x += 5;
}

F007.html リストへ戻る


課題F008
osaru.onEnterFrame = function() {
	_root.osaru._x -= 5;
}

F008.html リストへ戻る


課題F009
osaru_mc.onEnterFrame = function() {
	var point;
	
	point = osaru_mc._y;
	
	if(point < -150){
		stop();
	}
	else {
		_root.osaru_mc._y -= 5;
		trace(point);
		console.text = (point);
	}
}	

F009.html リストへ戻る


課題F010
osaru_mc.onEnterFrame = function() {
	var point;
	
	point = osaru_mc._y;
	
	if(point > 550){
		stop();
	}
	else {
		_root.osaru_mc._y += 5;
		trace(point);
		console.text = (point);
	}	
}

F010.html リストへ戻る


課題F011
osaru_mc.onEnterFrame = function() {
	var num;
	num = 5;
	
	_root.osaru_mc._y += num;
	_root.osaru_mc._x += num;
}

F011.html リストへ戻る


課題F012
osaru_mc.onEnterFrame = function() {
	var point;
	point = 5;
	
	osaru_mc._xscale += point;
	osaru_mc._yscale += point;	
}

F012.html リストへ戻る


課題F013
osaru_mc.onEnterFrame = function() {
	var point;
	
	point = osaru_mc._alpha;
	
	osaru_mc._alpha -= 5;
	
	console.text = (point);
}

F013.html リストへ戻る


課題F014
osaru_mc.onRelease = function() {
	
	var movePoint;
	
	movePoint = 20;
	
	this._x += movePoint;
	this._rotation += movePoint;
	this._xscale += movePoint;
	this._yscale += movePoint;
}

F014.html リストへ戻る


課題F015
up_btn.onRelease = function() {
	
	osaru_mc._y -= movePoint;
}
right_btn.onRelease = function() {
	
	osaru_mc._x += movePoint;
}
down_btn.onRelease = function() {
	
	osaru_mc._y += movePoint;
}
left_btn.onRelease = function() {
	
	osaru_mc._x -= movePoint;
}

F015.html リストへ戻る


課題F016
var movePoint;
movePoint = 10;

up_btn.onPress = function() {
	osaru_mc.onEnterFrame = function() {
		osaru_mc._y -= movePoint;
	};
};
up_btn.onRelease = function() {
	osaru_mc.onEnterFrame = undefined; 
};


right_btn.onPress = function() {
	osaru_mc.onEnterFrame = function() {
		osaru_mc._x += movePoint;
	};
};
right_btn.onRelease = function() {
	osaru_mc.onEnterFrame = undefined; 
};


down_btn.onPress = function() {
	osaru_mc.onEnterFrame = function() {
		osaru_mc._y += movePoint;
	};
};
down_btn.onRelease = function() {
	osaru_mc.onEnterFrame = undefined; 
};


left_btn.onPress = function() {
	osaru_mc.onEnterFrame = function() {
		osaru_mc._x -= movePoint;
	};
};
left_btn.onRelease = function() {
	osaru_mc.onEnterFrame = undefined; 
};

F016.html リストへ戻る


課題F017
button.onPress = function() {
	akasan_mc.onEnterFrame = function() {
		akasan_mc._rotation += 5; 
	};
};
button.onRelease = function() {
	akasan_mc.onEnterFrame = undefined; 
};

F017.html リストへ戻る


課題F018
akasan_mc.onEnterFrame = function() {
	
	akasan_mc._x += 5;
	
	if(akasan_mc._x > Stage.width){
		akasan_mc._x -= 10;
	}
}

F018.html リストへ戻る


課題F019
myKey = new Object();

myKey.onKeyDown = function() {
  var num;
  
  num = 5;

  /*akasan.onEnterFrame = function() {*/
  switch(Key.getCode()){
	
    case Key.UP:
      akasan_mc._y -= num;
      break;
	
    case Key.DOWN:
      akasan_mc._y += num;
      break;
	
    case Key.RIGHT:
      akasan_mc._x += num;
      break;
	
    case Key.LEFT:
      akasan_mc._x -= num;
      break;
  }
}

Key.addListener(myKey);

F019.html リストへ戻る