Actionscript 3.0 :: Unload SWF Before Loading Another?

Feb 21, 2011

Flash CS4 - AS3

I'm creating a small flash movie into which i'm loading in seperate swf files. All of the external swf files load into a movie clip called pageContainer_mc when their relevant button is clicked.

When testing the movie and clicking the buttons to load in the different swf files, it becomes slugish after a while. Would it help if i unloaded the previous swf file before loading the new one. If so, how would i achieve this.

This is how i am loading in the swf files:

Code: Select allshowsText_mc.addEventListener(MouseEvent.CLICK, gotoShows);

function gotoShows(e:MouseEvent):void
{
var myLoader:Loader = new Loader();
pageContainer_mc.addChild(myLoader);

[Code].....

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Unload External SWF Before Loading New One

Feb 4, 2009

I am building a portfolio, but lately I've been experienced some annoying problems with loading external swfs into a container. Everything works like charm, but when I load new clips into the container, they are just put on top of the old ones - which I naturally don't want to happened. This is the current coding I use for two of the different links. I pressume that one solution would be to add a removeChild, but I've not succeeded placing this in the right place yet.

ActionScript Code:
fashionBTN.addEventListener(MouseEvent.CLICK,fashionBN);
function fashionBN(event: MouseEvent) {
var goFashion =new Loader();
goFashion.load(new URLRequest('fashionPRE.swf'));
contentsMC.addChild(goFashion) }
[Code] .....

View 9 Replies

ActionScript 3.0 :: Unload Self (swf) When Loading Home Swf?

May 16, 2010

I use this code on external swf's (launched from Home swf). Home swf is already playing in the background...so maybe I don't even need a "get URL", maybe I need to just bring to front (and play from certain frame)?

this code works to get Home swf but I think the child swf is still running in the background? How can I A:unload the swf this button is in when this button's clicked OR B: just unload this swf without reloading home swf.

[Code]...

View 0 Replies

ActionScript 2.0 :: Complicated Loading / Unload Mechanism

Dec 19, 2006

How can I accomplish complicated loading and unloading mechanism? for example section number one is divided into the blocks. so when you hit the menu button, section is loading by parts...left part, after that center part and then right. when you press next menu button, first of all this section is unloading... center part, then right part, then left part and after that section number two begin to load in a different manner. so question is how can i control that? for loading and unloading i have got functions load_main() unload_main() load_contacts() unload_contacts()

View 5 Replies

ActionScript 3.0 :: Get This Loader To Unload The Current Picture Before Loading In A New One?

Feb 2, 2010

I'm trying to to get this loader to unload the current picture before loading in a new one. how I can put that in?

ActionScript Code:
function loadPhoto(url:String):void {
var picLoader:Loader = new Loader();

[code]...

View 2 Replies

ActionScript 3.0 :: Unload Loader Button While Loading In Progress?

Sep 7, 2010

I dont even know if i got the title right. I am 5 days into actionscript and i have no prior training or experience in programming, flash using or whatever you might need to build a decent site, except for the graphic design part. I do however need to build an online portflio asap and things have been going great

I have a main movie that uses buttons to go to specific frames on the main timeline:

HZWA.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);
function fl_ClickToGoToAndStopAtFrame(event:MouseEvent):voi d
{
gotoAndStop(5);

[Code]....

View 2 Replies

ActionScript 3.0 :: Unload Main-menu Then Loading External Swf?

Feb 11, 2010

My project is PC software and not related to web.It contains of Main menu and 3 external SWF (Total 4 Files).Inside the Main-Menu 3 buttons , when the user click on button # 1 or # 2 or # 3 I want a code to unload the main menu first then open external swf # 1 or #2 or #3 depending on which button user click.I use this code to load the external SWF:

Code:
var myLoader:Loader = new Loader;
addChild(myLoader);
var url:URLRequest = new URLRequest("f1.swf");
myLoader.load(url);

Its working fine but the problem it load the external swf with the main menu in the same time! what I want a code first unload Main-menu then loading external swf. and another code in external SWFs to exit to Main-Menu with ofcorse unload the swf first then exit to main-menu.

View 5 Replies

ActionScript 2.0 :: Unload Movie Stuff - Current Swf To Unload And The New One To Load Only After A Transition Occurs

Jun 16, 2003

I want the current swf to unload and the new one to load only after a transition occurs. Is there a more efficient way to do this than if. switch()?

View 2 Replies

ActionScript 3.0 :: Unload The Previous Loaded .swf And Load The New .swf Without Having A Separate Button To Unload

Aug 9, 2008

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]...

View 3 Replies

ActionScript 3.0 :: Unload Not Unloading - Unload An External SWF On _root To Load A New One Instead

Jul 23, 2009

I'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]....

View 3 Replies

ActionScript 3.0 :: A Page Loading In Other .swfs (need To Unload Entire Page)

Nov 3, 2011

I have an invisible movie clip I want to go to the NEXT page, as it goes to that page, I want it to essentially remove itself (page1.swf). e.g. page1.swf (contains fancy.swf - [AS2], 4 images, several invisible MCs with code) has an invisible MC + on click = remove page1.swf.

To be clear, this does work. It goes to page2.swf and page2.swf goes to page1.swf as it should. The issue is that if the user repeatedly does this (just 2 or 3 times) the fancy.swf becomes impossible to control and Flash (CS5) crashes. I think this is due to the fact it's not unloading the entire thing, it's only unloading fancy.swf on click (I hope). So underneath page2.swf is page1.swf, and when the user clicks back to page1.swf, page2.swf AND page1.swf are underneath that, and so on and so forth.

[Code]...

View 9 Replies

ActionScript 3.0 :: "Unload SWF" When Loading With Loader()?

Apr 13, 2007

I'm using flash.display.Loader to Load swf through a gateway. It usually works great, and my trace output is like this:

Code:
[SWF] /webroot/binaryStreamer.php - 118,894 bytes after decompression
[SWF] /webroot/binaryStreamer.php - 3,040 bytes after decompression

[code]......

View 4 Replies

ActionScript 2.0 :: "unload" External Swf Before Loading Up A New One?

Mar 7, 2005

do i need to "unload" my external swf, before loading up a new one? i was testing outm y movie, and i was noticing that things were getting a little slow, and i wasn't sure if it was becasue of my computer, or of the movie.

View 3 Replies

ActionScript 2.0 :: UNLOAD The CURRENT MOVIE First Before Loading Another MOVIE

Apr 15, 2003

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.

View 2 Replies

ActionScript 2.0 :: "unload" External Swf, Before Loading Up A New One?

Mar 7, 2005

okay, so i figured out the previous issue that i had, but i have another question. do i need to "unload" my external swf, before loading up a new one? i was testing outm y movie, and i was noticing that things were getting a little slow, and i wasn't sure if it was becasue of my computer, or of the movie.

View 2 Replies

Unload Flv When Completed?

Mar 5, 2009

I have an swf, lets call it 1.swf, that has a button that calls another swf to level one. In that second swf, lets call it whatever.swf, on layer 1 it has an flv file of about 40 seconds. on layer two it has a button that has this action:

on (release) {
unloadMovie(1);
loadMovie("../swf/1.swf", 1);
}

So if that button is pushed, then it unloads whatever.swf as I need it to.

the problem is that if that button is not pressed, then when that 40 second flv finishes, it just sits there with a black stage and the button. What i need it to do is that when that 40 second flv is finished, it automatically unloads whatever.swf on level 1, again showing 1.swf on level 0.

Also, before anyone anwers, the way i did the flv is that in whatever.swf the flv was imported to the stage, i slected the "already deployed" put in the URL and then it created a flash video component which is on the stage.

View 3 Replies

AS3 :: Flash - How To Unload A Swf

Nov 16, 2009

how I can do to unload a swf before I load the next one?

var mLoader:Loader = new Loader();
function loadSWF(e:Event):void {
var imageId:Array = e.target.name.split("_");
var targetId:int = imageId[0];

[code]....

View 3 Replies

ActionScript 3.0 :: Unload My Old Swf?

Jul 9, 2009

I am trying to add a external Swf files to my home page because my other pages are swf files. when i click other page it will call to my swf file. but my current home swf file running under my new page swf... so how can i unload my old swf.

View 2 Replies

ActionScript 3.0 :: Unload Swf From Itself?

Nov 16, 2009

I'm using AS3 to load one swf (a document viewer) into the main swf. the loaded swf takes up the entire stage, so I need the unload button to be in the loaded swf.

is there an AS3 equivalent to this.unload?

View 5 Replies

ActionScript 3.0 :: Way To Unload SWF

Jul 29, 2011

I have an AIR application which load/unload external AS2 SWF files. My problem is that when SWF is unloaded its Enterframe events keeps runing.

View 1 Replies

ActionScript 2.0 :: Unload Mc Within Itself?

Dec 16, 2004

I have a random number of sprites that are created, each of them hurts the other when the collide, and when they die, I wanted the collisions to not do anything anymore.

I can fade the sprites out to make them invisible when their "health" reaches 0, but they are still there, and when they collide, they cause "ghost deaths" to other mcs. How can I get rid of a sprite from within itself? Or at least disable its onEnterFrame function?

View 1 Replies

IDE :: Unload External Swf?

Apr 12, 2009

My index page has two buttons... 'about' and 'portfolio' which loads each respective external swf into a holder.When 'portfolio' is loaded there are another 8 buttons which again load 8 external swfs into a holder in the portfolio.swf. Each of the 8 external swf files load fine, but is there anyway to have a back button instead in each of the 8 external swf to go back to the portfolio.swf without having to click the 'portfolio' button?i have tried _root.unloadMovie.... but it just clears the stuff on my index page and loads the portfolio.swf

View 1 Replies

ActionScript 3.0 :: How To Unload SWF

Jul 11, 2011

I have three swf files that I want to load then unload in a specific order. An Intro swf, the main movie swf then the Exit swf. I can get them to load with the following code;[code]the trouble is, each movie swf loads on top of the previous movie swf which then continues to display.I'm new to AS 3.0 but it seems like I need to unload the previous movie as the new movie loads. Can anyone show me the code I would need to use in order to get that to happen?

View 1 Replies

IDE :: Load And Unload SWF With FLV

Jul 13, 2009

I've got a SWF with two (for now) buttons on it that each load a SWF. Each of these will load fine if they are the first one pressed. Once one is pressed there are problems. If you try to go to the next one, the new SWF covers the one currently playing, but it will not load the FLV associated with it and the audio from the previous does not stop. You can see it all here: [URL]

And here is the code on the navigation:
var Xpos:Number = 130;
var Ypos:Number = 10;
var swf:MovieClip;
var loader:Loader = new Loader();
loader.x = Xpos;
[Code] .....

View 1 Replies

IDE :: How To Unload External Swf

Mar 18, 2010

i am trying to create a file where a mc hittest another object(using keyboard arrow) it loads an external swf and when keypress to leave the object, it will unload the external swf. my problem is the external swf did load but it wont unload. attached herewith my fla file for reference. script as below,

mcMain.stop();
var leftArrow:Boolean = false;
var rightArrow:Boolean = false;
var downArrow:Boolean = false;

[Code]......

View 1 Replies

ActionScript 3.0 :: How To Unload Xml

Jun 12, 2011

I create a flash as3 where my stage has 3 buttons home button2 and button3. when i click home button a thumbnail xml gallery will loaded. when button 2 and button3 clicked it loads some text from another xml file. All it's work well. My problem is after i clicked the home button the gallery loads then if i clicked the other buttons the gallery still displayed in the stage. The text from the other xml file will stack behind the gallery. How to solve this.This is my code:

import fl.transitions.Tween;
import fl.transitions.*;
import fl.transitions.easing.*;

[code].....

View 1 Replies

ActionScript 2.0 :: How To Unload Movieclip

Feb 10, 2009

I am making a file that loads an swf on(release) of a movieclip. I can get it to load into frame 2 and have created a button to return to frame 1. But when you go back to frame 1 the swf is still there. How can I get it to unload when it goes back to frame 1?[code]

View 3 Replies

Unload SWF Still Plays The .flv (audio)?

Jan 4, 2010

I have a captivate generated SWF file which has a .FLV inside it.In flash on click of a button I unload the movie(SWF), the video goes away but the .FLV still plays the audio.

View 2 Replies

ActionScript 3.0 :: Unload An External Swf?

Jan 20, 2010

I have a movie wherein on the stage I have a empty MC with the instance name of mainImage.

There is a menu with listeners that load in different swfs externally into this 'mainImage' clip. The problem I discovered is that I cant seem to unload the old swfs upon the loading of a new one.[code]...

View 2 Replies

Unload Movie Not Working?

May 19, 2010

im having troubles unloading a swf file that is 2 levels above my main movie.Basically I have a main movie and I have actionscript on the timeline which corresponds to a button which loads a swf (eg my web portfolio work):

digitalbut.onRelease = function() {
disableBtns();
_root.createEmptyMovieClip("container",1);

[code]...

This all works....Then in this swf I have another button which again loads another swf on top to show a particular piece of work and the code on the timeline to correspond to the button is:

Dior_hit.onRelease = function() {
createEmptyMovieClip("container",1);
loadMovie("Digital/Dior/Dior.swf","container");

[code]...

This works also....but I come into problems when I want to create a button in this third swf file which then closes this Dior.swf so you are left with the bottom two still showing. I already have a close button on the Digital.swf which works a charm to get you back to the main movie and the code for this is:

on (release) {
_root.container.unloadMovie()
unloadMovieNum(2);

[code]...

how I can close this third swf to still show the two below?? I have tried so many options but none seem to work!

View 2 Replies







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