Quantcast
Channel: Adobe Community : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 238792

Access display objects within a class defined in a swc file?

$
0
0

Is it possible to access display objects within a class defined in a swc file?

 

To replicate the problem:

 

Step 1. I have set up a very simple FLA, with an object defined in the library with the class AssetView:

 

package

{

    import flash.display.MovieClip;

 

    public class AssetView extends View

    {

        public var loader:MovieClip;

        public function AssetView()

        {

            super();

            trace("here it is : ",loader);

        }

    }

}

 

In this object is a MovieClip with instance name loader. If the object is on the stage when the file is exported you'll see the trace:

 

here it is :  [object MovieClip]

 

Step 2. I used Flash to publish a swc, called 'loader.swc'

 

Step 3. I created an actionscript project in Flash Builder,  and added 'loader.swc' to the ActionScript Build Path, Library Path, with Link Type: Merged into code.

 

Step 4. I instantiate 'AssetView':

 

var assetView:AssetView=new AssetView();

 

I see the trace:

 

here it is : null

 

--------

 

I've tried removing the AssetView class from the actionscript project in case it was getting priority over the class from the swc, but I still only see null traced for the MovieClip.

 

So, my question is, are display objects not accessible in the swc?


Viewing all articles
Browse latest Browse all 238792

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>