Display Screen DPI.

by rfkrocktk
♥0 | Line 16 | Modified 2010-09-04 09:06:37 | MIT License
play

ActionScript3 source code

/**
 * Copyright rfkrocktk ( http://wonderfl.net/user/rfkrocktk )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/csi4
 */

package {
    import flash.system.Capabilities;
    import flash.system.System;
    import flash.text.TextFormat;
    import flash.text.TextField;
    import flash.display.Sprite;
    
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            var tf:TextField = new TextField();
            tf.defaultTextFormat = new TextFormat('_sans');
            tf.text = "Your Screen DPI is " + Capabilities.screenDPI + " DPI.";
            
             tf.width = tf.height = this.stage.stageWidth           
            
            this.addChild(tf);
        }
    }
}