Hey guys, I’ve been using bulkloader for a while now and love it, Im probably gonna switch over to the new GS one soon but not today. Anyone know how to load multiple instances of the same swf on a page. I have a swf that is heavily XML editable and want to show multiple occurrences of the same swf on a page. Anyone done this before?
- Author was Featured
- Bought between 10 and 49 items
- Contributed a Blog Post
- Exclusive Author
- Germany
- Has been a member for 3-4 years
- Item was Featured
- Referred between 100 and 199 users
Yes, change!!
But you can do something like that. Create multiple add methods for the bulkloader instance with different keys:
//load all assets
var bulkLoader:BulkLoader = new BulkLoader();
bulkLoader.add("mainSwf.swf", {id:"swf1"});
bulkLoader.add("mainSwf.swf", {id:"swf2"});
bulkLoader.add("mainSwf.swf", {id:"swf3"});
bulkLoader.addEventListener(BulkProgressEvent.COMPLETE, assetsLoaded);
bulkLoader.start();
function assetsLoaded(evt:BulkProgressEvent):void
{
//save each swf in a separate variable
var swf1:Movieclip = bulkLoader.getMovieClip("swf1");
var swf2:Movieclip = bulkLoader.getMovieClip("swf2");
var swf3:Movieclip = bulkLoader.getMovieClip("swf3");
}
I think this should work, but no guarantee. I dont test it. Let me know.
loaderInfo.applicationDomain.getDefinition(className);
?
or maybe create multiple LoadingItem load same url but assign different id ( working like create multiple Loader load same URL , their content will be different instance ), but I think this will waste lots memory compare to the extract Class method.
EDIT . Oops one minute slower 
Thanks guys!
@radykal that works and may be the solution I will use, only drawback is when I trace(event.bytesTotalCurrent); It actually loads the same swf twice instead of realizing its already been loaded
@savorks have no idea how to use the extract Class method, but that definitely is best way to do it for efficiency.
- Author was Featured
- Bought between 10 and 49 items
- Contributed a Blog Post
- Exclusive Author
- Germany
- Has been a member for 3-4 years
- Item was Featured
- Referred between 100 and 199 users
Yes, how get each flash movie the path of the xml file?
var fileId:String = 'ExtendSwfFileId';
var className:String = 'ClassNameInExtendSwf';
var movieClip:MovieClip = bulkLoader.getMovieClip(fileId);
try
{
var AClass:Class = Class(movieClip.loaderInfo.applicationDomain.getDefinition(className));
}
catch (er:Error)
{
throw new Error('Can not find definition ' + className + ' from asset (id = ' + id + ' ).');
}
var newInstance:* = new AClass();
Hope it helps 
@savorks wow! wasn’t expecting that. Perfect solution, thanks so much!
No problem mate 
And for additional trick, if extend SWF have document class(in Flash IDE , just provide document class name, .as file isn’t necessary), you can use that class name for getting whole SWF ’s class definition.
I was hoping we can use “MainTimeline” (default constructor name of main timeline) for getting definition through a swf which doesn’t have document class, but can’t
, maybe there is some others way to do it.
