ActionScript 3.0 :: Unloading External SWF Files (RemoveChild)

Dec 25, 2010

I am able to successfully load two of the swf game files (Shooting.swf and Butterfly.swf). I will be playing this game swf in full screen mode. As in it will Occupy the entire area. I want this swf file to be unloaded upon clicking "homeShoot" which is in the library. Thus, when loading the swf files, at the same time I will addChild this button "homeShoot" from the library. So that when I press this "homeShoot" it will unload the swf file. But i am having problem with this part. The following is my code.

ActionScript Code:
var Xpos:Number = 0;
var Ypos:Number = 0;
var swf:MovieClip;
var loaderShoot:Loader = new Loader();
var loaderButterfly:Loader = new Loader();
[Code] .....

View 4 Replies


Similar Posts:


Flash :: Loading / Unloading External SWF Using Buttons From Loaded External Files

Feb 23, 2011

I spent almost a week trying to figure out how to unload a currently loaded swf using its button and loading a new swf... I have three files, a main.fla, file1.fla and file2.fla. In my main.fla, I have a code which loads the other two files. If i will click the "unload" button in the file1.swf, I would like the main.fla to unload the file1.swf and load the other file, file2.swf. Here is the code to load the file1.swf:

[Code]....

View 1 Replies

ActionScript 3.0 :: Loading / Unloading External SWF Files

Jun 19, 2009

From my main file I'm loading an external swf file. This file overlaps the original file so I began looking for a way to unload the original file. I've not been too successful. Right now, I've created a background layer which allows the loaded file to cover the original file without bleed through. I'd rather have the original file unload before the newly called file is loaded.

Here's the code I've found so far:
//Declare Variablesvar Xpos = 0;
var Ypos = 0;
var loader:Loader = new Loader();
var swfFileToLoad:URLRequest = new URLRequest("holdHumans.swf");
//Go to CreationremoveChild(loader);
loader.load(swfFileToLoad);
loader.x = Xpos;
loader.y = Ypos;addChild(loader);

This code is normally associated with a button event but I have to be able to use it from within a timer function in the original file. When the function is called, I get this message:
Error #2025: The supplied DisplayObject must be a child of the caller.
I get this message too when I try using it from the externally loaded swf file.

View 20 Replies

ActionScript 3.0 :: Unloading/loading External Swf Files?

Sep 13, 2011

I'm trying to create a pretty simple site using a couple of different external swfs loaded into a main swf.
 
At the moment, in the timeline, I have the following code in frame 1 on the actions layer:
 
import flash.events.MouseEvent;
stop(); 
navbutt.addEventListener(MouseEvent.CLICK, shownavbg);function shownavbg (myEvent:MouseEvent):void {    gotoAndPlay (10);}home_btn.addEventListener(MouseEvent.CLICK, showhome);function showhome (myEvent:MouseEvent):void {    gotoAndPlay

[code]....
 
At the moment, the Main.swf loads perfectly and works fine. But when I click the gallery button, it jumps to frame 76, and plays the Main.swf. It doesn't load the ZenGalleryDemo.swf file.....

View 1 Replies

ActionScript 3.0 :: Loading And Unloading External Swf Files

Jul 10, 2010

I am trying to load external swf files for each page of my website. I load the home right off the bat, then when I click on a different page, the content only loads on top of the previous loaded swf without getting rid of the previous page. I could be doing it wrong, but I use unload and removeChild before reloading the new page in the button function and it still stays on the stage.I could go back into my external swf files and add a white background underneath the content in order to mask out the swf that stays behind. But even if I do that it still would be loading multiple copies of each swf gradually slowing the whole site down.

View 1 Replies

ActionScript 3.0 :: Loading And Unloading External SWF Files?

Jul 14, 2010

So I posted a few days ago about having problems unloadins SWFs. Pretty much I load one for each page in my website into a content_mc. When you click back and forth between the pages, the previous page doesn't disappear, but just gets pushed behind the new page. I've tried unload and remove child and nothing happens. The goal would be able to unload the previous page and load the new page to replace the old one.

View 9 Replies

ActionScript 3.0 :: Use RemoveChild And RemoveEventlistener In External .as Files?

May 13, 2011

is it possible to use removeChild and removeEventlistener in external .as files? It rejects these functions in the main as file.

View 1 Replies

ActionScript 2.0 :: [Flash8] Loading / Unloading Movies / External Swf Files

Jun 29, 2009

wherever I look for scripts is either AS 1.0 or 3.0... I used to work as a cartoon animator (didn't need AS at all) now I'm trying to build up my own site to show my portfolio. I'm having difficulties loading and unloading external swf files. Basically I'm a total newbie, I managed to figure out that you need an empty movie clip where it will be played, and the buttons themselves...

View 8 Replies

ActionScript 3.0 :: Loading External SWF Files - Placing RemoveChild In Code

Apr 27, 2009

I've got a file that loads 4 external swf files. I've got everything correct as far as how it's listening for when each one is finished loading and then the next one knows to play. So I can get each one to play right after the other just fine. My problem is that they don't all have the same number of frames so in between the movies, there's a blip of a previous movie showing up (atleast I think it's due to varied movie length). I want to put in a removeChild function when it's listening for each movie to finish loading. But when I put in: removeChild(myLoader);, it says myLoader is undefined..

Code:
var a:Array = new Array("movie1.swf", "movie2.swf", "movie3.swf", "movie4.swf");
var iArray:Number = a.length; // number of movies
var iCount:Number = 0;
function manageMovies(){
loadMovie(a[0])
}
[Code] .....

View 1 Replies

ActionScript 3.0 :: Unloading Jpeg With Unload() Or RemoveChild()

Apr 30, 2010

I'm working on a project that is like a jigsaw puzzle.  The use can select from a few different puzzles that have different piece arrangements.  Once the puzzle swf file is loaded, the user can select images from a gallery to place in the pieces to make a custom puzzle where the puzzle piece movie clip that was selected masks the image that was selected.
 
So the puzzle swf loads fine and I add it to the stage with:
 
addChild(puzzle);
 
The jpegs also load and get masked correctly.  When I add the jpeg image, I add it to the puzzle object and the addChild looks like this:
 
puzzle.addChild(imageJPEGLoader);
imageJPEGLoader.load(new URLRequest(imageJPEGName));
imageJPEGLoader.x = 0;
imageJPEGLoader.y = 0;

[Code].....

I think I'm obviously not understanding the parent/child relationship fully.  I thought if imageJPEGLoader was inside puzzle, that the dot syntax would get me to the object I needed.  Everything works fine in this file except for putting a new jpeg on a piece that already had a jpeg masked.

View 1 Replies

ActionScript 3.0 :: Unloading A Loaded External SWF With A Close Button On The External SWF To Unload?

Aug 15, 2011

[URL]I have: main.swf (a menu) and I have module.swf (content)If you navigate to Subsea Wellhead Systems/SS-15 BigBore II and click on that I have it load an external swf which covers most of the parent. So far so good. My problem is unloading the loaded 'Child' swf with the button provided on the loaded 'Child' swf.below is the code I used to load the file but I cant, for the life of me, find a way to unload it. 
 
var bigboreLoader:Loader = new Loader();btnbb2.addEventListener(MouseEvent.MOUSE_UP, bigborecontent);
function bigborecontent(event:MouseEvent):void{var bigboreRequest:URLRequest = new URLRequest("moduletemplate.swf"); bigboreLoader.load(bigboreRequest); stage.addChild(bigboreLoader);
 
I am certain it requires the Child to communicate with the parent somehow but I am at a loss. If I could get a bit of advice or a link to something deal with this, it would be a big help. I just need to have my links load my modules and the remove them when the close buttong is hit on the loaded swf. I promise I have done searches and I admit I have found asnwers but still they are not working. I found the code below:
 
Main FLA: 
function removeF() {
removeChild(bigboreLoader);
}

[code]....

View 10 Replies

ActionScript 3.0 :: Loading In And External Swf And Unloading It From A MC Button Inside The External Swf?

Nov 2, 2010

I used to do this fine with AS2 and now i'm struggling to get it to work in AS3.my code is as follows:

PW1.addEventListener( MouseEvent.CLICK,loader1 );
//==================== PS function =============================================
var ldr:Loader = new Loader();

[code].....

View 3 Replies

ActionScript 2.0 :: Unloading XML Files / Data

May 2, 2008

I have a movie clip with 25 different frames on it. On each frame I have the usual XML loadin information pointing to different XML files on my computer. When I click one of the 25 content buttons I have told the movieclip to go to a particular frame to load a particular xml file. The problem is it won't unload the first XML file so keeps displaying that data over and over again.Does anyone know of any simple (only just getting to grips with AS) coding I can place on another button to unload the XML data?

View 2 Replies

ActionScript 3.0 :: Loading And Unloading .SWF Files?

Sep 10, 2009

I have created a site using the most basic amount of AS possible because i am new to it and am just finding my feet, i thought i might be able to get away with using just button links and slideshows but now my site is getting very big and is taking a while to load, i have added a preloader to the beginning of the site in a different scene.On my second frame i have a external .SWF file being loaded, it loads just fine but when i navigate away from the frame it is still there on every frame.

here is my code for the frame;

//////
var SlideshowURL:URLRequest = new URLRequest("Slideshow.swf");
var SlideshowLoader:Loader = new Loader();
SlideshowLoader.load(SlideshowURL);

[code]...

View 7 Replies

ActionScript 1/2 :: Unloading An External .swf Within Another External .swf

Sep 16, 2009

My main project loads an external .swf ("room") depending on which button the user clicks. Once that external .swf ("room") is loaded, the viewer chooses a ("demo") .swf to view. I need the "demo" .swf to unload once it is finished playing so that the viewer sees the 1st external .swfs menu again. All .swfs are loaded into an empty loader component. The "demo" swfs were created in captivate thus I don't have access to a timeline for them.[code]That all works fine, but when I load "room" .swfs into the main .swf, the unloadCaptivate(); no longer works.

View 1 Replies

ActionScript 3.0 :: Unloading External SWF?

Mar 12, 2009

I'm having a problem unloading an external SWF from my container clip. I've searched all morning for a fix to this problem, with no clear resolution. I thought this was originally a xml update issue, but it's not. A lot of talk about removing child nodes, but I'm not sure what do do there.Here's my code:

PHP Code:
function loadXML(loaded) { if (loaded) {  xmlNode = this.firstChild; swiff = [];  total = xmlNode.childNodes.length;  for (i=0;

[code].....

View 1 Replies

ActionScript 3.0 :: Unloading An External Swf From Itself?

Mar 8, 2010

I have a really simple problem regarding the unloading of swf's. I've searched for solutions but somehow I am having some difficulties understanding all the parent-child associations.So, I have main swf that has four buttons, each loading an external swf. The buttons are on the main timeline. The swf's that are loaded have a return button on their main timelines that would need to unload the current swf and thus return to my main swf.

View 1 Replies

ActionScript 3.0 :: Unloading The External SWF?

Jul 20, 2009

I have a simple file with 2 buttons (load + unload).By pressing the load button, an external movie_player SWF loads (this SWF loads a FLV video into it).The problem is that when I press unload, the movie_player dissapears from the main SWF, but I still can hear it. How can this problem be fixed?

ActionScript Code:
var urlRequest01:URLRequest = new URLRequest("movie_player.swf");
var external_swf01:Loader = new Loader();

[code]....

View 9 Replies

ActionScript 3.0 :: Unloading An External SWF?

Apr 6, 2011

I'm building a site that has 7 sections. 1 section is a Photo Gallery for which I'm loading an external SWF file that is controlled by an XML file. Im doing this for allowing content editing any time.

All of the other content on the site is one-time, no backend required.

I've successfully loaded the external swf file into a loader in one of the frames. However, when I navigate away to the other 6 sections, I'm unable to unload the external SWF loader. How do I go about this?

Here's my code that loads the external SWF in one frame:

ActionScript Code:
import flash.events.MouseEvent;
//This creates a new instance of the loader object.
var my_Loader:Loader = new Loader();

[Code]....

View 3 Replies

ActionScript 2.0 :: F8 Unloading An External Swf Once Loaded

Mar 31, 2009

I have a main movie menu which has sub movies loaded into levels 1 then section 2 into level 2. I have the subs loading on button but i cant get the subs to unload levels 1 and 2 once they have played.

View 7 Replies

Professional :: Loading And Unloading External SWF?

Apr 1, 2010

I'm trying to load an external swf and unload it after its completion. I have tried a few things and am stuck. Here is my current code to loading the swf, which seems to be working fine, its the unload I cant get:

import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;
import flash.events.ProgressEvent;
function startLoad() {
[Code] .....

View 3 Replies

ActionScript 3.0 :: Unloading The External Image?

May 27, 2010

import flash.display.Loader;
stage.focus = myTextBox;
myButton.addEventListener(MouseEvent.CLICK, findTarget);
function findTarget(evt:MouseEvent):void

[code]....
 
i wanted the loaded image to be removed if the outputBox.text shows ERROR, but i have tried removeChild and they don't work.

View 3 Replies

ActionScript 3.0 :: Transition_Manager And Unloading External Swf?

Jul 20, 2010

having a few problems with my project which i although it work it has some unpleasant bugs that When i load external ´s they show up on top of the Menu button.Maybe because the button i´m pressing is inside the same movieclip as the Menu Explaining better here´s a little diagram of my site:con2 MC (Instance of Menu) ---> cont3 MC (Instance of subMenu) and mainButton MC (Instance of Main)Here´s the general code which is inside the Painel
 
package   import com.greensock.TweenLite;  import com.greensock.TweenMax;  import com.greensock.*; import com.greensock.easing.*;  import flash.display.*;  import flash.events.* 

[code].....

View 2 Replies

ActionScript 3.0 :: Loading And Unloading External Swf?

Nov 29, 2010

I have a external swf that has an embedded video that loads automatically. Once it loads I have a button that unloads it and reloads. The first time I unload it, it works fine. The second time the video unloads but the sound continues? This happens each time I load and unload; the sound continues to loop.
 
stage.scaleMode = "noScale";
var loader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest("swfs1/ME_video1a1.swf");

[Code]....

View 4 Replies

ActionScript 3.0 :: Trouble Unloading External Swf's

Oct 3, 2011

In one particular keyframe, I have five buttons on the left hand side of my stage, that when clicked, display an external swf on the right handside. It works perfect fine using the code below. However on this frame where all this is going on, I also have a back button that i want to link back to the home page. But I just CAN'T seem to get it to unload the external swfs as well as go back in the timeline.[code]

View 8 Replies

ActionScript 3.0 :: Unloading External SWF Completely?

Oct 28, 2009

I have been able to unload the SWF (emptyMC.removeChildAt(0) ), or so I thought, but if there is sound playing in the loaded SWF it continues to play after the loader with the old SWF is unloaded. I know there is the unloadAndStop() method but I don't know how to incorporate it into my current code.Here is what I have so far. And mind you, eventually there will be 20 pages in the site, let me know:

ActionScript Code:
btnMENU.addEventListener(MouseEvent.CLICK,loadHome);
btnAPPT.addEventListener(MouseEvent.CLICK, loadAbtDoctor);

[code].......

View 2 Replies

ActionScript 2.0 :: Unloading 2nd Level External Swf?

Aug 18, 2011

i have a main swf...from the main swf, an external swf is loaded which is a SubMenu.From the Submenu, a SECOND external swf is loaded. I would like a button that closes the SECOND external swf, but the submenu remains.

View 3 Replies

Actionscript 3.0 :: Loading / Unloading External SWF's?

Nov 13, 2008

I am slowly learning AS3 but have hit a bit of a brick wall though I am sure it is something that many will see as easily resolvable, just my lack of knowledge and understanding of AS3 at this moment.

My query is I am trying to create a SWF which loads in (3) external SWF's using three movieclips I have within the main SWF. I have managed to get the external SWF's (1.swf, 2.swf, 3.swf) to load in when each of the movieclips / AS3 buttons have been clicked but I cannot figure out how to unload the current selected SWF file (e.g. have initially click on btnOne which displays 1.swf yet when click on btnThree to display 3.swf, 1.swf has not been removed from the stage and overlaps 3.swf) when I want to load another SWF file (sorry if this does not make sense). Below is the test code I have tried:

Code: Select all/////////////////////
///////Loaders///////
/////////////////////
//One

[code]....

My question is how do I unload (or removeChild I guess) the current SWF from the stage when I click on another movieclip / AS3 button to load another external SWF without the mish-mash as can be seen in the uploaded test files?

View 14 Replies

ActionScript 2.0 :: Loading/Unloading External SWF's

Aug 4, 2004

I am Using Flash MX ActionScript.

Anyways i have a series of buttons, and I would like them to each load a external SWF file into a movieclip. I have accomplished this so far but, I would like it so that whenever I click a button it unloads any already loaded SWF file that is already there. This is what I Have So far

on (release) {
loadMovie("movie.swf", this.movieholder);
}

View 3 Replies

ActionScript 2.0 :: Unloading An External File?

Jan 3, 2006

i'm using external SWFs that load into my "container" layer when a button is pressed. these external SWFs will have a "close" button in them, and i want them to "unload" when the button is pressed. this is the code i'm using to load the movie, which works fine:_root.container.loadMovie(_root.currMovie+".swf")but how does one go about "unloading" a movie? how can i change this line of code to achieve this?

View 10 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved