tweenlite的getbounds问题

drp*_*elz 0 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}});
Run Code Online (Sandbox Code Playgroud)

Pet*_*ter 6

从异常来看,它看起来像库/插件期待a DisplayObject,而BitmapData不是.尝试创建一个Bitmap传递来代替.阿Bitmap是一个DisplayObject代表BitmapData.

var bitmap:Bitmap = new Bitmap(tempScore.bitmapData);
TweenLite.to(bitmap, 2, {transformAroundCenter: {scale:2}});
Run Code Online (Sandbox Code Playgroud)