|
|
AS3 Question
Hi Here is my problem:I have a file main.swf, which loads another file content1.swf. I want to control(create) symbols that are located in library of content1.swf from document class file of main.swf. Could it be done?In library of content1.swf I have a symbol MySymbol with linkage to a coresponding MySymbol.as file:public class MySymbol extends MovieClip{ public function MySymbol () {trace("MySymbol Created") }}Document class file for main.swf is Main.as :public class Main extends MovieClip{ public function Main () {var loader:Loader = new Loader(); configureListeners(loader.contentLoaderInfo); var request:URLRequest = new URLRequest("content1.swf"); loader.load(request); addChild(loader); } private function configureListeners(dispatcher:IEventDispatcher):void { dispatcher.addEventListener(Event.COMPLETE, completeHandler); } private function completeHandler(event:Event):void { var symbol:MySymbol = new MySymbol();addChild(symbol) }}When I execute the code I receive following resultReferenceError: Error #1065: Variable MySymbol is not defined.
Adobe > ActionScript 1 and 2
Posted on: 12/18/2006 02:23:41 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
|
|
|