stop();
loadMovies()
/*playList = new Array()
obj = new Object()
obj.start = 5
obj.end = 8
playList.push(obj)
obj = new Object()
obj.start = 5
obj.end = 8
playList.push(obj)
obj = new Object()
obj.start = 5
obj.end = 8
playList.push(obj)
*///explaination of object notation
playList = [
{start:1, end:2, clip:"test_01.flv"},
{start:11, end:12, clip:"test_01.flv"},
{start:3, end:4, clip:"test_01.flv"},
{start:9, end:10, clip:"test_01.flv"},
{start:6, end:7, clip:"test_01.flv"},
{start:8, end:9, clip:"test_01.flv"}
]
function playNextEvent(){
lastTimeStamp = getTimer()
currentPlay++;
if(currentPlay < playList.length){
isPlaying = true
}else{
trace([currentPlay , "set to false"])
isPlaying = false
//netStreamObject.close();
}
}
this.onEnterFrame = function(){
if(isPlaying){
elapsedTime = getTimer() - lastTimeStamp
secondsDuration = ( playList[currentPlay].end - playList[currentPlay].start)
clipDuration =secondsDuration*1000.0
if(elapsedTime >=clipDuration){
endFrame = Math.ceil((playList[currentPlay].end)*30.0)
mc.gotoAndStop(endFrame);
playNextEvent();
}else{
tFrames = secondsDuration*30.0
startFrame = Math.ceil((playList[currentPlay].start)*30.0)
aframe = startFrame + Math.ceil(tFrames*(elapsedTime/clipDuration))
mc.gotoAndStop(aframe);
}
}else{
//go somewhere else
}
}
function startSimulation(){
currentPlay = -1;
//this will happen first
mc._visible = true;
playNextEvent()
}
moviesToLoad = ["test.swf"]
loadId = 0
this.onMouseDown = function(){
startSimulation()
}
function loadMovies(){
var loadListener:Object = new Object();
loadListener.onLoadComplete = function(target_mc:MovieClip, httpStatus:Number):Void {
loadId++
}
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(loadListener);
var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
mc._visible = false
mcLoader.loadClip("test.swf", mc);
}
'COURSE > COURSE_OUTPUT' 카테고리의 다른 글
flash - interface design (0) | 2008.03.04 |
---|---|
first_composition (0) | 2008.02.19 |
editing sample (0) | 2008.02.19 |