I have an XML document that I would like to use to display MovieClips in my .fla:
<linkedMovieClip>TestClip</linkedMovieClip>
In my .fla, I created the TestClip symbol and highlighted Linkage> Export for Actionscript and named it TestClip.
My code in my Document class is tracking xml:
var t:*= getDefinitionByName(String(slideItem.linkedMovieClip)) as Class;
var linked:MovieClip = new t();
trace("linked is..."+ linked);
However, when compiling, I get error message # 1065.
ReferenceError: Error
at global/flash.utils::getDefinitionByName()
I searched around and many recommended sites included the following import data:
import flash.utils.getDefinitionByName;
import TestClip;
And I included the following dummy variable:
public var _dummyClip:TestClip;
However, I still get the error message. When I check the debugger for this line:
var t:*= getDefinitionByName(String(slideItem.linkedMovieClip)) as Class;
Can anyone advise?
source
share