OSDN Git Service

Merge branch 'master' of git.sourceforge.jp:/gitroot/flapp/flapp
[flapp/flapp.git] / src / swf / tag.js
1 goog.provide('FlappSWFTag');
2 goog.require('FlappSWFTagShowFrame');
3 goog.require('FlappSWFTagDefineShape');
4 goog.require('FlappSWFTagDefineBitsJPEG');
5 goog.require('FlappSWFTagJPEGTables');
6 goog.require('FlappSWFTagSetBackgroundColor');
7 goog.require('FlappSWFTagDoAction');
8 goog.require('FlappSWFTagPlaceObject');
9
10 goog.scope(function() {
11
12 /**
13  * @constructor
14  */
15 FlappSWFTag = function() {
16      ;
17 };
18
19 // tag factory
20 FlappSWFTag.load = function(code, length, ibit) {
21 //      console.log("FlappSWFTag.load(code:"+code+", length:"+length+", ibit)");
22     var tag = null;
23     switch (code) {
24     case 1: // ShowFrame
25         tag = new FlappSWFTagShowFrame(code, length, ibit);
26         break;
27     case 2: // DefineShape
28     case 22: // DefineShape2
29     case 32: // DefineShape3
30         tag = new FlappSWFTagDefineShape(code, length, ibit);
31         break;
32     case 6: // DefineBits(JPEG)
33         tag = new FlappSWFTagDefineBitsJPEG(code, length, ibit);
34         break;
35     case 8: // JPEGTables
36         tag = new FlappSWFTagJPEGTables(code, length, ibit);
37         break;
38     case 9: // SetBackgroundColor
39         tag = new FlappSWFTagSetBackgroundColor(code, length, ibit);
40         break;
41     case 12: // DoAction
42         tag = new FlappSWFTagDoAction(code, length, ibit);
43         break;
44     case 26: // PlaceObject2
45         tag = new FlappSWFTagPlaceObject(code, length, ibit);
46         break;
47     }
48 //      console.debug(tag);
49     return tag;
50 };
51
52 });