我有两个轮子(精灵),每个轮子都有一个装载器,当旋转时会出现白色部分。加载器在 Sprite 内部居中,我试图让白色部分消失。
有任何想法吗?
任何指针,真的很感激它对actionscript 3来说还是相当新的。
//create the first wheel
backgroundURL = new URLRequest();
backgroundLoader = new Loader();
myWheelSprite = new Sprite();
backgroundURL.url = "images/wheelimage.jpg";
backgroundLoader.load(backgroundURL);
//Use contentLoaderInfo.addEventListener to find out the image width and height.
backgroundLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,backgroundLoaderimageFinishedLoading);
myWheelSprite.x = 60;
myWheelSprite.y = 60;
myWheelSprite.addEventListener(MouseEvent.CLICK, myMouseClickFunction);
trace("myWheelSprite X = "+myWheelSprite.x);
//create the second wheel
backgroundURL2 = new URLRequest();
backgroundLoader2 = new Loader();
myWheelSprite2 = new Sprite();
backgroundURL2.url = "images/wheelimage.jpg";
backgroundLoader2.load(backgroundURL);
//Use contentLoaderInfo.addEventListener to find out the image width and height. backgroundLoader2.contentLoaderInfo.addEventListener(Event.COMPLETE,backgroundLoader2imageFinishedLoading);
myWheelSprite2.x =480;
myWheelSprite2.y = 480;
trace("myWheelSprite2 X = "+myWheelSprite2.x);
//My code to rotate the image.
function myMouseClickFunction(event:MouseEvent) {
var myTimeline:TimelineMax = new TimelineMax({repeat:10});
myTimeline.append(TweenLite.to(myWheelSprite, 10, {rotation:360, ease:Linear.easeNone}));
}