Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to embed an actionscript code library into a swf and access in another swf? (bootstrap)

New Here ,
Jul 25, 2014 Jul 25, 2014

Basically I want to have the library function of a swc, but the remote loading feature of a swf.

I have a code library which I'm embeding into a swf. All classes and methods no graphical or text elements. After the code is embedded into a swf, I'd like to remotely access this swf from another swf. So swf A contains the classes and it is loaded into swf B is just a shell and uses the methods/classes from swf A as if they were at the root of B.

TOPICS
ActionScript
282
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 26, 2014 Jul 26, 2014
LATEST

here's one way to load a swf that contains a class that shows how to instantiate that class:

var l:Loader = new Loader();

var s:String = "C";

load1("test.swf");

function load1(urlS:String) {

    l.contentLoaderInfo.addEventListener(Event.COMPLETE, f);

    l.load(new URLRequest(urlS), new LoaderContext(false, ApplicationDomain.currentDomain));

}

function f(event:Event):void{

    var c:Class = Class(getDefinitionByName(s));

    var instance:* = new C();

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines