This commit is contained in:
Yury Delendik 2012-07-23 14:51:21 -05:00
Родитель 14df548c39
Коммит d9157da22e
3 изменённых файлов: 35 добавлений и 5 удалений

Просмотреть файл

@ -29,17 +29,37 @@
<div id="stage"></div>
<script src="../../lib/DataView.js/DataView.js"></script>
<script src="../../lib/Kanvas/kanvas.js"></script>
<!-- Load SWF Dependencies -->
<script src="../../src/swf/util.js"></script>
<script src="../../src/swf/swf.js"></script>
<script src="../../src/swf/prototypes.js"></script>
<script src="../../src/swf/embed.js"></script>
<script src="../../src/swf/renderer.js"></script>
<script src="../../src/swf/types.js"></script>
<script src="../../src/swf/structs.js"></script>
<script src="../../src/swf/tags.js"></script>
<script src="../../src/swf/inflate.js"></script>
<script src="../../src/swf/stream.js"></script>
<script src="../../src/swf/templates.js"></script>
<script src="../../src/swf/generator.js"></script>
<script src="../../src/swf/parser.js"></script>
<script src="../../src/swf/bitmap.js"></script>
<script src="../../src/swf/button.js"></script>
<script src="../../src/swf/font.js"></script>
<script src="../../src/swf/image.js"></script>
<script src="../../src/swf/label.js"></script>
<script src="../../src/swf/shape.js"></script>
<script src="../../src/swf/text.js"></script>
<script src="../../src/swf/prototypes.js"></script>
<!-- Load AVM1 Dependencies -->
<script src="../../src/avm1/classes.js"></script>
<script src="../../src/avm1/globals.js"></script>
<script src="../../src/avm1/stream.js"></script>
<script src="../../src/avm1/interpreter.js"></script>
<script src="../../src/swf/embed.js"></script>
<script src="../../src/swf/renderer.js"></script>
<script src="../../src/flash/util.js"></script>
<script src="../../src/flash/events/EventPhase.js"></script>

12
src/swf/prototypes.js поставляемый
Просмотреть файл

@ -157,6 +157,8 @@ function TimelineLoader(totalFrames, pframes, dictionary) {
if (pframe.initActionsData) {
for (var spriteId in pframe.initActionsData) {
if (!pframe.initActionsData.hasOwnProperty(spriteId))
continue;
instance.$createAS2Script(pframe.initActionsData[spriteId]).call(instance);
}
}
@ -197,6 +199,8 @@ function TimelineLoader(totalFrames, pframes, dictionary) {
}
var displayList = [];
for (var depth in frame) {
if (!+depth)
continue;
if (previousFrame && previousFrame[depth] === frame[depth]) {
displayList[depth] = previousDisplayList[depth];
continue;
@ -404,8 +408,10 @@ var MovieClipPrototype = function(obj, timelineLoader) {
enumerable: true
});
});
for (var child in children)
registerChild(child, children[child]);
for (var child in children) {
if (children.hasOwnProperty(child))
registerChild(child, children[child]);
}
var oldAddChild = proto.$addChild;
proto.$addChild = (function(name, child) {
oldAddChild.call(this, name, child);
@ -484,6 +490,8 @@ var MovieClipPrototype = function(obj, timelineLoader) {
var frame = timeline[currentFrame - 1];
var xMin = 0, yMin = 0, xMax = 0, yMax = 0;
for (var i in frame) {
if (!+i)
continue;
var character = frame[i].character;
var b = character.bounds || character.getBounds(this);
xMin = Math.min(xMin, b.xMin);

Просмотреть файл

@ -6,6 +6,8 @@ function render(displayList, renderingContext) {
var ctx = renderingContext.beginDrawing();
// displayList is array, so items are sorted by depth
for (var depth in displayList) {
if (!+depth)
continue;
var item = displayList[depth];
if (item) {
var character = item.character;