ActionScript 3.0 :: SWF Unload Itself And Load A New One From Button Within External SWF?
Mar 15, 2011SWF Unload itself and load a new one from button within External SWF?
View 1 RepliesSWF Unload itself and load a new one from button within External SWF?
View 1 RepliesI am an uber n00b to flash AS3. And it is not my intention to sound like a complete moron, but honestly, I have had a hard enough time figuring out just how to load an external .swf into my main file! add a button within the external .swf which will unload itself and load a new on in its place.
View 1 RepliesI have a main swf (call it Main1). Main1 calls an external swf (call it swf1). Swf1 loads on top of Main1 like it should. Swf1 has a button that calls another swf on top of Main1(call this Swf2). Well the problem is, the button on Swf1 calls Swf2 on top of itself, instead of removing Swf1 first. I cannot figure this out for s*** how to make this work. How can I unloading Swf1 from the loader, and at the same time load Swf2 into the loader from a single button residing on Swf1? My code is below.
Main1 has a button (click_btn) that loads Swf1 (click_btn is in a Movie Clip, not on main timeline)
ActionScript Code:
stop();
click_btn.addEventListener(MouseEvent.MOUSE_DOWN, loadMC)
function loadMC(ev:MouseEvent){
[Code].....
How can I incorporate something like the close button (closer) into done_click to close Swf1 when I call Swf2 from this button (done_click)
How can I use one Button to load and unload a sequence of external swfs, Like a Next Button and Previous Button?
View 1 RepliesHow can I use one Button to load and unload a sequence of external swfs, Like a Next Button and Previous Button?
View 5 RepliesI'm trying to unload an external SWF on _root to load a new one instead. I've tried (almost) everything but can't figure it out... I get this error : "Error #1010: A term is undefined and has no properties."
[Code]....
I am working on a school project that requires me to load external .swf or .jpg files. I currently have all of the buttons working and are loading an external .swf file on to the screen. The problem I am having is that when I go from one button to the next the loaded .swf stays on the screen and the next .swf gets loaded on top of it. I know that I need to unload the file but I am not sure where to put the code for the unload or what code exactly to use. I would like when the button is pressed to unload the previous loaded .swf and load the new .swf without having a separate button to unload.
[Code]...
I have a Flex application that just load an external SWF, but the application load and unload infinitely my swf.
[Code]...
[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]....
I'm sure this question has been answered but I have been looking everywhere and all I can find is how to load an external SWF but not how to unload it. I come from a basic knowledge of AS2 and it was easy for me to load using levels but I have run into a wall. I have a main swf and to keep the initial filesize small I would like to split some image intensive sections out and load them when needed.
View 6 RepliesI'm creating my portfolio in Flash CS3. I have five buttons in website.swf. I also have five external swf files.If you click a button, it loads an external swf. If you click another button, it unloads the first swf and loads the next one. Is there anyway to unload it and load the next?
stop();
function loadMain(e:MouseEvent):void{
var loadMain:Loader = new Loader();
[code]....
I have this simple code to play and stop external swf[code]...
View 6 RepliesOK this should be the last of the coding to complete my AS2 to AS3 conversion of a site. The AS2 site had an external photogallery .swf that loaded from a navigation button on the main timeline. It used the loadMovie function so it loaded a photogallery on top of the main .swf in level one.
I also had unloadMovie,1 in all the navigation buttons so if a user was in the gallery and they clicked anywhere else in the main .swf which is all in level 0 the gallery in level 1 would be deleted.
In this situation the gallery that will be loaded on top of the main.swf needs to be a little smaller than the main ,swf so the navigation on the top of the main shows through. If the main.swf is 900 x 600 I would need to load the photogallery on top which would be 900 x 450 and need to use x and y coordinates so when the swf loads it loads in the right spot.
I have a Flash project where I need to load and unload external SWF' files. I have it working, but it seems that after the second time it attempts to unload and load, it has strange results. have 4 SWF's. The Main.swf and the other external 3 that will need to load. n the main SWF I have create the loader this this code:
[Code].....
This seems to work and load the other two SWF's the second one (M-2_WIB.swf) works fine. It successfully unloads the first SWF, and loads the second. But when it get's to the third, it chokes. It does successfully load that third swf (M-3_HOACS.swf), but once it loads it seems to freeze on the first frame, and no action script continues to work. The strange thing is, if I just run the third SWF (M-3_HOACS.swf) independently, it works fine. SO there is something in the loading that is causing it to freeze. Is this a problem in the way I have the loader scripted, or maybe the way I am using addChild?
I have been trying to put together a file that has a few buttons that when clicked begins a preloader animation (with the current swf still on stage and visiable) that once the preloader is completed it will play an exit animation of the current swf then plays the intro animation of the selected swf. An example link of exactly how im wanting the swfs/preloader to interact together is here....costumize.me...Im attaching the file I have so far.
View 1 Repliesi 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
this.createEmptyMovieClip("coalzoom",5);
coalzoom._x = 80;
coalzoom._y = 60;
coalzoom.onEnterFrame = spaceLoad;
function spaceLoad()
[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. here is the CS3 flash sources,, and outputs [URL]
What I have is one swf with buttons, pressing one loads another swf containing several thumbnails (all thumbnails should be images loaded externally). Pressing one of the thumbnails should load yet another swf containing a large image of that thumbnail.This is what I have done so far (this is for the swf containing all the thumbnails):[code]This ActionScript automatically loads the 1.swf containing the larger image of the first thumbnails without waiting for the user to click the mouse.
View 2 RepliesI have a site that loads external swf files using the loader in AS3:
Code:
var myLoader:Loader = new Loader();
addChild(myLoader);
var url:URLRequest = new URLRequest("myexternal.swf");
myLoader.load(url);
this works wonderfully, but what I need to do is have a button in the this SWF, when clicked, unload itself, and load a different external SWF.
I have a small problem,(among many others...) i am loading an external swf using:
this.onRelease = function(){
loadMovieNum ("contentLondon.swf",50)
}
So the ext SWF loads on top of my main SWF, but i have other buttons that will load other ext SWF's. What i would like to do is when an ext SWF is loaded and the user choses to click another link from the main SWF, i would like to have the already loaded one "unload" so that the new one can load in place of it
I didn't work with flash some time, but now I am making site for my furniture shop and I have stuck.Because web site is quite big with many pictures, I had to insert "loading external movies" function, and I have used this function[cod]e...
View 4 Replieshow to load and also unload(removing) multiple external SWF.
so here is what i;m trying to do, i want to load multiple external SWF and play it on my main SWF now i hove no problem with just loading multiple SWF and placing it in the display list .The problem came up when i tried removing those loaded SWF from the display list ,The problem exist because i have no way to refer to what i have loaded and placed on the display list,
i used a single loader instance to load all that external swf, i do know that we have to remove all the event listener related to the external SWF that we want to remove and for this purpose i have crated a function called destroy which the main objective for this function is to remove all event listener inside the swf and also isolating all variable so it would be eligible for garbage collecting, here is what the code look like:
[Code].....
Basically my project is like this, if the time condition is not meet, then it will display a default swf. If meet,then it will unload the default swf and display certain blank swf which will addchild certain image and words based on record in database. Then when the time is reach the end of duration, it will unload the blank swf along with the images and words and upload back the default. how to do in such a way like automatically unload a default swf and load the blank swf along with objects when the time is meet with computer system time and vice versa.
View 4 RepliesI'm trying to load & unload external SWFs with transitions in Actionscript 3.I was able to do this in AS2 on the timeline but can't figure it out in AS3. Or if I can do it with straight Actionscript.[url]...
View 0 Repliesi have a flash movie that loads in two external swf files.
The movie has two buttons each of which loads in a seperate movie, now this allworks fine and to be honest i just used the script assist function to make it all work.
Now my problem is that if i press button number one it loads in the first movie but then i have to press button number one again to unload the movie which means if i press button number one followed by button number 2 i do not unload a movie and they both play together one on top of the other.
is there away that i can have each of the buttons check to see if a movie is loaded and if it is unload it first.
below is my code.
ActionScript Code:
button_3.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF_3);
var fl_Loader_3:Loader;
[Code].....
I have a movie acting as a container for a series of external swf's that I intend to load in sequence.My problem is, how to load a swf for a set period of time so that that it may play out its sequence then load the next external swf; again for a set period of time before the next load and so on.......?
View 5 RepliesI am loading external SWFs on my main flash file. For every External SWFs: They also have multiple levels. There is a base SWF and then 5 levels of other external SWFs there. So- i load an external SWF on my main flash and that external SWF also has its own external SWFs.
[Code]....
Basically I've had a really hard time trying to unload / load external swf slideshows. I've got it so I can load the first one fine, but when I tell it to go to the next frame with the next movie, the movie bit is just blank. If I have a link that goes directly to the frame of the second movie before loading the first movie, the second movie loads fine then, but will not load once the first movie has been loaded, if that makes sense. So I followed a tutorial on here to load and unload. And it almost works! The first movie loads, then I click the second movie and that loads, and then I click back on the first movie and the friggin pc crashes!!
The two movies are on the "home" and "ds" buttons at [URL]. My script is below:
// Container
var imageLoader:Loader = new Loader();
// Url Requests
var imageRequest:URLRequest = new URLRequest("home.swf");
var imageRequestPs3:URLRequest = new URLRequest("ps3.swf");
var imageRequestPs2:URLRequest = new URLRequest("ps2.swf");
var imageRequestPsp:URLRequest = new URLRequest("psp.swf");
[Code] .....
I have a very simple main.swf with buttons in a mc. once a button is clicked it loads and external swf file into x y pos.
How can I set it up so when the external swf loads with a fade in and the other one fades out?
This is my existing code now!
var Xpos:Number = 0;
var Ypos:Number = 75;
var swf:MovieClip;
[Code].....
how I might be able to accomplish this with this code. This code is from [URL] it works great but just need it to fade in and out the swf files.
im using the [code]function to load files into my fla .im trying to put a button in each of the loaded swf files that will tell the main fla to unload the swf and gotoAndStop(1)i have 3 buttons on the first frame of main fla. the first button has [code] different game.so i need a button to unload the game and gotoAndPlay(1) i know how to do this in as3 but im not to familiar with as2.
View 1 RepliesEverything works perfect except for one problem I just can't figure out. On the homepage, called "home_page_swf", I have three buttons at the end of three paragraphs that say "Learn More" and need them to trigger the "home_page_swf" to unload itself and replace it with one of the other external swf pages. I basically want the three buttons within the "home_page_swf" to perform the same function as the "Services", "Portfolio", and "Team" buttons that are located in main swf. I've been trying to read up on it and I keep finding something about "Dispatch Even" but can't figure out how to apply it to the code I am using for the website I'm working on. I'll post the code below for the main navigation swf and what the labels are for the buttons that are inside the external swf called "home_page_swf".
Main SWF with main navigation buttons:
var Xpos:Number = 0.0;
var Ypos:Number = 0.0;
[code]....