tweenlite的getbounds问题

时间:2011-07-14 01:43:37

标签: actionscript-3

我有一个bitmapData,我想用TweenLite进行缩放但是在应用时 transformaroundcenter插件我收到此错误消息:

“在flash.display.BitmapData上找不到属性getBounds,并且没有默认值。”

我必须在哪里放置“激活”行(例如进入构造函数,其他函数等)?

有人可以帮忙吗?感谢。

import com.greensock.*;
import com.greensock.TweenLite;
import com.greensock.plugins.TweenPlugin;
import com.greensock.plugins.TransformAroundCenterPlugin;
TweenPlugin.activate([TransformAroundCenterPlugin]);

TweenLite.to(tempScore.bitmapData, 2, {transformAroundCenter: {scale:2}});

2 个答案:

答案 0 :(得分:6)

根据异常判断,看起来库/插件期待DisplayObjectBitmapData不是。尝试创建Bitmap来代替。 Bitmap是代表DisplayObject的{​​{1}}。

BitmapData

答案 1 :(得分:1)

BitmapData继承自Object,Bitmap继承自DisplayObject。如Peter建议的那样,从BitmapData创建一个新的Bitmap实例,或者尝试将TweenLite变换应用于tempScore对象,假设tempScore是一个DisplayObject。