![]() But you will have to swallow the fact that AS3 has been developed as an improvement over AS2. How'd I go about doing that.ĪS2 & AS3 is vastly different. Previously, we'd use _root.functionName() to do stuff like play some animation transitioning from the current externally loaded "section" to another section. How to communicate from inside the loaded content, to the main/loader file. How do I "re-parent" loaded content, so I can place it inside some movieclip/sprite on the main timeline of the loader file, rather than using some really long convoluted way. because then I'd only be able to address the loaded content inside the Loader's plete event handler. How do I communicate from the main "loader" SWF file, with the content that's loaded in. I thought re-parenting the loaded content into the sprite would allow me to access the loaded content as easily as loadMovie() used to be - accessing loaded content like it was present directly inside the clip it was loaded in. And when I call that function inside the onLoaded event-handler using ".boxesPrompt()", it shows that the Boxes object(which was on the main timeline of External.SWF), has a parent movieclip, a grand-parent sprite, and a great grand-parent object mainTimeline. The boxesPrompt() function inside the "ExternalContent.swf" just traces it's parent, grand-parent, and great grand-parent - trace(). But when I comment out () and use this, it works: Scene 1, Layer 'Layer 1', Frame 1, Line 21 1119: Access of possibly undefined property boxes through a reference with static type flash.display:Sprite. Flash gives the following compiler error at the above Loader.load(new URLRequest("ExternalContent.swf")) boxes has a boxesPrompt() function in it's timeline. ExternalContent has a movieclip called "boxes" on it's main timeline Loading in ExternalContent.swf into the sprite Doing this in AS3 seems bizarre and neurotic, and I feel like I'm missing something fairly basic here. And inside the "ExternalContent.swf", we could use _root.function() to access functions in the main file ExternalContent was being loaded into. You could access functions on the "External.swf" main timeline using someMovieClip.function(). ![]() In AS2, we could use someMovieClip.loadMovie("ExternalContent.swf") and the ExternalContent file would load inside someMovieClip. In AS3, I've used the Loader class to load and display the external file, my main problem is in communicating with the loaded content, call it's functions, or call root functions from it. ![]() In the main file, we'd have masks animating the container movieclip(in which external sections/SWF files were loaded) and have animations and transitions play as the section finished loading and the loaded content was displayed. Since Flash 4/5, it was common to have one main SWF file in a Flash web project, and then load other SWF files into it, often for various "sections" of a website or web project. I'm new to AS3, and am trying to understand how externally loaded SWFs work in AS3.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |