ブロック崩し間際。
はねかえるさまが見れる。
ball1.speedX=3+Math.random()*5;
ball2.speedX=3+Math.random()*5;
ball3.speedX=3+Math.random()*5;
ball1.speedY=3+Math.random()*5;
ball2.speedY=3+Math.random()*5;
ball3.speedY=3+Math.random()*5;
ball1.addEventListener(Event.ENTER_FRAME, onEnterframe);
ball2.addEventListener(Event.ENTER_FRAME, onEnterframe);
ball3.addEventListener(Event.ENTER_FRAME, onEnterframe);
function onEnterframe(e:Event):void {
var mc:MovieClip=e.target as MovieClip;
if (((mc.x-mc.width/2)<0)||((mc.x+mc.width/2)>stage.stageWidth)) {
mc.speedX*=-1;
}
if (((mc.y-mc.height/2)<0)||((mc.y+mc.height/2)>stage.stageHeight)) {
mc.speedY*=-1;
}
mc.x+=mc.speedX;
mc.y+=mc.speedY;
}
2010年6月30日水曜日
6・30更新
ball1.scaleX=ball1.scaleY = 0.6+Math.random() * 0.3;
ball2.scaleX=ball2.scaleY = 0.6+Math.random() * 0.3;
ball3.scaleX=ball3.scaleY = 0.6+Math.random() * 0.3;
ball1.addEventListener(Event.ENTER_FRAME, onEnterframe);
ball2.addEventListener(Event.ENTER_FRAME, onEnterframe);
ball3.addEventListener(Event.ENTER_FRAME, onEnterframe);
function onEnterframe(e:Event): void {
var mc:MovieClip = e.target as MovieClip;
if ((mc.x - mc.width/2)> stage.stageWidth){
mc.x =- mc.width/2;
}else {
mc.x+=mc.width * 0.2;
}
}
ball2.scaleX=ball2.scaleY = 0.6+Math.random() * 0.3;
ball3.scaleX=ball3.scaleY = 0.6+Math.random() * 0.3;
ball1.addEventListener(Event.ENTER_FRAME, onEnterframe);
ball2.addEventListener(Event.ENTER_FRAME, onEnterframe);
ball3.addEventListener(Event.ENTER_FRAME, onEnterframe);
function onEnterframe(e:Event): void {
var mc:MovieClip = e.target as MovieClip;
if ((mc.x - mc.width/2)> stage.stageWidth){
mc.x =- mc.width/2;
}else {
mc.x+=mc.width * 0.2;
}
}
うぇぶウェブWEB。 6/30/wed/2010
var speedX:Number = 5;
ball1.addEventListener(Event.ENTER_FRAME, onEnterframe);
ball2.addEventListener(Event.ENTER_FRAME, onEnterframe);
ball3.addEventListener(Event.ENTER_FRAME, onEnterframe);
function onEnterframe(e:Event): void {
var mc:MovieClip = e.target as MovieClip;
if ((mc.x - mc.width/2)> stage.stageWidth){
mc.x =- mc.width/2;
}else {
mc.x+=speedX;
}
}
2010年6月23日水曜日
キーボードで動くやつ。
IME.enabled = false;
stage.addEventListener(KeyboardEvent.KEY_DOWN, moveObj);
function moveObj(e:KeyboardEvent):void{
var d:uint= 10;
var dx:int;
var dy:int;
switch(e.keyCode){
case Keyboard.RIGHT:
dx = d;
break;
case Keyboard.LEFT:
dx=d*-1;
break;
case Keyboard.UP:
dy= d* -1;
break;
case Keyboard.DOWN:
dy=d;
break;
}
mc1.x += dx;
mc1.y += dy;
}
stage.addEventListener(KeyboardEvent.KEY_DOWN, moveObj);
function moveObj(e:KeyboardEvent):void{
var d:uint= 10;
var dx:int;
var dy:int;
switch(e.keyCode){
case Keyboard.RIGHT:
dx = d;
break;
case Keyboard.LEFT:
dx=d*-1;
break;
case Keyboard.UP:
dy= d* -1;
break;
case Keyboard.DOWN:
dy=d;
break;
}
mc1.x += dx;
mc1.y += dy;
}
2010年6月9日水曜日
あぁ~。ウェブ6.9
btn1."addEventListener(EVENT.CLICK,gourl);
fuction gourl(e:MouseEvent):void{
var url:String="http://www.google.co.jp";
var urlReg:URLRequest=newURLRequest(url);
navigateToURL(urlReq,"_blank");
fuction gourl(e:MouseEvent):void{
var url:String="http://www.google.co.jp";
var urlReg:URLRequest=newURLRequest(url);
navigateToURL(urlReq,"_blank");
6月9日ウェブ 来週の課題。
バナーサイズ468×60
・お買い上げ10,000円以上でノートパソコンが当たる!
・フレーム数:30
・500KB以内で作成
納品時に.swfと .flaファイルを納品。
バナー広告
・お買い上げ10,000円以上でノートパソコンが当たる!
・フレーム数:30
・500KB以内で作成
納品時に.swfと .flaファイルを納品。
バナー広告
登録:
投稿 (Atom)