CyanBlue
asked on
Shared Library question in AS3/CS3...
Hm... I don't seem to be able to get this Shared Library in AS3/CS3... :(
I have SharedLibrary.fla file where I have a movieClip linked as Square for the class, flash.display.MovieClip, and Export for ActionScript and Export in first frame are checked...
I have SharedLibraryMain.fla file where I have the following script...
var loader:Loader = new Loader();
var request:URLRequest = new URLRequest("SharedLibrary. swf");
loader.contentLoaderInfo.a ddEventLis tener('com plete', completeHandler);
loader.load(request);
function completeHandler(e):void
{
var square:Class = getDefinitionByName("Squar e") as Class;
addChild(square);
}
But that gives me this '1067: Implicit coercion of a value of type Class to an unrelated type flash.display:DisplayObjec t.' error message... I can use that method to use the image or font just fine, but I am not able to use a movieClip... What am I missing here???
Thanks... :)
I have SharedLibrary.fla file where I have a movieClip linked as Square for the class, flash.display.MovieClip, and Export for ActionScript and Export in first frame are checked...
I have SharedLibraryMain.fla file where I have the following script...
var loader:Loader = new Loader();
var request:URLRequest = new URLRequest("SharedLibrary.
loader.contentLoaderInfo.a
loader.load(request);
function completeHandler(e):void
{
var square:Class = getDefinitionByName("Squar
addChild(square);
}
But that gives me this '1067: Implicit coercion of a value of type Class to an unrelated type flash.display:DisplayObjec
Thanks... :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have solved the problem and posted the solution here if anybody is interested... ;)
http://www.actionscript.org/forums/showthread.php3?t=188687
http://www.actionscript.org/forums/showthread.php3?t=188687
good to know, thanks
ASKER
Love to hear more if you'd like to chime in... ;)
CyanBlue
CyanBlue
i'm clueless about shared libraries. never tried it never had a need to, should learn to.
i actually pointed some other people to your post thinking that might resolve the problem. but i'm joining the I hate AS3 club.
i actually pointed some other people to your post thinking that might resolve the problem. but i'm joining the I hate AS3 club.
ASKER
That's cool... Thanks for that... ;)
Hm... How about I-Hate-ActionScript club??? :p
Yeah... I've been learninging alot on AS3 for some months now and I also have mixed feelings...
CyanBlue
Hm... How about I-Hate-ActionScript club??? :p
Yeah... I've been learninging alot on AS3 for some months now and I also have mixed feelings...
CyanBlue
ASKER
Well... There's gotta be multiple movieClips, Square and Circle for example, in the library of the SharedLibrary.swf file, and I'd like to specify them as needed... Maybe this sample file will make it simple for you to understand the problem... (Don't forget to remove the TXT extensions...)
Thanks... ;)
CyanBlue
SharedLibrary.fla.txt
SharedLibraryMain.fla.txt