466 posts
  • Has been part of the Envato Community for over 5 years
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
+5 more
uiuxaesthetics says

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?

572 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $250,000+ on Envato Market
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
+6 more
radykal says

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.

111 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
savorks says
pack whole extend swf into a Class and
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 :S

466 posts
  • Has been part of the Envato Community for over 5 years
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
+5 more
uiuxaesthetics says

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.

572 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $250,000+ on Envato Market
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
+6 more
radykal says

Yes, how get each flash movie the path of the xml file?

111 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
savorks says
This will get Class from a loaded MovieClip which loaded by BulkLoader.
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 :)

466 posts
  • Has been part of the Envato Community for over 5 years
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
  • Had an item featured on Envato Market
+5 more
uiuxaesthetics says

@savorks wow! wasn’t expecting that. Perfect solution, thanks so much!

111 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $1,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
savorks says

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 :S, maybe there is some others way to do it.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by