if (this.header === null) {
this.header = FlappSWFHeader.load(ibit);
this.flapp.header = this.header;
+ console.debug(this.header);
}
- headPos = ibit.getBytePos();
- if (ibit.hasNext(2) === false) {
- return ;
- }
- tal = ibit.ui16(); // tag and length
- code = tal >>> 6;
- length = tal & 0x3f;
- if (length === 0x3f) {
- if (ibit.hasNext(4) === false) {
+ while (ibit.a(), ibit.hasNext(2)) {
+ var headPos = ibit.getBytePos();
+ var tag_and_length = ibit.ui16(); // tag and length
+ var code = tag_and_length >>> 6;
+ var length = tag_and_length & 0x3f;
+ if (length === 0x3f) {
+ if (ibit.hasNext(4) === false) {
+ ibit.setPos(headPos);
+ break;
+ }
+ length = ibit.ui32();
+ }
+ if (ibit.hasNext(length) === false) {
ibit.setPos(headPos);
- return ;
+ break;
}
- length = ibit.ui32();
- }
- if (ibit.hasNext(length) === false) {
- ibit.setPos(headPos);
- return ;
+ var content = ibit.sub(length);
+ console.log("swf tag code:"+code+" length:"+length);
}
- console.log("swf tag code:"+code+" length:"+length);
}
};
global.FlappLoader = FlappLoader;