夜の歌

プログラミング、音楽、本について緩く書いていきます。

つまった(10月18日)

動かないですね。

Titanium.UI.setBackgroundColor('#000');

// create tab group
var tabGroup = Titanium.UI.createTabGroup();


//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});

var animationFrames = [
	'wan.jpg',
	'color.jpg'
]

var animationView = Titanium.UI.createImageView({
	height:200,
	width:200,
	top: 30,
	images:animationFrames,
	//ミリ秒単位で次のフレームまでの間隔を指定します
	duration: 100,
	//繰り返し回数を指定します(0の場合は無限にくりかえします)
	repeatCount: 0
});
//アニメーション開始時のイベント
animationView.addEventListener('start',function(e){
});
//アニメーション終了時のイベント
animationView.addEventListener('stop',function(e){
});
//フレーム変更時のイベント
animationView.addEventListener('change',function(e){
	//e.indexにフレームのindexが返ります
});


var button1 = Ti.UI.createButton({
	title:'button',
	width:'70%'
});

//動かない箇所
button1.addEventListener('click',function(e){
	animationView.start();
	animationView.pause();
	animationView.stop();
});
 
win1.add(button1);



var tab1 = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'tab1',
    window:win1
});


tabGroup.addTab(tab1);  


tabGroup.open();

画像を動かしたかったのだけど、難しい。。 うーん。

しかし、眠いので今日の所はここまでですね。

パーフェクトJavaScript (PERFECT SERIES 4)

パーフェクトJavaScript (PERFECT SERIES 4)

178Pまで進んだ。進むの遅いな。もっとできるはずだ。 てことで明日。