Jump to content
GreenSock

elmundo

Members
  • Posts

    2
  • Joined

  • Last visited

elmundo's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. i was using PBE's resourcemanager to get resource but when i tried to use bulk loader of PBE, there was some problems. Then i decided to use LoaderMax for bulk loading. In my swf files, i use IsoClip -that i've written - which is extended MovieClip. Like this: // // C:\Users\omer\Desktop\_dev\restaurant\assets\swf\animals.swf\cat_1 // package { import display.IsoClip; public class cat_1 extends IsoClip { public function cat_1(); } } When all swf file is loaded, i get them into my dictionary type object "_resources". Then i use this _resource to get my assets from swf files. Following code shows how i'm implementing this: private function completeHandler(e:LoaderEvent):void { Logger.debug(this, "completeHandler", "Resource loading has been completed!"); for each (var resourceInfo:ResourceFileInfo in _resourceInfoList) { _resources[resourceInfo.name] = LoaderMax.getLoader(resourceInfo.file); } } public function getIsoClip(isoClipname:String, resourceName:String):IsoClip { var sefLoader:SWFLoader = _resources["Animals"] as swfLoader; var tempClass:Class = swfLoader.getClass("cat_1"); var isoClip:IsoClip = IsoClip(new tempClass()); //Gettin error here! return isoClip; } After getting swf files into array, i use getIsoClip method to get isoClip asset but it gives: Error #1034 Type Coercion failed cannot convert floor_cat_01@ae76df9 to display.IsoClip. If i use default type (like MovieClip, Sprite, Sound ect..) there is no problem. But if i use a class that is written by me, i got this kind of errors.. i hope i could explain clearly this time. Thanks for help!
  2. Hi everyone! I'm trying to use LoaderMax class to load multiple SWF files. The problem is when all the swf files is loaded, (i hold them in an array), they all MovieClip type.. I use the SWF file as a graphic library so i need to get my assets from swf using SWFResource's method. Before LoaderMax, i was using pushbutton engine resource loader and SWFResource class to get asset from a swf. First, l was loading the resources, then getting to my SWFResource object Like this: //load the resources... var swfRes:SWFResource = getSWFResource(resourceName); var sprite:Sprite = swfRes.getExportedAsset(spriteName) as Sprite; i need a similar way: public function load():void { LoaderMax.activate([sWFLoader]); var url:Array = ["Doors.swf", "Animals.swf", "Xyz.swf"]; _queue = LoaderMax.parse(_url, { maxConnections:1, onProgress:progressHandler, onComplete:completeHandler, onChildComplete:childCompleteHandler }); _queue.load(); } private function completeHandler(e:LoaderEvent):void { trace("completeHandler"); for each (var resourceInfo:ResourceFileInfo in _resourceInfoList) { _resources[resourceInfo.name] = LoaderMax.getContent(resourceInfo.file).rawContent; } //..and somehow i need to cast it SWFResource class var swfRes:SWFResource = _resources["Animals"] as SWFResource; var sprite:Sprite = swfRes.getExportedAsset("Cat_1") as Sprite }
×