2013年11月10日 星期日

actionscript - array

helpful:
http://livedocs.adobe.com/flash/9.0_tw/ActionScriptLangRefV3/Array.html



var myArray:Array = new Array("Flash", "ActionScript", "Republic of Code");
trace(myArray);
trace(myArray[0]);


//add elementmyArray[3] = "Tutorial";

//remove from 2nd and 1 item
myArray.splice(2,1);

//remove the last item
myArray.pop();

//add one item at the last
myArray.push("39");










2013年11月4日 星期一

actionscript - random number




 return Math.random() * (max - min) + min;

2013年11月3日 星期日

actionscript keyboard event

function reportKeyDown(event:KeyboardEvent):void 
{ 
    trace("Key Pressed: " + String.fromCharCode(event.charCode) +         " (character code: " + event.charCode + ")"); 
} 
stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);

2013年8月30日 星期五

2013.8.30 - EQ - bass

Bass EQ recipes

Bass big three eq quick chart

More girth +6dB at 80Hz
More definition +8dB at 800Hz
More attack +4dB at 3.0kHz
Less mud -3dB at 220Hz

Bass eq recipes

Start here for a modern slap and pop type sound
  • Band 1: +8dB at 60Hz
  • Band 2: -3dB at 350Hz
  • Band 3: +9dB at 850Hz
  • Band 4: +8dB at 5kHz shelf
Start here for a vintage R&B sound
  • Band 1: +9dB at 100Hz
  • Band 2: +6dB at 1.6kHz (narrow)
  • Band 3: +5dB at 2.5kHz
  • Band 4: 4kHz low pass
Start here for a very punchy low end with plenty of cut
  • Band 1: 60Hz high pass
  • Band 2: +6dB at 80Hz
  • Band 3: +8dB at 900Hz
  • Band 4: +7dB at 3.4kHz

Bass compressor recipes

Punchy bass compression
  • Ratio: 4:1
  • Attack: 50ms
  • Release: 50ms
  • Threshold: adjust for 3-6dB gain reduction
Smoothing out dynamics
  • Ratio: 6:1
  • Attack: 0.3ms
  • Release: 660ms
  • Threshold: adjust for 3-6dB gain reduction

2013年8月15日 星期四

2013.08.15- add movieClip to stage


var temp:movingSnow = new movingSnow();
//add it to the display list
stage.addChild(temp);

temp.x = stage.stageWidth / 2;
temp.y = stage.stageHeight / 2;

2013年7月23日 星期二

java - draw a line first exapmle

import javax.swing.*;
import java.awt.*;
import java.awt.geom.*;

class main extends JFrame{

    public main(){
        JPanel panel=new JPanel();
        getContentPane().add(panel);
        setSize(450,450);

        JButton button =new JButton("press");
        panel.add(button);
    }

    public void paint(Graphics g) {
        Graphics2D g2 = (Graphics2D) g;
        Line2D lin = new Line2D.Float(100, 100, 250, 260);
        g2.draw(lin);
    }

    public static void main(String []args){
        main s=new main();
        s.setVisible(true);
    }
}