0 Replies Latest reply: Jan 7, 2013 5:31 AM by Jean Demonceau RSS

    How to instanciate and use the instance of a symbol with JSFL

    Jean Demonceau Community Member

      Hi,

      I'm a noobie with Flash Pro / JSFL.

      I'm looking for a way to instanciate UILoader and use them with JSFL.

       

      I tried to create an empty FLA that contain a UILoader symbol in its library.

      With JSFL I open it and add it to the stage.

      It works, I have a UILoader instance at 200;200 but I cannot do anything with it. How can I set a size, a new position, a source... ?

       

      fl.openDocument("file:///C|/uiloader.fla");

      var loaderIndex = fl.getDocumentDOM().library.findItemIndex("UILoader");

      if (loaderIndex != "")

      {

                var loader = fl.getDocumentDOM().library.items[loaderIndex];

                fl.documents[0].addItem({x:200,y:200}, loader);

      }

       

      I would like to create with JSFL a SWF that contain a UILoader placed somewhere with a specific size and specific source. And to inject in the swf some ActionScript to find this added UILoader to dynamically change the source of the image. This source will be finally given from the url. http://myswf.swf?imageSource=xxxxxx.jpg

       

      Is it possible ?

       

      Thank you.