What is  the object "Map" that you are referring to? It is not defined
anyplace in your example.



On 6/22/07, 张剑 <[EMAIL PROTECTED]> wrote:


hello,
  I have writed some code like this:
<canvas>
   <view id="cursor" x="721" y="11" height="21" width="21"
bgcolor="0x000000" opacity="0.6"
 onmousedown="dragger.apply()" onmouseup="dragger.remove()" clip="true">
 <view name="greenview" x="1" y="1" height="${parent.height-2}" width="${
parent.width-2}" bgcolor="0xffffff">
  <text x="2" y="${200-20}"  text="[54321]" fgcolor="0x000000"/>
 </view>
 <dragstate name="dragger" drag_axis="both"
                drag_min_x="0"
                drag_max_x="$once{parent.width - this.width}"
                drag_min_y="0"
                drag_max_y="$once{parent.height - this.height}"/>
 <state name="big" apply="false">
  <animatorgroup duration="500" process="simultaneous">
   <animator attribute="width" to="200"/>
          <animator attribute="height" to="200"/>
  </animatorgroup>
 </state>
 <state name="small" apply="true">
  <animatorgroup duration="500" process="simultaneous">
          <animator attribute="width" to="21"/>
          <animator attribute="height" to="21"/>
  </animatorgroup>
 </state>
 <method event="ony">
  <![CDATA[
  var yy=this.getAttribute('y');

  if (yy>Map.y+20)
  {
  cursor.small.remove();
  cursor.big.apply();
  this.greenview.setAttribute('bgcolor',0x70A0ff);
  }
  else
  {
  cursor.big.remove();
  cursorsmall.apply();
  this.greenview.setAttribute('bgcolor',0xffffff);
  }
  ]]>
 </method>
 <method event="onmouseup">
  <![CDATA[
  var yy=this.getAttribute('y');
  if (yy<Map.y+20) this.restore();
  ]]>
 </method>
 <method name="restore">
  this.animate("x", 721,500, false,{motion:'easeout'});
  this.animate("y", 11, 500, false,{motion:'easeout'});
  this.animate("width", 21, 500, false,{motion:'easeout'});
  this.animate("height", 21, 500,false,{motion:'easeout'});
 </method>
    </view>
</canvas>
but when compiled,the debug report that:
ERROR: test0.lzx:32: reference to undefined variable 'Map'
ERROR: test0.lzx:32: undefined object does not have a property 'y'
WARNING: test0.lzx:32: reference to undefined property 'y'
WARNING: test0.lzx:40: reference to undefined property 'big'
ERROR: test0.lzx:40: undefined object does not have a property 'remove'
WARNING: test0.lzx:41: reference to undefined property 'small'
ERROR: test0.lzx:41: undefined object does not have a property 'apply'
WARNING: test0.lzx:42: reference to undefined property 'greenview'
Why??I do not understand,can you help me and tell me why?






------------------------------
150 万 人 同 时 在 玩 的 网 游,你 不 试 试 吗 ? 
<http://event.mail.163.com/chanel/xyq.htm?from=163_NO1>




--
Henry Minsky
Software Architect
[EMAIL PROTECTED]

Reply via email to