• Links

  • Categories

  • Meta

  • Archives

  • Show/Hide Navigation
    9 月
    6

    addEventListenerでページの切り替えを表現。

    ダウンロードする

    var targetX = 0;
    buttonMode = true;
    
    photo_mc.addEventListener(Event.ENTER_FRAME,loop);
    btn01_mc.addEventListener(MouseEvent.CLICK, btn01);
    btn02_mc.addEventListener(MouseEvent.CLICK, btn02);
    btn03_mc.addEventListener(MouseEvent.CLICK, btn03);
    
    function loop (event) {
    	photo_mc.x += ((targetX*-500)-photo_mc.x ) * 0.2;
    }
    
    function btn01 (event) {
    	targetX = 0;
    }
    
    function btn02 (event) {
    	targetX = 1;
    }
    
    function btn03 (event) {
    	targetX = 2;
    }
    
    6 月
    11

    addEventListener()メソッドによるイベント処理。

    
    up.addEventListener(MouseEvent.CLICK, ue);
    function ue(event:MouseEvent) {
    	circle.y -= 5;
    }
    
    down.addEventListener(MouseEvent.CLICK, shita);
    function shita(event:MouseEvent) {
    	circle.y += 5;
    }
    
    left.addEventListener(MouseEvent.CLICK, hidari);
    function hidari(event:MouseEvent) {
    	circle.x -= 5;
    }
    
    right.addEventListener(MouseEvent.CLICK, migi);
    function migi(event:MouseEvent) {
    	circle.x += 5;
    }
    

    ダウンロードする

    6 月
    11

    昨日、CSS niteに参加をして、ActionScript3.0の話を聞いた。
    久しぶりに書いてみようと思います。

    circle.addEventListener(MouseEvent.CLICK, kaiten);
    
    function kaiten(event:MouseEvent) {
    	circle.rotation += 15;
    }
    

    ダウンロードする