2011-07-14 24 views
0

我有一个我想与TweenLite的规模,但将 当transformaroundcenter插件我收到此错误信息的位图数据:在flash.display.BitmapData没有找到的getBounds问题TweenLite的

“属性的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}}); 

回答

1

BitmapData从Object继承,Bitmap继承自DisplayObject。按照Peter的建议从BitmapData创建一个新的Bitmap实例,或者尝试将TweenLite转换应用到tempScore对象,假设tempScore是一个DisplayObject。

6

来看,它看起来像库/插件期待一个DisplayObject,这BitmapData不是。尝试创建一个Bitmap来代替。 A Bitmap是代表BitmapDataDisplayObject

var bitmap:Bitmap = new Bitmap(tempScore.bitmapData); 
TweenLite.to(bitmap, 2, {transformAroundCenter: {scale:2}}); 
+0

很高兴能帮到你! :) – Peter

+0

那个人太早了。我的错。好消息是getBounds错误消失了,坏消息是它会抛出以下错误消息:“TypeError:Error#1009:Can not access a property or method of null object reference。 \t at com.greensock.plugins: :TransformAroundPointPlugin/onInitTween() \t在com.greensock.plugins :: TransformAroundCenterPlugin/onInitTween() \t在com.greensock :: TweenLite的/的init() \t在com.greensock :: TweenLite的/的渲染() \t在com.greensock :: SimpleTimeline/renderTime() \t at com.greensock :: TweenLite $/updateAll()“ – drpelz