Skip to content

Instantly share code, notes, and snippets.

@itoz
itoz / gist:984301
Created May 21, 2011 06:16
シリアルリストにforでアドコマンド、iの取得
var _slist : SerialList = new SerialList();
for (var i : int = 0; i < _arr.length; i++) {
_slist.addCommand(new Func(
function(i : int) : void{
(_arr[i] as MyClass).fadeIn()
}
, [i])
);
_slist.addCommand(new Wait(0.1));
}
@itoz
itoz / gist:997062
Created May 28, 2011 17:40
マウスオーバーでタイマーストップしマウスアウトで「残り時間から」再開
/**
*============================================================
* copyright(c) 2011 www.romatica.com
* @author itoz
* 2011/05/29
*============================================================
*/
package
{
import flash.display.Sprite;
@itoz
itoz / gist:1050317
Created June 28, 2011 01:48
Android ライブ壁紙 Drawable 描画用 あれこれサンプル
//
// Android ライブ壁紙 Drawable 描画用 あれこれサンプル
//
/**==================================
* R.java から Drawable取得
*/
// 取得
private Drawable _image;
_image = r.getDrawable(R.drawable.image0);
@itoz
itoz / gist:1051110
Created June 28, 2011 13:19
JAVA 四捨五入
//四捨五入
BigDecimal origin = new BigDecimal(f);
BigDecimal res = origin.setScale(0,BigDecimal.ROUND_HALF_UP);
result = res.shortValue();
or
Math.round(f);
@itoz
itoz / gist:1064234
Created July 5, 2011 04:03
Android リソースの配列を取得
/**
ex)
<string-array name="entries0">
<item>値1</item>
<item>値2</item>
<item>値3</item>
<item>値4</item>
</string-array>
*/
String[] array =getResources().getStringArray(R.array.entries0);
@itoz
itoz / gist:1074518
Created July 10, 2011 12:52
java android bitmap drawableの変換いろいろ
//Resource → Bitmap
BitmapFactory.decodeResource(getResources(), R.drawable.icon);
//Resource → Drawable
getResources().getDrawable(R.drawable.icon);
@itoz
itoz / gist:1074517
Created July 10, 2011 12:51
java android 縦長ビットマップをアニメーション用に指定サイズに切り出して配列に
public ArrayList<Bitmap> split(Drawable drawable, int width, int height)
{
// 縦長Drawableをビットマップに
Bitmap bitmapOrg = ((BitmapDrawable) drawable).getBitmap();
//分割bitmapにして配列に保存
int masterHeight = bitmapOrg.getHeight();
int max = masterHeight / height;
@itoz
itoz / gist:1127000
Created August 5, 2011 06:12
指定連番画像を読み込んで縦長に並べるphotoshop 用 js
// ===================================================
// 指定連番画像を読み込んで縦長に並べるphotoshop 用 js
//
// - customize from "Load Files into Stack.js"
// - customize from tatsuaki.net ぐりぐり写真用 Photoshop自動化javascript
//
//===================================================
// (c) Copyright 2006. Adobe Systems, Incorporated. All rights reserved.
@itoz
itoz / TranceparentGlid.as
Created September 13, 2011 02:23
透明画像
/**
*============================================================
* copyright(c) 2011 www.itoz.jp
* @author itoz
*============================================================
*/
package jp.itoz.display
{
import flash.display.Sprite;
import flash.display.Shape;
package
{
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.net.URLRequest;
import flash.system.LoaderContext;