Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e8f885a
Showing
6 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.fla | ||
audio_player.fla | ||
video_player.fla |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.kurbmedia{ | ||
|
||
import flash.display.MovieClip; | ||
import flash.display.Sprite; | ||
|
||
import com.kurbmedia.events.AudioEvent; | ||
import com.kurbmedia.configs.AudioConfig; | ||
|
||
public class AudioPlayer extends MovieClip{ | ||
|
||
private var player_base:Sprite; | ||
public var player_data:Object; | ||
|
||
private var _config:AudioConfig; | ||
|
||
public function AudioPlayer(){ | ||
|
||
_config = new AudioConfig(stage, MovieClip(root)); | ||
addEventListener(AudioEvent.RENDER_COMPLETE, _config.render_complete); | ||
|
||
player_data = { | ||
'backgroundColor':0xFFFFFF, | ||
'autoPlay':true, | ||
'borderRadius':'10', | ||
'file':undefined | ||
}; | ||
|
||
if(root.loaderInfo.parameters.configure != undefined){ | ||
for(var i in root.loaderInfo.parameters.configure) player_data[i] = root.loaderInfo.parameters.configure[i]; | ||
} | ||
|
||
player_base = new Sprite(); | ||
player_base.x = player_base.y = 0; | ||
|
||
if(player_data.strokeColor != undefined) player_base.graphics.lineStyle(1, uint(player_data.strokeColor)); | ||
player_base.graphics.beginFill(uint(player_data.backgroundColor)); | ||
|
||
if(player_data.borderRadius != undefined){ | ||
player_base.graphics.drawRoundRect(0,0, stage.stageWidth, stage.stageHeight, player_data.borderRadius); | ||
}else{ | ||
player_base.graphics.drawRect(0,0, stage.stageWidth, stage.stageHeight); | ||
} | ||
|
||
player_base.graphics.endFill(); | ||
addChild(player_base); | ||
|
||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package com.kurbmedia.configs{ | ||
|
||
import com.kurbmedia.events.AudioEvent; | ||
|
||
public class AudioConfig{ | ||
|
||
private var __stage; | ||
private var __root; | ||
|
||
// You shouldn't need to change this function. This provides a way to access both the stage | ||
// and the root of the movie. | ||
|
||
public function AudioConfig(stage_instance, root_instance){ | ||
__stage = stage_instance; | ||
__root = root_instance; | ||
} | ||
|
||
// This function is called when the stage is finished drawing all elements based on the passed configuration. | ||
|
||
public function render_complete(e:AudioEvent){ | ||
|
||
} | ||
|
||
// This function is called when the audio initially starts playing, or any time audio | ||
// starts or is re-started from the beginning. | ||
|
||
public function audio_start(e:AudioEvent){ | ||
|
||
} | ||
|
||
// This function is called any time the audio is paused. | ||
|
||
public function audio_paused(e:AudioEvent){ | ||
|
||
} | ||
|
||
// This function is called any time the audio is un-paused. | ||
|
||
public function audio_unpaused(e:AudioEvent){ | ||
|
||
} | ||
|
||
// This function is called any time the audio is explicitly stopped (not paused). | ||
|
||
public function audio_stopped(e:AudioEvent){ | ||
|
||
} | ||
|
||
// This function is called any time the audio is muted. | ||
|
||
public function audio_mute(e:AudioEvent){ | ||
|
||
} | ||
|
||
// This function is called any time the audio is un-muted. | ||
|
||
public function audio_unmute(e:AudioEvent){ | ||
|
||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.kurbmedia.events{ | ||
|
||
import com.kurbmedia.events.PlayerEvent; | ||
|
||
public class AudioEvent extends PlayerEvent{ | ||
|
||
public function AudioEvent(val:String, obj = null){ | ||
object = obj; | ||
super(val, true, false); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.kurbmedia.events{ | ||
|
||
import flash.events.Event; | ||
|
||
public class PlayerEvent extends Event{ | ||
|
||
public static const RENDER_COMPLETE:String = "PlayerEvent.RENDER_COMPLETE"; | ||
|
||
public var object:*; | ||
|
||
public function PlannerEvent(val:String, obj = null){ | ||
object = obj; | ||
super(val, true, false); | ||
} | ||
} | ||
|
||
} |