<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>ウェ部ログ２</title>
    <link rel="alternate" type="text/html" href="http://webu.org/blog2/" />
    <link rel="self" type="application/atom+xml" href="http://webu.org/blog2/atom.xml" />
   <id>tag:webu.org,2012:/blog2//3</id>
    <link rel="service.post" type="application/atom+xml" href="http://webu.org/mt/mt-atom.cgi/weblog/blog_id=3" title="ウェ部ログ２" />
    <updated>2012-03-09T06:50:40Z</updated>
    <subtitle>flash as3 pv3d box2dなどの勉強・メモ。　ほんとにメモです。</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type  3.36</generator>
 

<entry>
    <title>ng wordチェック</title>
    <link rel="alternate" type="text/html" href="http://webu.org/blog2/2012/03/ng_word.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://webu.org/mt/mt-atom.cgi/weblog/blog_id=3/entry_id=720" title="ng wordチェック" />
    <id>tag:webu.org,2012:/blog2//3.720</id>
    
    <published>2012-03-09T06:49:51Z</published>
    <updated>2012-03-09T06:50:40Z</updated>
    
    <summary>		public function isNGWord( word:String ...</summary>
    <author>
        <name>webu</name>
        
    </author>
    
    <content type="html" xml:lang="ja" xml:base="http://webu.org/blog2/">
        		public function isNGWord( word:String ):Boolean{
			
			var ngword:Array = [&quot;unko&quot;,&quot;chinko&quot;];	
			
			//検索ワードにNGワードが含まれるか検索
			var reg:RegExp = null;
			var len:uint = ngword.length;
			for( var i:uint=0; i&lt;len; i++ ){
				if( ( new RegExp( ngword[i], &quot;gix&quot; ) ).test( word ) ){
					return true;
				}
			}
			
			return false;
		}
        
    </content>
</entry>

<entry>
    <title>ustream memo</title>
    <link rel="alternate" type="text/html" href="http://webu.org/blog2/2012/01/ustream_memo.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://webu.org/mt/mt-atom.cgi/weblog/blog_id=3/entry_id=719" title="ustream memo" />
    <id>tag:webu.org,2012:/blog2//3.719</id>
    
    <published>2012-01-23T12:22:28Z</published>
    <updated>2012-01-30T01:56:21Z</updated>
    
    <summary>		public function initialize(id:String=&quot;...</summary>
    <author>
        <name>webu</name>
        
    </author>
    
        <category term="ustream" />
    
    <content type="html" xml:lang="ja" xml:base="http://webu.org/blog2/">
        		public function initialize(id:String=&quot;8439142&quot;,password:String=&quot;&quot;):void {
			_log.debug(&quot;initialzie&quot;);
			this.visible = true;
			_id = id;
			_password = password;

				
			setChildIndex(mc, numChildren - 1);
			
			var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
			_loader = new Loader();
			_loader.contentLoaderInfo.addEventListener(&apos;complete&apos;, onLoaded);
			_loader.load(new URLRequest(&quot;http://www.ustream.tv/flash/viewer.rsl.swf&quot;), context );
	
		}
		
		
		private function onLoaded(e:Event=null):void
		{
			_log.debug(&quot;onLoaded&quot;);
			(_loader.contentLoaderInfo.applicationDomain.getDefinition(&quot;tv.ustream.localization.Locale&quot;)).nameSpace = &quot;flash.viewer&quot;;
			
			_loader.contentLoaderInfo.removeEventListener(&apos;complete&apos;, onLoaded);
			var Cls:* = _loader.contentLoaderInfo.applicationDomain.getDefinition(&quot;tv.ustream.viewer.logic.Logic&quot;)
			_logic = new Cls();
			_logic.addEventListener( &quot;createChannel&quot;, onCreateChannel, false, 0, true );
			_channel = _logic.createChannel(_id, true, _password);
				
		}
        
    </content>
</entry>

<entry>
    <title>singleton</title>
    <link rel="alternate" type="text/html" href="http://webu.org/blog2/2012/01/singleton_1.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://webu.org/mt/mt-atom.cgi/weblog/blog_id=3/entry_id=718" title="singleton" />
    <id>tag:webu.org,2012:/blog2//3.718</id>
    
    <published>2012-01-19T11:30:12Z</published>
    <updated>2012-01-30T01:56:34Z</updated>
    
    <summary>function DataManager() { 	if (__instance...</summary>
    <author>
        <name>webu</name>
        
    </author>
    
        <category term="as3" />
    
    <content type="html" xml:lang="ja" xml:base="http://webu.org/blog2/">
        function DataManager() {
	if (__instance) { throw new ArgumentError(&quot;&quot;); }
}
		
public static var __instance:DataManager;
public static function getInstance():DataManager {
		if ( __instance === null ) {
			__instance = new DataManager;
			
		}
		return __instance;
}

        
    </content>
</entry>

<entry>
    <title>airでBitmapDataの保存</title>
    <link rel="alternate" type="text/html" href="http://webu.org/blog2/2012/01/airbitmapdata.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://webu.org/mt/mt-atom.cgi/weblog/blog_id=3/entry_id=717" title="airでBitmapDataの保存" />
    <id>tag:webu.org,2012:/blog2//3.717</id>
    
    <published>2012-01-17T05:17:17Z</published>
    <updated>2012-01-17T05:18:15Z</updated>
    
    <summary>			var pngSource:BitmapData = new Bitmap...</summary>
    <author>
        <name>webu</name>
        
    </author>
    
        <category term="air" />
    
    <content type="html" xml:lang="ja" xml:base="http://webu.org/blog2/">
        			var pngSource:BitmapData = new BitmapData (stage.stageWidth, stage.stageHeight);
			pngSource.draw(stage);
			var ba:ByteArray = PNGEncoder.encode(pngSource);
			
			var dir:File = File.desktopDirectory.resolvePath(&quot;AIR_Test/hoge&quot;); 
			dir.createDirectory(); 
			
			var file:File = dir.resolvePath(&quot;test.png&quot;);
			var fileStream:FileStream = new FileStream();
			fileStream.open(file, FileMode.WRITE);
			fileStream.writeBytes(ba);
			fileStream.close();
        
    </content>
</entry>

<entry>
    <title>countDown</title>
    <link rel="alternate" type="text/html" href="http://webu.org/blog2/2012/01/countdown.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://webu.org/mt/mt-atom.cgi/weblog/blog_id=3/entry_id=716" title="countDown" />
    <id>tag:webu.org,2012:/blog2//3.716</id>
    
    <published>2012-01-05T12:00:05Z</published>
    <updated>2012-01-05T12:09:06Z</updated>
    
    <summary>package  { 	/** 	 * ... 	 * @author wata...</summary>
    <author>
        <name>webu</name>
        
    </author>
    
        <category term="as3" />
    
    <content type="html" xml:lang="ja" xml:base="http://webu.org/blog2/">
        package 
{
	/**
	 * ...
	 * @author watanab
	 */
	public class CountDown
	{
		
		public var days:Number = 0;
		public var hours:Number = 0;
		public var min:Number = 0;
		public var sec:Number = 0;
		
		
		public function CountDown()
		{
			
		}
		
		public static function getSabun(
			today:Date, targetDate:Date
		):CountDown {

			var currentYear:Number = today.getFullYear();
			var currentTime:Number = today.getTime();
			var targetTime:Number = targetDate.getTime();

			//Determines how much time is left.  Note: Leaves time in milliseconds

			var timeLeft:Number = targetTime - currentTime;

			var sec		:Number = Math.floor(timeLeft/1000);
			var min		:Number = Math.floor(sec/60);
			var hours	:Number = Math.floor(min/60);
			var days	:Number = Math.floor(hours/24);

			var cd:CountDown = new CountDown();
			cd.days = days;
			cd.sec = (sec % 60);
			cd.min = (min % 60);
			cd.hours = (hours % 24);
			
			return cd;
		}
		
		
	}

}

        
    </content>
</entry>

<entry>
    <title>localconnection使い方</title>
    <link rel="alternate" type="text/html" href="http://webu.org/blog2/2011/12/localconnection.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://webu.org/mt/mt-atom.cgi/weblog/blog_id=3/entry_id=715" title="localconnection使い方" />
    <id>tag:webu.org,2011:/blog2//3.715</id>
    
    <published>2011-12-14T02:50:37Z</published>
    <updated>2011-12-14T02:54:08Z</updated>
    
    <summary>おくる ------------------------------------...</summary>
    <author>
        <name>webu</name>
        
    </author>
    
        <category term="as3" />
    
    <content type="html" xml:lang="ja" xml:base="http://webu.org/blog2/">
        おくる
--------------------------------------
_connecter = new LocalConnection();
_connecter.addEventListener(StatusEvent.STATUS, onStatus);
_connecter.send(&quot;key&quot;, &quot;method_name&quot;, param);

        private function onStatus(event:StatusEvent):void {
			trace(event.level);
            switch (event.level) {
                case &quot;status&quot;:
			_connecter.close();
			//せいこう
                    break;
                case &quot;error&quot;:

                    break;
            }
        }

---------------------------------------
うける
---------------------------------------
_connecter = new LocalConnection();
_connecter.client = this;
_connecter.allowDomain(&quot;*&quot;);
_connecter.connect(&quot;key&quot;);	
			
		public function sendData(param):void{
			
			
			
		}
		












        
    </content>
</entry>

<entry>
    <title>flv memo</title>
    <link rel="alternate" type="text/html" href="http://webu.org/blog2/2011/12/flv_memo.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://webu.org/mt/mt-atom.cgi/weblog/blog_id=3/entry_id=714" title="flv memo" />
    <id>tag:webu.org,2011:/blog2//3.714</id>
    
    <published>2011-12-05T10:02:25Z</published>
    <updated>2011-12-05T10:02:37Z</updated>
    
    <summary>http://www.publicroots.com/fmt/archives/...</summary>
    <author>
        <name>webu</name>
        
    </author>
    
        <category term="as3" />
    
    <content type="html" xml:lang="ja" xml:base="http://webu.org/blog2/">
        http://www.publicroots.com/fmt/archives/000187.html
        
    </content>
</entry>

<entry>
    <title>swfobject</title>
    <link rel="alternate" type="text/html" href="http://webu.org/blog2/2011/11/swfobject.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://webu.org/mt/mt-atom.cgi/weblog/blog_id=3/entry_id=713" title="swfobject" />
    <id>tag:webu.org,2011:/blog2//3.713</id>
    
    <published>2011-11-23T13:42:53Z</published>
    <updated>2011-11-23T13:44:38Z</updated>
    
    <summary>var swfName=&quot;main.swf&quot;; var vars = { 	te...</summary>
    <author>
        <name>webu</name>
        
    </author>
    
        <category term="as3" />
    
    <content type="html" xml:lang="ja" xml:base="http://webu.org/blog2/">
        var swfName=&quot;main.swf&quot;;
var vars = {
	test	:&quot;testtest&quot;
};
if (swfobject.getQueryParamValue(&quot;mid&quot;)) {
	vars.mid = swfobject.getQueryParamValue(&quot;mid&quot;);
};
			
			var params = {
				wmode:wmode,
				bgcolor:&quot;#000000&quot;,
				allowfullscreen:&quot;true&quot;,
				allowScriptAccess:&quot;always&quot;,
				menu:&quot;false&quot;
			};
			
			var attributes = { id:&quot;flashContent&quot;, name:&quot;flashContent&quot; };
			swfobject.embedSWF(swfName, divName, ww, hh, &quot;10&quot;, &quot;&quot;, vars, params, attributes);
        
    </content>
</entry>

<entry>
    <title>配列をランダムに入れ替え</title>
    <link rel="alternate" type="text/html" href="http://webu.org/blog2/2011/11/post_106.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://webu.org/mt/mt-atom.cgi/weblog/blog_id=3/entry_id=712" title="配列をランダムに入れ替え" />
    <id>tag:webu.org,2011:/blog2//3.712</id>
    
    <published>2011-11-22T07:09:09Z</published>
    <updated>2011-11-22T07:10:07Z</updated>
    
    <summary>			for (var i: int = 0; i  				 				var ...</summary>
    <author>
        <name>webu</name>
        
    </author>
    
        <category term="as3" />
    
    <content type="html" xml:lang="ja" xml:base="http://webu.org/blog2/">
        			for (var i: int = 0; i &lt;  ary.length;  i++) {
				
				var idx1	:int = Math.floor( Math.random() * ary.length );
				var idx2	:int = Math.floor( Math.random() * ary.length );
				
				var tmp:* = ary[idx1];
				ary[idx1] = ary[idx2];
				ary[idx2] = tmp;
				
			}
        
    </content>
</entry>

<entry>
    <title>弧の表示</title>
    <link rel="alternate" type="text/html" href="http://webu.org/blog2/2011/10/post_105.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://webu.org/mt/mt-atom.cgi/weblog/blog_id=3/entry_id=711" title="弧の表示" />
    <id>tag:webu.org,2011:/blog2//3.711</id>
    
    <published>2011-10-25T12:37:03Z</published>
    <updated>2011-10-25T12:37:24Z</updated>
    
    <summary>		public static function drawLine(g:Grap...</summary>
    <author>
        <name>webu</name>
        
    </author>
    
        <category term="as3" />
    
    <content type="html" xml:lang="ja" xml:base="http://webu.org/blog2/">
        		public static function drawLine(g:Graphics, radius:Number, arc:Number) {
			
			var startAngle:Number = 0;
			var x:Number = 0;
			var y:Number = 0;
			
			x+=radius;

			g.moveTo(x, y);
			//arc = arc % 360;
			arc=(arc&gt;360) ? 360 : arc;
			var segs = Math.ceil(Math.abs(arc)/45);
			var segAngle = arc/segs;
			var theta = -(segAngle/180)*Math.PI;
			var angle = -(startAngle/180)*Math.PI;
			var ax = x - Math.cos(angle)*radius;
			var ay = y - Math.sin(angle) * radius;
			
			if (segs&gt;0) {
				for (var i = 0; i&lt;segs; i++) {
					angle += theta;
					var angleMid = angle-(theta/2);
					var bx = ax+Math.cos(angle)*radius;
					var by = ay+Math.sin(angle)*radius;
					var cx = ax+Math.cos(angleMid)*(radius/Math.cos(theta/2));
					var cy = ay+Math.sin(angleMid)*(radius/Math.cos(theta/2));
					g.curveTo(cx, cy, bx, by);
				}
			
			}
			
			g.lineTo(x-radius,y);
		}
        
    </content>
</entry>

<entry>
    <title>log10</title>
    <link rel="alternate" type="text/html" href="http://webu.org/blog2/2011/10/log10.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://webu.org/mt/mt-atom.cgi/weblog/blog_id=3/entry_id=710" title="log10" />
    <id>tag:webu.org,2011:/blog2//3.710</id>
    
    <published>2011-10-18T15:29:50Z</published>
    <updated>2011-10-18T15:38:04Z</updated>
    
    <summary>log10(x) = Math.log(x) * (Math.LOG10E) h...</summary>
    <author>
        <name>webu</name>
        
    </author>
    
        <category term="as3" />
    
    <content type="html" xml:lang="ja" xml:base="http://webu.org/blog2/">
        log10(x) = Math.log(x) * (Math.LOG10E)

http://www.geisya.or.jp/~mwm48961/kou2/log2.html
より
        
    </content>
</entry>

<entry>
    <title>Markerをつける</title>
    <link rel="alternate" type="text/html" href="http://webu.org/blog2/2011/10/marker.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://webu.org/mt/mt-atom.cgi/weblog/blog_id=3/entry_id=709" title="Markerをつける" />
    <id>tag:webu.org,2011:/blog2//3.709</id>
    
    <published>2011-10-14T10:19:00Z</published>
    <updated>2011-10-14T10:20:43Z</updated>
    
    <summary>	 				var latLng:LatLng 				var option:M...</summary>
    <author>
        <name>webu</name>
        
    </author>
    
        <category term="googlemaps" />
    
    <content type="html" xml:lang="ja" xml:base="http://webu.org/blog2/">
        	
				var latLng:LatLng
				var option:MarkerOptions = new MarkerOptions({
					icon: mc,
					hasShadow: false,
					clickable: false,
					draggable: false
				});
				
					var marker:Marker = new Marker(latLng, option);
					_map.addOverlay( marker );
        
    </content>
</entry>

<entry>
    <title>そのラベルを持っているか。</title>
    <link rel="alternate" type="text/html" href="http://webu.org/blog2/2011/10/post_104.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://webu.org/mt/mt-atom.cgi/weblog/blog_id=3/entry_id=708" title="そのラベルを持っているか。" />
    <id>tag:webu.org,2011:/blog2//3.708</id>
    
    <published>2011-10-12T06:00:08Z</published>
    <updated>2011-10-12T06:00:28Z</updated>
    
    <summary>		private function _hasLabel(label:Strin...</summary>
    <author>
        <name>webu</name>
        
    </author>
    
        <category term="as3" />
    
    <content type="html" xml:lang="ja" xml:base="http://webu.org/blog2/">
        		private function _hasLabel(label:String):Boolean {
			
			for each(var frameLabel:FrameLabel in this.currentLabels) {
				if (frameLabel.name == label) return true;
			}
			return false;
		}
        
    </content>
</entry>

<entry>
    <title>addCommas 数字にコンマをつける</title>
    <link rel="alternate" type="text/html" href="http://webu.org/blog2/2011/09/addcommas.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://webu.org/mt/mt-atom.cgi/weblog/blog_id=3/entry_id=707" title="addCommas 数字にコンマをつける" />
    <id>tag:webu.org,2011:/blog2//3.707</id>
    
    <published>2011-09-28T14:40:11Z</published>
    <updated>2011-09-28T14:40:35Z</updated>
    
    <summary>http://www.cgiinteractive.com/blog/2009/...</summary>
    <author>
        <name>webu</name>
        
    </author>
    
        <category term="as3" />
    
    <content type="html" xml:lang="ja" xml:base="http://webu.org/blog2/">
        http://www.cgiinteractive.com/blog/2009/05/formatting-numbers-with-commas-in-as3/
        
    </content>
</entry>

<entry>
    <title>中心極限定理</title>
    <link rel="alternate" type="text/html" href="http://webu.org/blog2/2011/09/post_103.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://webu.org/mt/mt-atom.cgi/weblog/blog_id=3/entry_id=706" title="中心極限定理" />
    <id>tag:webu.org,2011:/blog2//3.706</id>
    
    <published>2011-09-16T09:51:10Z</published>
    <updated>2011-09-16T09:52:23Z</updated>
    
    <summary>(Math.random()+Math.random()+Math.random...</summary>
    <author>
        <name>webu</name>
        
    </author>
    
        <category term="as3" />
    
    <content type="html" xml:lang="ja" xml:base="http://webu.org/blog2/">
        (Math.random()+Math.random()+Math.random()/3

とかすると、

0.5を中心としたガウス分布に近づいていく。
        
    </content>
</entry>

</feed> 


