1
+ /*
2
+ Flod 4.1
3
+ 2012/04/30
4
+ Christian Corti
5
+ Neoart Costa Rica
6
+
7
+ Last Update: Flod 4.0 - 2012/03/10
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
10
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
11
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
12
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13
+
14
+ This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
15
+ To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to
16
+ Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
17
+
18
+ ---
19
+
20
+ This is a simple demo showing how to use a single player to play a module loaded from the client.
21
+
22
+ List of available players and include locations:
23
+
24
+ D1Player Delta Music 1.0 neoart.flod.deltamusic
25
+ D2Player Delta Music 2.0 neoart.flod.deltamusic
26
+ DMPlayer Digital Mugician neoart.flod.digitalmugician
27
+ F2Player FastTracker II XM neoart.flod.fasttracker
28
+ FEPlayer FredEd neoart.flod.fred
29
+ FCPlayer Future Composer neoart.flod.futurecomposer
30
+ JHPlayer Jochen Hippel neoart.flod.hippel
31
+ RHPlayer Rob Hubbard neoart.flod.hubbard
32
+ S1Player SidMON neoart.flod.sidmon
33
+ S2Player SidMON II neoart.flod.sidmon
34
+ FXPlayer SoundFX neoart.flod.soundfx
35
+ BPPlayer SoundMon neoart.flod.soundmon
36
+ HMPlayer His Master's NoiseTracker neoart.flod.trackers
37
+ MKPlayer NoiseTracker neoart.flod.trackers
38
+ PTPlayer ProTracker neoart.flod.trackers
39
+ STPlayer Ultimate Soundtracker neoart.flod.trackers
40
+ DWPlayer David Whittaker neoart.flod.whittaker
41
+ */
42
+ package {
43
+ import flash.display.* ;
44
+ import flash.events.* ;
45
+ import flash.net.* ;
46
+ import neoart.flod.core.* ;
47
+ import neoart.flod.fasttracker.* ;
48
+
49
+ public final class Demo2 extends Sprite {
50
+ private var
51
+ file : FileReference ,
52
+ player : F2Player;
53
+
54
+ public function Demo2 () {
55
+ player = new F2Player();
56
+
57
+ stage . addEventListener (MouseEvent . CLICK , function (e: MouseEvent ): void {
58
+ file = new FileReference ();
59
+ file . addEventListener (Event . CANCEL , cancelHandler);
60
+ file . addEventListener (Event . SELECT , selectHandler);
61
+ file . browse ();
62
+ });
63
+ }
64
+
65
+ private function cancelHandler (e :Event ):void {
66
+ file . removeEventListener (Event . CANCEL , cancelHandler);
67
+ file . removeEventListener (Event . SELECT , selectHandler);
68
+ }
69
+
70
+ private function selectHandler (e :Event ):void {
71
+ cancelHandler(e);
72
+ player. stop ();
73
+ file . addEventListener (Event . COMPLETE , completeHandler);
74
+ file . load ();
75
+ }
76
+
77
+ private function completeHandler (e :Event ):void {
78
+ file . removeEventListener (Event . COMPLETE , completeHandler);
79
+ player. load (file . data );
80
+ if (player. version ) player. play ();
81
+ }
82
+ }
83
+ }
0 commit comments