Starling Framework 프로젝트에서 Greensock LoaderMax를 사용하려고하지만 Starling에 많은 클래스가 있으므로 어떻게 다른 클래스와도 작동하게 할 수 있습니까? 네이티브 클래스를 사용하고 있습니까?Starling 프레임 워크를 기본 DisplayObject를 사용하는 클래스와 함께 사용
특급 :
package
{
import flash.display.Sprite;
import flash.events.Event;
import starling.core.Starling
[SWF(width="1280",height="800",frameRate="60",backgroundColor="#002143")]
public class Main extends Sprite
{
private var mStarling:Starling
public function Main():void
{
mStarling = new Starling(Game, stage)
mStarling.antiAliasing = 1
mStarling.start()
}
}
}
package
{
import com.greensock.events.LoaderEvent;
import com.greensock.loading.display.ContentDisplay;
import com.greensock.loading.SWFLoader;
import starling.display.Sprite;
import starling.events.Event;
public class Game extends Sprite
{
private var queue:SWFLoader
private var mm:ContentDisplay
public function Game():void
{
if (stage)
init()
else
this.addEventListener(Event.ADDED_TO_STAGE, init)
}
private function init(e:Event = null):void
{
queue = new SWFLoader("MainMenu.swf", {onComplete: completeHandler})
queue.load()
}
private function completeHandler(e:LoaderEvent):void
{
mm = queue.content
addChild(mm)
}
}
}
오류가 반환됩니다 그들이 다른 구조 등 때문에
Error: Implicit coercion of a value of type com.greensock.loading.display:ContentDisplay to an unrelated type starling.display:DisplayObject.