Skip to content

Instantly share code, notes, and snippets.

@elct9620
Created December 29, 2011 13:23
Show Gist options
  • Save elct9620/1534097 to your computer and use it in GitHub Desktop.
Save elct9620/1534097 to your computer and use it in GitHub Desktop.
Flash AIR for iOS Tap Test
import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;
import flash.events.TouchEvent;
Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT; //設定觸控模式
Object(root).movie.stop(); //停止 movie 影片片段播放
Object(root).movie.addEventListener(TouchEvent.TOUCH_TAP, myPlay); //新增觸控事件偵測(點擊 Tap)
var playMode:Boolean = false; //播放模式,預設 stop ( FALSE 為 stop )
function myPlay(evt:TouchEvent) : void //觸控事件處理
{
if(playMode == false){ //如果目前為停止播放
Object(root).movie.play(); //播放影片片段
playMode = true; //設定播放模式為 TRUE
}else{
Object(root).movie.stop(); //停止播放影片片段
playMode = false; //設定播放模式為 FALSE
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment