How to write a program to show the external actionscript?



How to write a program to show the external actionscript?..

Answer / Rajesh Singh Rana

"To run an external ActionScript file, you need to load it using the Loader class. Here's an example:nnimport flash.display.Sprite;nimport flash.net.URLRequest;nimport flash.events.Event;nnclass Main extends Sprite {n private loader:Loader;nn public function Main() {n // Create a Loader instancen this.loader = new Loader();n // Configure the URL request for the external AS filen var request:URLRequest = new URLRequest("example.as");n // Attach event listenersn loader.load(request);n loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);n }nn private function onComplete(event:Event):void {n // Access the loaded SWF or AS filen var swf:MovieClip = MovieClip(loader.content);n // Add it to the display listn addChild(swf);n }n}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Flash Action Scripting Interview Questions

what methods are used to pass variables out of flash to a server side solution? : Adobe flash

1 Answers  


tell the difference between indexed array and associative array? : Adobe flash

1 Answers  


which of cannot be automatically outputted by the trace action? : Adobe flash

1 Answers  


what is generally considered the ideal group size for usability testing? : Adobe flash

1 Answers  


Give an example that illustrates polymorphism in flash script.

1 Answers  


what is the difference between document class and main time line class in action scirpt-3

1 Answers  


how does an xmlsocket server know when a received message is complete? : Adobe flash

1 Answers  


explain the flash vs. Animated images and java applets? : Adobe flash

1 Answers  


How many methods for depth are available?

1 Answers  


Do you know what is the difference between an array and vector?

1 Answers  


Difference between shared lib and shared objects

4 Answers  


at which point can you start usability testing? : Adobe flash

1 Answers  


Categories