Unloading A Swf
hello all. this is probably a piece of cake, but i cant seem to get it right. i want to be able to close a swf from within another swf. iwant to be able to do this:
www.murderdolls.com
go to media... click on a photo thumbnail... the larger image contains a "close window" button.
how do i "close window"?
thanks in advance!
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 01-10-2003, 01:50 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Unloading MCs
I can't figure out how to get the unload to work. The script is below for my button 'Info'. It loads the movie, but will not unload the one that is on the stage. These are MCs within MCs within MCs. There are piecs and placements within each MC, so as far as I can tell, they are all necessary.
The scripting below that (the setProperty() ) is what actually works (and I have obviously tried it without the setProp). So I can load the MC, and set the visibility to 0 when I want another MC on the stage, but cannot actually unload it. Am I doing something wrong? Or is this the only way to do it?
You can see this on my homepage: http://www.emotion7.com
Try clicking the 'Info' button, letting it load, then the
'Services' button to see what I mean.
Thanks.
on (release) {
loadMovie ("Information.swf", "_root.Text.TextInfo");
unloadMovie ("_root.Text.TextServices.Services.swf");
}
on (release) {
setProperty ("_root.Text.TextServices", _visible, FALSE);
setProperty ("_root.Abstract.Abstractcopy", _visible, FALSE);
}
Unloading Various
I've got about 11 different movies that are all loaded into different "emptyMovies" with variable names of container1, container2, container3, etc...
Is there a way that I can unload all these at the same time using the UnloadMovie action?
Thanks
ghjr
[][][][][][ <-- Unloading
is there any way of telling to unload whatever external swf is loaded into lets say, level 1?
Thanks in advance
Unloading Mc's
ok so I have got my images loaded up dynamically on my site, but they overlap each other. They are all being loaded into a container, but how do I tell them to replace one another, rather than layer?
http://www.markertphoto.com/flash.htm
Help Unloading A Swf Please
Hello everyone, im having problems closing/unloading a swf file loaded into an empty movie clip.
This script sets up the main movie components;
stop();
_root.createEmptyMovieClip("empty_scroll_mc", 10);
_root.empty_mc._x = 0;
_root.empty_mc._y = 0;
_root.empty_scroll_mc.loadMovie("scrolling_menu.sw f");
_root.createEmptyMovieClip("empty_mc", 1);
_root.empty_mc._x = 0;
_root.empty_mc._y = 0;
_root.empty_mc.loadMovie("pool_page.swf");
_root.createEmptyMovieClip("empty_popup_mc", 9);
_root.empty_popup_mc._x = 25;
_root.empty_popup_mc._y = 0;
The empty mc in question is the third one, empty_popup_mc.
The above script sets up the navigation and the stage.
'empty_mc' is the empty movie clip into which my main content pages (different swf's) are loaded into, depending on which button is clicked on the scrolling_menu.swf
ie; this is attatched to a button on the scrolling_menu.swf:
on (release) {
_root.empty_mc.loadMovie("gym_page.swf");
}
This loads the gym_page.swf, into the empty_mc i then have a button on the gym_page which loads the brochure_request.swf in the emty_popup_mc
on (release) {
_root.empty_popup_mc.loadMovie("brochure_request.s wf");
}
We now get to my main question, the button to unload the brochure_request.swf from the empty_popup_mc is on the brochure_request.swf
Hope that makes sense to you! I thought i had sussed paths but i im stumped on this one.
Can anyone help me write the script for the button that will unload the brochure_request.swf from the empty_popup_mc.
the site is here
The brochure request page can be found by clicking on the gym page, then the button on the right that says 'more details'
Thank you so much, this is the first time i have tried to unload something !
Unloading .flv
I have a main .swf file that loads another .swf file which contains a .flv video using the Media Playback component. Works great. Only problem is that, when I close the loaded .swf file containing the .flv, the audio still plays.... The entire screen goe's away, but the audio still remains. I've tried many differenct solutions on unloading certain things to no avail. any ideas? is there an unload .flv command? or maybe some kind of buffering issue? Thanks for any tips.
MX 2004 Pro.
Help With Unloading....
hey
i have a button in main.swf which loads a swf called 'morpher' into a target mc called 'morphLoad'. the code used is:
loadMovie("videos/morpher.swf", "morphLoad");
the movie plays fine but what i want it to do when it is over is to unload and then target a frame within main swf called 'goagain'
im guessin the code would go in the last frame of the loaded 'morpher' swf?
any help on how to achieve this would be very appreciated.
thanks alot,
james
SWF Unloading
Hi guys
i got a problem unloading a .swf, i have a long timeline with all the pages in it,at a certain frame i have loaded, a form.swf with loadmovienum and it works, but my prob is when i then go to other pages on the same time line the swf is still there in background i have tried unloadmovienum at the end of the page frame but then the movie does not load. i have no hair left please help,ooop 1 hair left sorry.
Unloading
Hi there
I was wondering if somebody would help me.I am trying to create a porfolio of my work to apply to uni.They need to see developmental work so i have created the "develpmental work" button as a movie clip.Once clicked on it will play and the rough sketches will be shown.I'm not to sure what the script woud be to unload the main timeline piece so that only the sketch is shown.
I will attach the file.It only works for the six piece along.
Thank you so much
Nadine
I don't know why it is not letting me upload the file
[F8] Help With Unloading
Ok I'll try and keep this simple I have a movieclip which randomly duplicates itself somewhere on the x value between 1 and 396, above the stage it then decends downwards using a separate movieclip that I have set up which runs though a series of frames moving the moviclip down 2px every frame, When it reaches the bottom of the screen I have a hit area covering the bottom of the stage, when it hits this I would like it to unload.
Plz Help.
[F8] Nut Unloading
Let me start by saying thank you in advance.
I have my main time line and on it I have an MC with an instance name of "skip_intro".
Inside that MC I have a button with the following AS:
on (release) {
_root.gotoAndStop("end");
_root.o_text.gotoAndStop("end");
_root.skip_intro.unloadMovie();
}
The problem is my "unloadMovie" isn't working.
Basically I want it so that when you click on the "button (MC "skip_intro"), it disappears off the stage. Why is my AS not working? I also tried:
this.unloadMovie();
Interestingly enough when you click it a second time it disappears... but I need it to work on the first click.
What am I doing wrong?
Again,
Thanks
Unloading
Basically I followed along with a tutorial about how to create a memory game in flash. The only issue I have is that I want to be able to unload the game once the user progresses past that part of my flash. I have tried fooling around with a couple unload functions and clear functions but I don't think I'm recognizing which variable/movie I need to have unloaded for the cards to actually go away!
A simple forceclear function to remove all actionscrpit would be very handy!
here's the code that is loaded into the frame...
Code:
Code:
// Gamefield settings
// EDIT HERE
card_w = 70;
card_h = 90;
card_wdistance = 17;
card_hdistance = 15;
// STOP EDIT
card_dw = card_w + card_wdistance;
card_dh = card_h + card_hdistance;
row_card = Math.floor((Stage.width - card_wdistance) / card_dw);
col_card = Math.floor((Stage.height - card_hdistance) / card_dh);
n_card = col_card * row_card % 2 == 0 ? col_card * row_card : (col_card - 1) * row_card;
imgs_n = n_card / 2;
// CENTER THE IMAGE IN THE CARD
centerImage = function(target){
target.front._visible = false
target.front.container._x -= target.front.container._width / 2
target.front.container._y -= target.front.container._height / 2
}
// ---------------------------------------------
empty = new Array();
function createCard(n, w, h) {
empty.push(n);
this.createEmptyMovieClip('card' + n, n);
with (this['card' + n]) {
lineStyle(0, 0x000000, 100);
beginFill(0x000099, 60);
moveTo(w / 2, 0);
lineTo(w / 2, h / 2);
lineTo(-w / 2, h / 2);
lineTo(-w / 2, -h / 2);
lineTo(w / 2, -h / 2);
lineTo(w / 2, 0);
endFill();
createEmptyMovieClip('front', 1);
front.createEmptyMovieClip('container', 2);
front.createEmptyMovieClip('backgr', 1);
with (front.backgr) {
moveTo(-w / 2, -h / 2);
lineStyle(0, 0x000000, 0);
beginFill(0x333333, 100);
lineTo(w / 2, -h / 2);
lineTo(w / 2, h / 2);
lineTo(-w / 2, h / 2);
lineTo(-w / 2, -h / 2);
endFill();
}
front.onEnterFrame = function() {
tot = this.container.getBytesTotal();
car = this.container.getBytesLoaded();
if (tot == car && tot > 200) {
this._parent._parent.centerImage(this._parent);
delete this.onEnterFrame;
}
};
}
}
selcards = [];
function placeImages() {
act_img = 0;
for (img = 0; img < imgs_n; img++) {
for (k = 0; k < 2; k++) {
act = Math.round(Math.random() * (empty.length - 1));
this['card' + empty[act]].img_id = act_img;
this['card' + empty[act]].front.container.loadMovie("imgs/img" + act_img + ".jpg");
this['card' + empty[act]].onRelease = function() {
this.rotateCard(0, 0);
this.enabled = false;
MovieClip.prototype.enabled = false;
};
empty.splice(act, 1);
}
act_img++;
}
}
MovieClip.prototype.rotateCard = function(v, i) {
this.operazione = v == 0 ? +0.1 : -0.1;
this.incremento = i == 0 ? 100 : 10;
selcards.push(this._name);
this.onEnterFrame = function() {
this.incremento += this.operazione;
this._xscale = (100 * Math.sin(this.incremento));
if (this._xscale > 0) {
this.front._visible = v == 1 ? false : true;
}
if (this._xscale >= 99) {
delete this.onEnterFrame;
selcards.length < 2 ? MovieClip.prototype.enabled = true : null;
v == 0 && selcards.length > 1 ? checkCards() : null;
}
};
};
function generateGameField(cards, distance, hdistance) {
Ypos = card_h / 2 + hdistance;
Xpos = card_w / 2 + distance;
for (c = 0; c < cards; c++) {
createCard(c, card_w, card_h);
if (c % row_card == 0 && c > 0) {
Ypos += this['card' + c]._height + hdistance;
Xpos = card_w / 2 + distance;
}
this['card' + c]._x = Xpos;
this['card' + c]._y = Ypos;
Xpos += this['card' + c]._width + distance;
}
placeImages();
}
generateGameField(n_card, card_wdistance, card_hdistance);
score = 0;
this.createTextField('punti', -1, 500, 380, 0, 0);
punti.autoSize = true;
punti.text = 0;
function checkCards() {
if (this[selcards[0]].img_id == this[selcards[1]].img_id) {
score++;
punti.text = score;
eval(selcards[0])._visible = eval(selcards[1])._visible = false;
} else {
eval(selcards[0]).rotateCard(1, 1);
eval(selcards[1]).rotateCard(1, 1);
eval(selcards[0]).enabled = eval(selcards[1]).enabled = true;
}
selcards = [];
MovieClip.prototype.enabled = true;
}
stop();
I don't really care how, but I need to find out any way to completely unload this game.... I'm pulling my hair out over this because it's probably so simple.
Maybe encapsulating all the code into an object and unloading the object? I don't understand much actionscript but I am an experienced coder..
SWF Unloading Bug.
Hey,
There's this unloading bug in as3 i've come upon. If i load a SWF i can't get the memory back in any way (that i've found atleast).
I've attached an example of the issue on the adobe bug list (here), but i was hoping anyone has come upon any workaround for it in any way.
So, if anyone've seen anything please give a shout out here!
Thanks!
/bob
Help Unloading .swf
I'd been running searches all over Google all day today, but to no avail.
So I've created a gallery for my portfolio. The main splash page is an swf, and from within, it calls my graphic design, illustration, sculpture and motion art portfolios(which are also .swf files). The graphic design and sculpture portfolios load fine, but in order to return to the main page I need to unload whichever video is presently on top or active. Here is an example of the Graphic design clip as it is loaded.
ActionScript Code:
stop();
var GDloaded_clip:Loader = new Loader();
stage.addChild(GDloaded_clip);
GDloaded_clip.contentLoaderInfo.addEventListener( Event.INIT, handleInitGD);
GDloaded_clip.load( new URLRequest( "GD_Gallery.swf" ) );
function handleInitGD(evt:Event):void
{
var extMovie:* = GDloaded_clip.content;
extMovie.x = 13;
extMovie.y = 92;
}
Here is my logo button, which returns to the home page.
ActionScript Code:
Logo.addEventListener(MouseEvent.CLICK, clickLogo);
function clickLogo(event:Event):void
{
GDloaded_clip.parent.removeChild(GDloaded_clip);
SCloaded_clip.parent.removeChild(SCloaded_clip);
gotoAndStop("Home");
}
I only have 2 galleries created at the moment(Sculpture-SCloaded_Clip and Graphic Design- GDloaded_clip) but I would like to iron out the current problem. Right now if i click the logo to return from a gallery, i get the following error because there is nothing loaded for it to unload (i think)
Error #1009: Cannot access a property or method of a null object reference.
I have no real useful knowledge of actionscript, and most of what I have done has been through tutorials and modifications of code. I think I need to write an if() statement to check and see what is currently loaded. Once I can figure this out I can modify it for the rest of the site. Any help would be very appreciated.
-Aelx
Help Unloading .swf
I can't figure this out, I think i'm trying to remove the child to early. anyways, heres my code without any attempt to remove the child. thank you very much people at actionscript!
ActionScript Code:
stop();
about.buttonMode = true;
contact.buttonMode = true;
portfolio.buttonMode = true;
var request:Loader = new Loader();
about.addEventListener(MouseEvent.ROLL_OVER, overAbout);
about.addEventListener(MouseEvent.ROLL_OUT, outAbout);
about.addEventListener(MouseEvent.MOUSE_DOWN, downAbout);
function overAbout(MouseEvent):void{
about.gotoAndPlay(2);
}
function outAbout(MouseEvent):void{
about.gotoAndStop(1);
}
function downAbout(MouseEvent):void{
var request:Loader = new Loader();
request.load(new URLRequest ("AboutMe.swf"));
request.x = 0;
request.y = 0;
addChild(request)
gotoAndStop(2);
}
portfolio.addEventListener(MouseEvent.ROLL_OVER, overPortfolio);
portfolio.addEventListener(MouseEvent.ROLL_OUT, outPortfolio);
portfolio.addEventListener(MouseEvent.MOUSE_DOWN, downPortfolio);
function downPortfolio(MouseEvent):void{
var request:Loader = new Loader();
request.load(new URLRequest ("Portfolio.swf"));
request.x = 0;
request.y = 0;
addChild(request)
gotoAndStop(2);
}
function overPortfolio(MouseEvent):void{
portfolio.gotoAndPlay(2);
}
function outPortfolio(MouseEvent):void{
portfolio.gotoAndStop(1);
}
contact.addEventListener(MouseEvent.ROLL_OVER, overContact);
contact.addEventListener(MouseEvent.ROLL_OUT, outContact);
contact.addEventListener(MouseEvent.MOUSE_DOWN, downContact);
function downContact(MouseEvent):void{
var request:Loader = new Loader();
request.load(new URLRequest ("Contact.swf"));
request.x = 0;
request.y = 40;
addChild(request)
gotoAndStop(2);
}
function overContact(MouseEvent):void{
contact.gotoAndPlay(2);
}
function outContact(MouseEvent):void{
contact.gotoAndStop(1);
}
Help With Unloading .swf
I'm close to the effect I want, but I can't get the some of the stuff to unload when clicking to different area's throughout the project, (.swf's). On the main page, it's going to be identical to the rest of the site except for a few different elements, how do I get the .swf's your currently on to disapear so it doesn't go into the rest of the .swf area's, ie: new's/annoucements, etc.
you can preview what I'm asking for at our site, http://www.edni.net/site/
The news/annoucements doesn't dispear when clicking to different sections. can someone help me out, I'd greatly appreciate it.
Unloading FLV's Help
hello. here is my situation:
please read on, i tried to make it and easy read...
i have a 2 buttons that have this code on them:
on (release) {
stopAllSounds();
unloadMovieNum("50.swf", 50)
unloadMovieNum("50.swf", 51)
loadMovieNum("
Should I Be Unloading Mcs?
Hello,
I have an online test in Flash. It is basically working ok, but it is not reliable 100% of the time. The movie has 6 sections, the first 4 use quite a few audio files. I preload all of the audio (external mcs) in the beginning of the movie, while the user is reading an instruction page. I have a preloader to do this. Some problems that are occurring:
Occasionally, the preloader stops at a percentage and will not load any more. Doesn't seem to happen very often.
Sometimes, when the user gets to section 5 of 6, for example, there are no images displayed. It has also frozen at the beginning of other sections. Yet it works fine for 90% of the other people. It's almost as if all of the data did not get preloaded correctly.
I am wondering why there is this inconsistent behavior with the same movie? One thing is I do not 'unload' any of the mc's I preload. As a general rule of thumb, should one be unloading mc's as soon as they are no longer needed in the movie?
I decided to preload all of the audio files at the beginning because once the test starts, I did not want the user to have to wait to load data. Is this a bad idea? Perhaps I should be loading at the start of each section? Would that make it play more reliably.
Any suggestions would be much appreciated!
Unloading AS3
I have loaded an external movieclip into another on the stage. I would like to have a button that is in the loaded movie clip that unloads that loaded swf. Problem is that I cant have Mouse event listener on that button to call a function on the main stage. My guess is having to use event Dispatcher but not sure how to implement it.
What would be the best way to do this?
Edited: 11/15/2007 at 11:46:04 AM by arandlett
Unloading Flv's
Hello.
I have a home page that loads several flv's. I am also trying to give the user the ability to view the page without video. When the user clicks a button on the home page, it sets a cookie that reloads the page with a different swf file that does not contain any flv's. However, since it takes a second or two for the cookie to be read, the initial swf has started loading, and even though the entire swf is swapped out with the "video-less" swf, those original flv's continue to load in the background, slowing everything down even though the user wants no part of the video. Any ideas how to solve this?
fyi, another feature of the home page shares a similar problem. The user is to select one of 3 "personal assistants" who will be their guide through the rest of the site. Once they've selected, another cookie is set. Each time they return, the initial swf checks for a cookie, and then displays a static image of the character they have selected. At this point, I am also trying to "unload" all of the swfs, but they still load in the background. I have tried both "unloadMovie(movieName);" and "stream_ns.Clear();".
the site may be seen here:
First Entertainment Credit Union »
Thanks in advance!
Unloading Flv's
Hello.
I have a home page that loads several flv's. I am also trying to give the user the ability to view the page without video. When the user clicks a button on the home page, it sets a cookie that reloads the page with a different swf file that does not contain any flv's. However, since it takes a second or two for the cookie to be read, the initial swf has started loading, and even though the entire swf is swapped out with the "video-less" swf, those original flv's continue to load in the background, slowing everything down even though the user wants no part of the video. Any ideas how to solve this?
fyi, another feature of the home page shares a similar problem. The user is to select one of 3 "personal assistants" who will be their guide through the rest of the site. Once they've selected, another cookie is set. Each time they return, the initial swf checks for a cookie, and then displays a static image of the character they have selected. At this point, I am also trying to "unload" all of the swfs, but they still load in the background. I have tried both "unloadMovie(movieName);" and "stream_ns.Clear();".
the site may be seen here:
First Entertainment Credit Union »
Thanks in advance!
Unloading A SWF
I have a Menu swf file that I load another swf file with the following code stright from the help file:
var request:URLRequest = new URLRequest("riskTaking.swf");
var loader:Loader = new Loader()
loader.load(request);
addChild(loader);
This works fine but now I need to remove this SWF file when the user clicks on a Main Menu button in the loaded SWF file. I can't see any linkage to the Main SWF in the debugger. Any suggestions?
Thanks ahead of time.
UNLOADING SWF
Can anyone offer any advice on how to unload swfs that have been loaded into a host SWF.
For eaxmple i have my main movie and am loading an external swf into it
this works fine however when i try to close it with another button in the main movie,
I get this error message
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@2cf8101 to flash.display.Loader.
at VirtualSynthPiano_fla::MainTimeline/unloadFunction()
This is my code
//button in the main movie that loads the external swf
keyboardDragMC.btBtnMC.addEventListener(MouseEvent .MOUSE_DOWN, loadPlayer);
function loadPlayer(myevent:MouseEvent):void {
var myrequest:URLRequest=new URLRequest("organBluesPlayer.swf");
var myloader:Loader=new Loader();
myloader.addEventListener("UnloadMe", unloadFunction);
myloader.load(myrequest);
stage.addChild(myloader);
}
//button in main movie that should unload the swf
keyboardDragMC.editBtnMC.addEventListener(MouseEve nt.MOUSE_DOWN, unloadFunction);
function unloadFunction(event:Event):void {
Loader(event.currentTarget).unload();
}
After looking around the net this seems to be quite a common problem. Would much appreciate any advice any one could offer?
thanks
Liam.
Unloading A SWF
I'm using a shell to load a series of swf files. I'm using a next and a back button to move from swf to swf. Some of my swf files contain video which continues to play. Is there a command to dump the current swf that can be invoked when I press the next or back buttons of the shell? Thanks
Unloading .flv
I have a main .swf file that loads another .swf file which contains a .flv video using the Media Playback component. Works great. Only problem is that, when I close the loaded .swf file containing the .flv, the audio still plays.... The entire screen goe's away, but the audio still remains. I've tried many differenct solutions on unloading certain things to no avail. any ideas? is there an unload .flv command? or maybe some kind of buffering issue? Thanks for any tips.
Unloading XML
I was hoping someone could tell me how to unload xml correctly. I need to unload an xml file on release of a button, then load new XML. Currently I am unLoading the initial xml by unLoading the target clip. However, when I do this not all of the assets (jpgs) that where loaded with the xml delete form the screen. The following is the code I am currently using. Any help would be great. Thanks.
interactivePortfolio_btn.onRelease = function() {
portfolioLabel_txt.text = "Interactive Portfolio";
currentThumb_mc.unloadMovie()
portfolio_xml.load("XML/interactive.xml");
_parent.description_txt.text = "";
_parent.info_txt.text = "";
play();
};
Help With UNLOADING
I can't seem to get the main.swf to unload when the next swf loads up...after clicking on the button...
Code:
on (release) {
_root.content.loadMovie("portfolio.swf",0);
unloadMovie("flashsite.swf")
}
I'll take any help...thanx!
Unloading A Swf
hi,
i want unload (close completely) an intro section when i click on a button to naviagate to another section. The intro section is a separate swf file and i when the button is pressed to proceed to the next section, it opens an external swf file.
I have tried a few unload movie codes that i have found here, but the intro screen still flicks up for about a second when buttons are pressed to go to other sections.
Any help would be much appreciated, thanks!
Unloading A .swf
So here goes,
This is on my main timeline (below), as you can see it is calling individual _mc to play depending on what btn you choose (pretty straight forward). Each _mc has a stop(); at frame 2 and 10 (except buttonHandler(1) 'cause I want it to load automatically). The buttonHandler(4) is just loading a .swf, on frame 2; loadMovie("brugmansia_gallery.swf",1000); and on frame 11 unloadMovie("brugmansia_gallery.swf");
I'm using the kirupa gallery with xml and thumbnails, I don't if that makes a difference
var btnNum;
function buttonHandler(who:Number){
if(btnNum==who)return;
_root.container_mc["menu"+btnNum+"_mc"].play();
_root.container_mc["menu"+who+"_mc"].play();
btnNum=who;
}
_root.buttons_mc.home_btn.onRelease = function(){
_root.buttonHandler(1);
}
_root.buttons_mc.portfolio_btn.onRelease = function(){
_root.buttonHandler(2);
}
_root.buttons_mc.favorites_btn.onRelease = function(){
_root.buttonHandler(3);
}
_root.buttons_mc.merchandises_btn.onRelease = function(){
_root.buttonHandler(4);
}
_root.buttons_mc.contact_btn.onRelease = function(){
_root.buttonHandler(5);
}
_root.buttonHandler(1);
My question is how do i get the .swf to leave when you click on a different button?
Unloading
I`m really sorry if this has been covered, but the search doesn`t come up with much when I type "Unload" in!
Ok, here`s my problem:
I have 9 frames on the main timeline - Each frame is a separate page for a website. eg:
Frame 1: Home
Frame 2: News
etc
In my second frame I have External SWFs being loaded in when you push 1 of 4 buttons. Now, I placed all of these on _Level1 so that each time a button is pressed, it unloads the previous movie before the new one. Hassle free......or so I thought.....
Now every time I move to another frame on the main timeline (ie any other frame apart from 2) the movie last loaded on that page stays over the other frames, as it`s on _level1.
I`ve tried using an UnloadMovieNum () code (to unload all movies in _level1) on all the other frames, but I`m not having any luck. Perhaps I`m doing it wrong? I've only been using Flash a few months!
Any ideas?
Thanks very much for your time!
~STEVE
Help With Unloading
Code:
/the name of the button is "but". Name your buttons f.e. but1,but2 and etc in the movieclip properties.
button.onRollOver = function() {
this.gotoAndStop(1);
this.play();
if (this._currentframe == 13) {
flipOut = true;
stop();
}
};
button.onRollOut = function() {
if (flipOut=true) {
this.gotoAndPlay(14);
}
flipOut = false;
};
button2.onRollOver = function() {
this.gotoAndStop(1);
this.play();
if (this._currentframe == 13) {
flipOut = true;
stop();
}
};
button2.onRollOut = function() {
if (flipOut=true) {
this.gotoAndPlay(14);
}
flipOut = false;
};
button3.onRollOver = function() {
this.gotoAndStop(1);
this.play();
if (this._currentframe == 13) {
flipOut = true;
stop();
}
};
button3.onRollOut = function() {
if (flipOut=true) {
this.gotoAndPlay(14);
}
flipOut = false;
};
button4.onRollOver = function() {
this.gotoAndStop(1);
this.play();
if (this._currentframe == 13) {
flipOut = true;
stop();
}
};
button4.onRollOut = function() {
if (flipOut=true) {
this.gotoAndPlay(14);
}
flipOut = false;
};
button5.onRollOver = function() {
this.gotoAndStop(1);
this.play();
if (this._currentframe == 13) {
flipOut = true;
stop();
}
};
button5.onRollOut = function() {
if (flipOut=true) {
this.gotoAndPlay(14);
}
flipOut = false;
};
button6.onRollOver = function() {
this.gotoAndStop(1);
this.play();
if (this._currentframe == 13) {
flipOut = true;
stop();
}
};
button6.onRollOut = function() {
if (flipOut=true) {
this.gotoAndPlay(14);
}
flipOut = false;
};
button7.onRollOver = function() {
if (flipOut=true) {
this.gotoAndPlay(14);
}
flipOut = false;
};
button.onRelease = function() { unloadMovieNum(1); main.gotoAndPlay(39); }
button2.onRelease = function() {
my_mc.loadClip("shape.swf", "container");
};
var empty = this.createEmptyMovieClip("container", "100");
empty._x = 0;
empty._y = 0;
my_mc = new MovieClipLoader();
-----------------------------------------------------------------
WHAT DO I PUT TO UNLOAD??? the loaded movieclip?
-----------------------------------------------------------------
button3.onRelease = function() { unloadMovieNum(1);main.gotoAndPlay(260); }
button4.onRelease = function() { unloadMovieNum(1);main.gotoAndPlay(109); }
button5.onRelease = function() { unloadMovieNum(1);main.gotoAndPlay(321); }
button6.onRelease = function() { unloadMovieNum(1);main.gotoAndPlay(405); }
SWF Unloading Bug.
Hey,
There's this unloading bug in as3 i've come upon. If i load a SWF i can't get the memory back in any way (that i've found atleast).
I've attached an example of the issue on the adobe bug list (here), but i was hoping anyone has come upon any workaround for it in any way.
So, if anyone've seen anything please give a shout out here!
Thanks!
/bob
Unloading .flv
I have a main .swf file that loads another .swf file which contains a .flv video using the Media Playback component. Works great. Only problem is that, when I close the loaded .swf file containing the .flv, the audio still plays.... The entire screen goe's away, but the audio still remains. I've tried many differenct solutions on unloading certain things to no avail. any ideas? is there an unload .flv command? or maybe some kind of buffering issue? Thanks for any tips.
Unloading XML
I was hoping someone could tell me how to unload xml correctly. I need to unload an xml file on release of a button, then load new XML. Currently I am unLoading the initial xml by unLoading the target clip. However, when I do this not all of the assets (jpgs) that where loaded with the xml delete form the screen. The following is the code I am currently using. Any help would be great. Thanks.
interactivePortfolio_btn.onRelease = function() {
portfolioLabel_txt.text = "Interactive Portfolio";
currentThumb_mc.unloadMovie()
portfolio_xml.load("XML/interactive.xml");
_parent.description_txt.text = "";
_parent.info_txt.text = "";
play();
};
Help With UNLOADING
I can't seem to get the main.swf to unload when the next swf loads up...after clicking on the button...
Code:
on (release) {
_root.content.loadMovie("portfolio.swf",0);
unloadMovie("flashsite.swf")
}
I'll take any help...thanx!
Unloading A Swf
hi,
i want unload (close completely) an intro section when i click on a button to naviagate to another section. The intro section is a separate swf file and i when the button is pressed to proceed to the next section, it opens an external swf file.
I have tried a few unload movie codes that i have found here, but the intro screen still flicks up for about a second when buttons are pressed to go to other sections.
Any help would be much appreciated, thanks!
Unloading MC, In Its Mc
I have movieclip_B inside movieclip_A. How would I unload movieclip_B from movieclip_A, once movieclip_B hits frame 15?
Unloading .flv
I have a main .swf file that loads another .swf file which contains a .flv video using the Media Playback component. Works great. Only problem is that, when I close the loaded .swf file containing the .flv, the audio still plays.... The entire screen goe's away, but the audio still remains. I've tried many differenct solutions on unloading certain things to no avail. any ideas? is there an unload .flv command? or maybe some kind of buffering issue? Thanks for any tips.
MX 2004 Pro.
Unloading
I`m really sorry if this has been covered, but the search doesn`t come up with much when I type "Unload" in!
Ok, here`s my problem:
I have 9 frames on the main timeline - Each frame is a separate page for a website. eg:
Frame 1: Home
Frame 2: News
etc
In my second frame I have External SWFs being loaded in when you push 1 of 4 buttons. Now, I placed all of these on _Level1 so that each time a button is pressed, it unloads the previous movie before the new one. Hassle free......or so I thought.....
Now every time I move to another frame on the main timeline (ie any other frame apart from 2) the movie last loaded on that page stays over the other frames, as it`s on _level1.
I`ve tried using an UnloadMovieNum () code (to unload all movies in _level1) on all the other frames, but I`m not having any luck. Perhaps I`m doing it wrong? I've only been using Flash a few months!
Any ideas?
Thanks very much for your time!
~STEVE
Unloading SWF's
Im having a problem with my AS for this site. The problem is that I have three buttons on a page that when pressed are supposed to load an external swf into a MC that has an instance name "container". The AS that I am using is:
ActionScript Code:
on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "printportfolio";
container.loadMovie("printportfolio.swf");
} else if (_root.currMovie != "printportfolio") {
if (container._currentframe >= container.midframe) {
_root.currMovie = "printportfolio";
container.play();
}
}
}
its fairly elementary. Actually that code is for the first button. Each of the 3 buttons has about the same code except for the name change of the swf and etc.
So the problem really isnt loading the swf. Its unloading. When ever click one of the three buttons it loads that swf. But when I click on a different button, it doesnt do anything. I think i need to unload the previous swf and load the new one. Well at least thats what I thought the problem was. Can anyone help with that??
BTW...mad uber props to Nutrox, StormBliss & Bxsk8ter. Thanks guys.
Unloading 3.0 MC
In AS 2.0 if you loaded an SWF, and then unloaded, you could republish the previously loaded swf and then again reload it. This is useful obviously if you have a website that loads multiple swfs, this way you don't have to recompile the parent swf over and over for testing.
Now I have been trying to do the same thing with AS 3.0, and nothing I seem to do works, everytime I unload and try to republish the child SWF, it says it is in use. This means that either my code is wrong (which is highly possible) or that the new virtual machine doesn't unload the swf fully and waits for a garbage collection pass.
The code I am posting is a document class for the primary swf, which loads "load.swf" and then unloads it right afterwards.
ActionScript Code:
package
{
import flash.net.URLRequest;
import flash.display.Loader;
import flash.display.MovieClip
import flash.system.LoaderContext;
import flash.system.ApplicationDomain;
import flash.events.Event;
public class primary extends MovieClip{
public function unLoad(ldr:Loader) {
this.removeChild(ldr);
ldr.unload();
}
public function Loaded(event:Event):void {
addChild(event.target.loader);
unLoad(event.target.loader);
}
function primary() {
var ldrContext:LoaderContext = new LoaderContext(false, new ApplicationDoma(ApplicationDomain.currentDomain));
var req:URLRequest = new URLRequest("./load.swf");
var ldr:Loader = new Loader();
ldr.load(req, ldrContext);
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, Loaded,false,0,true);
}
}
}
If I then try to republish load.swf I get an error, says it is in use. Now one possible reason for this is there is a reference to the loaded content somewhere.
My biggest concern apart from convience is that I just want to make sure I am unloading properly.
AS3 - SWF Unloading Bug.
Hey,
There's this unloading bug in as3 i've come upon. If i load a SWF i can't get the memory back in any way (that i've found atleast).
I've attached an example of the issue on the adobe bug list (here), but i was hoping anyone has come upon any workaround for it in any way.
So, if anyone've seen anything please give a shout out here!
Thanks!
/bob
Unloading A MC
Hi,
At the end of a MC animation i need it to unload itself, shouldnt this work...?
Code:
removeMovieClip("_root.animatedMC");
If not, why... and if so, why the hell doesnt it?
thanks
cuse
Unloading Itself..
I'm loading a swf at level 3 to the main swf, and I have a close button in the swf that I loaded is it posible to unload the movie? but from inside the movie that is loaded
Unloading Variables
Hi all,
is there a command that will unload/flash all of the variables in your movie so you can go back to frame 1 with a clean reload of variables!!!
I have about 300 variables so I don't want to clear them by hand...
cheers
Darren
Unloading Movies
Heres my simple question. On my site, I am loading a bunch of separate swf files into level 1. When a user clicks on a button, it loads a swf into level one, replacing any previous swf file that was already in level one.
Now, my main interface is obviously on level 0. What script do I put on a button that will unload the CURRENT movie, no matter what swf file they have on level 1?
For example, I just want to have one button on level 0 that will unload ANY movie on level 1. I dont want to say UnloadmovieNum "blahblah"
I jsut want this button to take the user back to the interface. See what Im saying?
Unloading Movies
I have a website that loads sections (swf's) on top of each other. However the more movies that are loaded, the more the whole movie slow down. How can i unload movies that are under the currently loaded movie so that my movie doesn't slow down?
Unloading A Movie
Hello,
I have a web page compleatly dedicated in flash for a game that I play online. I have seperated each page by 10 frames and jump from frame to frame. (This is after you pick Hi or Med Res Flash) I havent done an intro movie because the first frame wich is my home page the top logo is a movie within the movie. The top banner movie has sound and when the page loads if you imediatly click on one of my other links to go to a different page like frame 10 for the About GnA the top banner keeps playing its music. How do I unload a movie within a movie.
I think this is what I need to do.
Also. I want to link to a forum and have a forum link in my web page. How do I get the link to open a new page and leave my page there. Right now it goes to the forum on the same page.
Unloading Movieclips
I'm trying to unload a movieclip from my flash movie, without success. To explain:::
MainMovie
// on a button, loads an external swf file into a blank
// movieclip on the main stage with instance name
// training_load
on (release) {
loadMovie ("training-new.swf", training_load);
}
External Swf "training-new.swf"
// I have a button within training-new.swf that
// is supposed to unload the movie on press.
// The button is within a movieclip.
// currently the code is :::
on (release) {
unloadMovie (training1);
}
Unfortunately, this doesn't work. Am I targetting the movieclip from the wrong level (do I need _root, _parent, etc) or is my scripting wrong?
Am I targetting the right object??
Any help appreciated.
Thanks also to EVERYONE that helped me with my swapDepths problem, I got a lot of thread replies. Thanks!
[Edited by gatorage on 09-27-2001 at 02:05 AM]
|