[Sie-announce] SIEコード [1239]

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 9月 12日 (土) 21:17:25 JST


Revision: 1239
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=1239
Author:   dhrname
Date:     2009-09-12 21:17:25 +0900 (Sat, 12 Sep 2009)

Log Message:
-----------


Modified Paths:
--------------
    branches/05x/051/sie.js

Modified: branches/05x/051/sie.js
===================================================================
--- branches/05x/051/sie.js	2009-09-11 12:09:09 UTC (rev 1238)
+++ branches/05x/051/sie.js	2009-09-12 12:17:25 UTC (rev 1239)
@@ -279,7 +279,7 @@
         } else if (te.nodeName === "image") {
           s = new STImage(te, matrix, w, h);
         } else if (te.nodeName === "set") {
-          s = new STSetElement(te, matrix);
+          s = new STSetElement(te, matrix, w, h);
         }
         if (s) {
           this.children[this.children.length] = s;
@@ -1829,35 +1829,37 @@
 }
 
 //SMIL言語のset要素を参照
-function STSetElement( /*element*/ ele, /*Matrix*/ matrix) {
+function STSetElement( /*element*/ ele, /*Matrix*/ matrix, w, h) {
   this.tar = ele;
   var begin = new Date(), end = new Date();
   begin.synchParser(ele.getAttribute("begin"));
   end.synchParser(ele.getAttribute("end"));
   begin.indefinite = false;
   end.indefinite = false;
+  this.to = ele.getAttribute("to");
+  this.attrName = ele.getAttribute("attributeName")
   this.transformable = matrix;
   this.beginEvent = begin; this.endEvent = end;
   this.currentTime = 0;
+  this.width = w; this.height = h;
   return this;
 }
 //timeLineはアニメーションのタイムラインとして、フレームを再生する際に使用
 NAIBU.timeLine = [];
 STSetElement.prototype.set = function() {
   try{
-  var tb = null;
   if (this.beginEvent.event !== "") {
-    tb = this.beginEvent;
+    var tb = this.beginEvent;
     tb.indefinite = true; //これにより、イベントが起きるまで作動を待たせる
     this.tar.parentNode.attachEvent("on" +tb.event,(function(){
       tb.indefinite = false;
     }));
   }
   if (this.endEvent.event !== "") {
-    tb = this.endEvent;
-    tb.indefinite = true;
-    this.tar.parentNode.attachEvent("on" +tb.event,(function(){
-      tb.indefinite = false;
+    var te = this.endEvent;
+    te.indefinite = true;
+    this.tar.parentNode.attachEvent("on" +te.event,(function(){
+      te.indefinite = false;
     }));
   }
   NAIBU.timeLine[NAIBU.timeLine.length] = this;
@@ -1865,10 +1867,16 @@
 }
 STSetElement.prototype.frame = function() {
   if (this.beginEvent.isFired(this.currentTime) && !this.endEvent.isFired(this.currentTime)) {
-    alert(this.beginEvent.event);
+    this.tar.parentNode.setAttribute(this.attrName, this.to);
+    this.children = [];
+    this.chset(this.tar.parentNode,this.transformable, this.width, this.height);
+  } else if(this.endEvent.isFired(this.currentTime)){
+    this.beginEvent.indefinite = true;
+    this.endEvent.indefinite = true;
   }
   this.currentTime += 100;
 }
+STSetElement.prototype.chset = SVGtoVML.prototype.chset;
 
 //setClockValueメソッド。同期させるSMIL言語に使う
 Date.prototype.setClockValue = function(str) {




Sie-announce メーリングリストの案内
Back to archive index