ActionScript 2.0 :: Unload Movie On Root From Child?
Oct 5, 2011
I'm loading a movie in externally. The external movie has a button to unload itself from the main movie. It loads into _root.calContainer. The button is called xButton. This is the script that's not working:
I Have 3 Movies:MAIN.SWF, contains loading movie actions for Nav.swf and Home.swf.NAV.SWF, contains navagation menu loaded on Level 2 in Main HOME.SWF, contains slideshow for home page loaded on Level 1 in Main In NAV.SWF, there is a MOVIE CLIP "graphmc", which contains a BUTTON "graphicbtn", When this button is clicked, I'd like the HOME.SWF (which is loaded into Main.swf on Level 1) to fade out and unload, and load and fade in Graphics.SWF in place of it.
I am loading external swf's into a main load.swf, using a Moviecliploader object. What I basically want to do is that, after an external movie, say home.swf, loads another external swf, say about.swf, home.swf should be unloaded.
home.swf is loading about.swf into the _root.mc_holder, which is placed inside load.swf. I want all external files to be placed within this holder. Now this is working with some files, but not with others. My standard code within all files is this:
//code within home.swf to load about.swf var loader:MovieClipLoader = new MovieClipLoader();var ldrlistener = new Object();loader.addListener(ldrlistener);ldrlistener.onLoadStart =
I'm trying to add an element to the scene on the root level, and when it is dropped within a specific movie clip area, it takes that element and puts it in the movie clip, thus allowing me to mask out the area.
Everything works fine when I add can.addChild(myBox); directly, but the element is not viewable on the root scene, since the movie clip is masked. Right now with the code below, the result is gives me is not good. It creates the element on the root level, but doesn't allow me to put it in the movie clip.
Im trying to solve this, it should be quite simple but yet I can't get it to work! I have an index.swf that has a container which holds the entire flash site. I want to unload and load the various sections (different swf files) by clicking buttons thar are WITHIN THE CHILD.
I have a parent SWF into which I load a child SWF. I want to have a close button in the Child SWF (not the parent!) which closes/unloads it from the parent swf. Been looking all over but can't find any solutions that work.Here's my code for loading the child SWF from the parent's timeline:
var myrequest:URLRequest=new URLRequest("child.swf"); var myloader:Loader = new Loader(); myloader.load(myrequest);[code]...
What should I put in the child SWF to unload itself?
Experience: I'm a newbie to AS3 - making the transition from AS2. Problem: I have a parent SWF into which I load a child SWF. I want to have a close button in the Child SWF (not the parent!) which closes/unloads it from the parent swf. Been looking all over but can't find any solutions that work. Here's my code for loading the child SWF from the parent's timeline:
var myrequest:URLRequest=new URLRequest("child.swf"); var myloader:Loader = new Loader(); myloader.load(myrequest); myloader.contentLoaderInfo.addEventListener(Event. COMPLETE, movieLoaded); [Code]...
What should I put in the child SWF to unload itself? Apologies if this presumably simple task has been covered, please point me to the thread.
I have a stage w/ 6 buttons that call movie clips. works to remove them when the "next" button is clicked. Now I need to have an additional option of clicking outside the buttons "on the backround" to remove the movie clips also.
PHP Code: var fadeInstance:DisplayObject = null; function openFade(fade:MovieClip, y:Number):void{
I have one page in my Flash site that has photo thumbnails that load external swfs. The code works OK, but when I use
Code: removeChild(loader); in my button functions for other pages, I'm getting the output error:ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.at flash.display:isplayObjectContainer/removeChild() at the_fla::MainTimeline/homeClick() Is there a way to fix the error?
Parent swf has a button to load Child swf and Child swf has a button to unload itself through a dispatchEvent. Both in respective document classes. Parent loads Child fine... Child can't remove itself! Anyone have an idea what I am doing wrong here? Or another way to go about this? Struggling for a day now...
Parent swf:
public var myLoader:Loader; loadButton.addEventListener(MouseEvent.CLICK, loadSWF) public function loadSWF(e:MouseEvent):void {
How can I test if my AS3 code is executing from root or from a child mc that has been imported into a larger project via the loader class? Details:I've got a tutorial that is published both as a standalone projector (exe) and as an swf imported at runtime into a larger project. If the tutorial is running by itself as a standalone projector it needs to execute a few fscommands and perform some other housekeeping chores. If the tutorial is running as a child of the larger project these chores must be skipped. I canā't test Capabilities.playerType because the parent can also run as a standalone projector. It's simple, but here's what I had before I realized the parent might also be standalone:
In Flex 3.2 I had implemented a tooltip manager and I used the topLevelSystemManager from ISystemManager to add a child to the sandbox root: The code was as follows:
I got a variable "VideoFolder" well defined in my root level. However when I used this variable directly in child layers, my script does not recognize it and I get error 1120: Access of undefined property VideoFolder. I tried changing VideoFolder with _root.VideoFolder in all my child layers scripts, but it changes nothing.
i have navigation menu animated click it pops up from corner to center click its gone and gotoandplay('page2') is triggered. while page loads menu goes away. So my point is i want to show page title only after menu is gone (menu clip stopped playing) this works but menu is child MC i try put
I have a drop down box that is loading in different movies when selected. But when I select the second option in the drop down box, the movie gets loaded on top of the next movie. I saw that there is a removeChild(), but i'm having trouble finding where to apply it in the code below? If I put it in the function, it creates errors of course.[cod]e....
Using AS3. I have in my code a button to stop and remove the swf, but I would like to have in addition to unload a child swf when it plays it's last frame automatically - not using a button.
Here is my code on the main timeline: var loader:Loader; var closer:close; norton_btn.addEventListener(MouseEvent.CLICK, NortonDemo); function NortonDemo(e:MouseEvent):void { [Code] .....
Now, what do I need to add or change to this code and add to the code on the last frame of NortonDemo to accomplish what I want to do?
I don't know AS2 well, prefering 3.0, however the project should be in 2.0. So, I have 2 movieclips, one is parent, another - loaded through LoadMovie("name.swf", _root);I need to unload child after its played and stoped. How can I do it in most proper way?
I'm switching from as2 to as3 and everything was going swimmingly with my new site until i tried to use a _root call to a function on the main timeline by a loaded movieClip that is loaded nested into 2 other movieclips. the movieClip needs to tell the _root when it's done playing so the root knows to load the next one in line through a php call. Everything works except for the _root call. In as3 there's no such thing as root anymore so I figured no big deal, i'll just find out what the new thing is and holy crap wtf! I can't figure this out!! I've read from doing stuff like custom eventLisnters (which i am trying now) and casting the root as a movieClip and then I read this whole crazy tutorial on building an event structure and the proper MVC way of coding and blah blah blah ALL I WANT TO DO is tell the _root that the loaded MC has reached the end of its timeline. Basically if it were as2 i could just go _root.loadNext(); and it would work.how to make a loaded MC talk to the _root timeline and call a funciton from there?
I'm using a PreLoader as a parent SWF that loads the actual website as a child SWF. In the website SWF, the child SWF, will MovieClip(root) still work and refer to it's own root, or the PreLoader's root? And would I still access the websitite's document class (the child's document class), through MovieClip(root)? What if both files have a document class?So my main question is how do document classes and MovieClip(root) behave in the scenario when you have:
I have a flash page where I am loading another .swf into. With a button in the loaded swf I need to unload the loaded swf (where the button is) and navigate to a specific frame label in the parent .swf. I've tried to do the following in the key frame where the swf get loaded into I've put the following:
var gallery_load_wonderland:Loader = new Loader(); gallery_load_wonderland.contentLoaderInfo.addEventListener(ProgressEve nt.PROGRESS, loop_wonderland); gallery_load_wonderland.contentLoaderInfo.addEventListener(Event.COMPL ETE, done_wonderland); gallery_load_wonderland.load(new URLRequest("gallery_wonderland.swf")); function loop_wonderland(e:ProgressEvent):void { [Code] .....
I basically want to first load the swf called "gallery_wonderland.swf". Then in the "gallery_wonderland.swf" there's a button called "contact03_btn" which I want to unload "gallery_wonderland.swf" even though it's inside the swf and navigate to the frame label called "Contact" in the parent swf.
What can I do I've done similar before and it works, but when I do it know and I click the contact03_btn it comes with following error message: TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@26215ba1 to flash.display.MovieClip. at gallery_wonderland_fla::MainTimeline/back_wonderland()[gallery_wonder land_fla.MainTimeline::frame1:227]
If you haven't met me yet, that's because I'm pretty new around here. I picked up ActionScript just earlier this week, actually. Name's Kate. Nice to meet you. All righty. I'll start by saying that I've been referencing this thread:
actionscript.org/forums/showthread.php3?t=222486 (I'm not allowed to post URLs until I've got at least 50 posts in?! Gasp.)
i successfully managed to work out the loader script, and load a external swf file into my current project. Now that its working and all is well, i realised that only way to get back to 'main menu' was to close the whole thing. I tried to sort it out with a simple 'back' button but no success there. As mentioned in the title thats the options i found so far but cant seem to quite understand them tbh. I just want it to work so that I easily can manouvre back to 'main menu'.
I have an Movie Clip in Flash that have subobject of button type which has subobject of input text and movie clips. Right after creation core Moveclip all subobject are set to null, when I expect them to be valid objects.
[Code]...
MC_Core_design was created in Flash and exported to Actionscript. I've done this for button_1 class aswell. The code was written using Flex. When I comment out both lines that result in error I get correct view of the core Movie clip with all subobject. How can I set subobject properties right after object creation?
I am making a flipping page book in flash and have had to create sections in different movies because it kept crashing when i tried to have all the pages in the same movie. I have 3 movies 'page flip4', 'pageflip4-2', and 'page flip 4-3' . I have used the code below to go (flip bacwards) from 'page flip4-2' to the frame label ''backflip'' in 'page flip4'..This works fine
Code: on (press) { loadMovieNum("page flip4.swf", 1); }
i want to make an presentation,, for which.. at frame i click a button on frame 9 it goes to frame 10 and plays.. like my script on frame 10 is below
[Code]....
and when i click another button to go frame 1 from the same page at 10,, placed beside the loading external swf ,, it goes,, but the loaded external swf file is not going ,, or the external file not cleaning,, not removing.
I have a button ( 3 buttons ) and each button is assigned to Load a movie. When you click one of the buttons, the LoadMovie on Level 1 is good. Now here is my problem, how will I unload the current movie before Loading the next one. I want to UNLOAD the CURRENT MOVIE first before loading another MOVIE.