Unload Variables
Is it possible to unload a set of variables (loaded from a .txt file. I load from a .txt file that is updated from a pearl prog but i want to update the flash file by re-loading the variables. However flash insists on re-loading from cache. I have tried putting the full path in the "loadvariables" action. but to no avail. do i (CAN i) unload the variables or is there another way of forcing flash to re-load the updated file?
FlashKit > Flash Help > Flash Newbies
Posted on: 05-25-2002, 04:24 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Unload Variables In Xml
I have navigation built in Flash and XML. There is movieclip on the stage called "menu", and there is multiline dynamic text called "info_txt" with variable name " displayText".
There is also movieclip called "container" to load external file into.
This is the AS:
Code:
menuXml = new XML();
menuXml.ignoreWhite = true;
contenttext = this;
menuXml.onLoad = function() {
menuSection = this.firstChild.childNodes;
for (var i=0; i<menuSection.length; i++) {
item = menu.attachMovie("itemClip", "itemClip" + i, i);
item._x = 0;
item._y = 20*i;
item.itemLabel.text = menuSection[i].attributes.name;
item.text = menuSection[i].attributes.text;
item.myUrl = menuSection[i].attributes.url;
item.onRelease = function() {
info_txt.text = "LOADING...";
// load the text into this timeline:
contenttext.loadVariables(this.text);
//getURL(this.myUrl,"_blank");
}
}
}
menuXml.load("myMenu.xml");
And this is the mymenu.xml structure:
Code:
<?xml version="1.0"?>
<PORTFOLIO>
<section name="ABOUT"
text="content/text/description1.txt"
url="http://www.kirupa.com/"
/>
<section name="DESERT"
text="content/text/description1.txt"
url="http://www.bndsolutions.com.au/"
/>
<section name="BUSHFIRE"
text="content/text/description1.txt"
url="http://www.studiowhiz.com/"
/>
<section name="BIRDS & BUSH"
text="content/text/description1.txt"
url="http://www.macromedia.com/"
/>
<section name="LAST MILLENIUM"
text="content/text/description1.txt"
url="http://www.flashforward2002.com/"
/>
<section name="LINKS"
text="content/text/description2.html"
url="http://www.erain.com/"
/>
<section name="CONTACT"
text="content/text/description3.txt"
url="http://www.friendsofed.com/"
/>
</PORTFOLIO>
My question:
I want only ABOUT, LINKS, and CONTACT buttons to load the variable display text. When, DESERT, BUSHFIRE, BIRDS, and LAST button is released it will unloadVariable and do things like load external file (jpg, swf, etc).
I have tried to change the xml structure but it doesn't work. Can someone help me...pleaaaaaaaaase.
How To Unload Variables In Xml
I have navigation built in Flash and XML. There is movieclip on the stage called "menu", and there is multiline dynamic text called "info_txt" with variable name " displayText".
There is also movieclip called "container" to load external file into.
This is the AS:
Code:
menuXml = new XML();
menuXml.ignoreWhite = true;
contenttext = this;
menuXml.onLoad = function() {
menuSection = this.firstChild.childNodes;
for (var i=0; i<menuSection.length; i++) {
item = menu.attachMovie("itemClip", "itemClip" + i, i);
item._x = 0;
item._y = 20*i;
item.itemLabel.text = menuSection[i].attributes.name;
item.text = menuSection[i].attributes.text;
item.myUrl = menuSection[i].attributes.url;
item.onRelease = function() {
info_txt.text = "LOADING...";
// load the text into this timeline:
contenttext.loadVariables(this.text);
//getURL(this.myUrl,"_blank");
}
}
}
menuXml.load("myMenu.xml");
And this is the mymenu.xml structure:
Code:
<?xml version="1.0"?>
<PORTFOLIO>
<section name="ABOUT"
text="content/text/description1.txt"
url="http://www.kirupa.com/"
/>
<section name="DESERT"
text="content/text/description1.txt"
url="http://www.bndsolutions.com.au/"
/>
<section name="BUSHFIRE"
text="content/text/description1.txt"
url="http://www.studiowhiz.com/"
/>
<section name="BIRDS & BUSH"
text="content/text/description1.txt"
url="http://www.macromedia.com/"
/>
<section name="LAST MILLENIUM"
text="content/text/description1.txt"
url="http://www.flashforward2002.com/"
/>
<section name="LINKS"
text="content/text/description2.html"
url="http://www.erain.com/"
/>
<section name="CONTACT"
text="content/text/description3.txt"
url="http://www.friendsofed.com/"
/>
</PORTFOLIO>
My question:
I want only ABOUT, LINKS, and CONTACT buttons to load the variable display text. When, DESERT, BUSHFIRE, BIRDS, and LAST button is released it will unloadVariable and do things like load external file (jpg, swf, etc).
I have tried to change the xml structure but it doesn't work. Can someone help me...pleaaaaaaaaase.
Unload & Load Variables In Same String..?
ok ive got a button that has the following code
on (release) {
unloadMovie("TEXT");
}
on (release) {
_root.mtClip.loadMovie("MOVIE.swf");
}
on (release) {
loadVariables("presentation.txt", "TEXT");
}
but it only ends up loading the MOVIE file...the Text file doesnt show....
Ive also got this on the final frame of my timeline (its a website)
loadMovie("reel.swf", "mtClip");
loadVariables("PRESENTATION.txt", "TEXT");
there must be something conflicting with the loading of the text file when u click the button but im not sure...new to actionscript...
BTW I'm using Flash MX
Thanks in advance!
*and thanks to the people of the forums for helpin me understand actionscript*
'unload' Or 'clear' All Of The _root Variables
Is there a quick way to 'unload' or 'clear' all of the variables I have defined on the _root level (i.e. _root.companyName )? I am trying to dynamically load information from a MySQL database, but I do not want to keep the information in the _root variables all of the time, or it will slow down my clients computer by storing everything in memory. There are certain key points within my movie that I would like to "unload" or "clear' all of my variables to improve performance. Any help would be appreciated! Happy Holidays!
Unload A Movie Clip Instance? Not Unload Movie
I'm new to this so probably doing it totally wrong, anyway....
I've go 4 buttons with 4 movie clip instances behind them. They are menu buttons eg About Us, contact Us, Products and Departments. When I click on "aboutus" it sets the mc "aboutus" playing which opens a tv screen graphic and then added the text for the profile of the company. This is fine. However, I now want to click on the "contactus" button which should unload or made the "aboutus" mc disappear and load the "contactus" tv screen and text contained in the "contactus" mc instance. Currently whenever I click on another button then just load on top of each other.
Any help appreciated.
How To Unload
When i close the Internet explorer window i want to remove the flash animation automatically from the cache loaded in that window of internet Explorer.
Not An UNLOAD
HI Flashs
I have this big (4 me) problem with my homepage. It is when i try to load another flash.swf from the ones runnin' its like the ones running not disaperes. Its running in the back. An the .txt can not display on my scroller in the new load. I can tell you that this is not working:
on (release) {
loadMovieNum ("menu_eng.swf", 1);
}
** this is on a grafh that is dif. as a button **
From Denmark
Tony.
Unload Mc
If I have a MC with buttons within it, I click on lets say(services) to load another MC within it, then I decide to click on (clients) , how do I make the (services) MC unload and the (clients) MC appear?
Unload
Hi .. Ive use this to load the movie
on (release) {
loadMovieNum("panorama2.swf", 10);
}
HOW DO I UNLOAD IT
:-) PAUK
Ok, How Do I Unload It?
I figured out how to load a clip from a remote source and place it where I want with this code:
this.createEmptyMovieClip("mc",2);
mc.loadMovie("movie.swf");
this.onLoad = function() {
setProperty("mc", _x, 100);
setProperty("mc", _y, 100);
};
stop();
How do I get the clip to unload once it's done playing?
[Edited by willi-jay on 07-11-2002 at 12:07 PM]
Unload
Not sure why this won't work:
on (release) {
unloadMovie(_root.holder);
}
When i press a button, i'd like to clear whatever is in _root.holder so i can replace it with a new .swf.
Any ideas?
Thanks!
Unload Itself
If I have an holdermovie.swf that has an action in it to load logomove.swf onto layer 10 (of holdermovie.swf) is there a way to either:
1. Place an action in the logomove.swf that tells it to unload itself from the holdermovie.swf?
or
2. is there an action that can be placed in the holdermovie.swf that will wait for the logomove.swf to complete and then unload it?
Unload Swf From Mc
hi,
i have button to load in a .swf into a target mc on my main scene. I have a button in this swf that closes this swf.
I know need an action at the end of the .swf that unloads it completely from the target Mc.
This is so that the user can click the button again and it will load the swf again.
Thanks for any help
Unload Jpg
Hi,
i load a jpg and unload?
The script for load jpg:
------------------------------------------------------------------
function load_jpg_or_swf(targetMC, jpgURL) {
targetMC.loadMovie(jpgURL);
attachMovie("loader", "loadMC", 1000);
loadMC.loadtarget = targetMC;
loadMC.onEnterFrame = is_loaded_results;
}
function is_loaded_results() {
this.proportionloaded = this.loadtarget.getBytesLoaded()/this.loadtarget.getBytesTotal();
this.percentage = this.proportionloaded*100;
this.displaypercentage = Math.Floor(this.percentage)+" %";
trace("LOADING "+this.displaypercentage);
if (this.proportionloaded == 1) {
trace("LOADED!");
this.removeMovieClip();
}
}
this.createEmptyMovieClip("MC_to_load_into", 1);
yourJPGurl = "1.jpg";
load_jpg_or_swf(MC_to_load_into, yourJPGurl);
------------------------------------------------------------
Thanks
Unload Except ME /URG Pls
hi
I am loading (attaching) movie in different mc from different buttons using
attachMovie("name","new_name",1);
but I want to put here one more script before attachMovie, it's like unload any movie attached except me.
unloadMovie(" ") will unload me as well.
Unload Please
I loaded a .swf file into a blank mc of my movie. From here how would I close this mc. The loaded mc is loaded externally using the folloing code
loadMovieNum("photo.swf", blank);
this._x = -40;
this._y = 10;
Unload Swf
Hi there,
In my main swf i have 4 buttons.They each load in sound in level1 on release of the button.code is like this:
// button1 for song 1
on(release){
_level1.unloadMovie(); // empty old song from level 1
loadMovieNum("soundloop1.swf",1); // load new song in level 1
}
Problem is I want to have a sound on/off button in the main swf.When I hit the sound button sound into level 1 should be unloaded. When I hit one of the 4 buttons it shoud prevent from loading sound into level 1.When I hit the sound button again everything should be back to normal.
How do this.Must be somekind of if statement. Hope someone can help out.Really need this to work.Big thx in advance.
Pls .. Pls .. Pls .. Unload My MC ..
hi everyone ..
i have one simple question ..
how do i unload a movie clip after loading another movie clip (MC) ..
the situation is like this ..
i have 2 buttons and when i click on the first button a MC will appear on the screen ..
then when i click on the second button, another MC will appear..
the thing is that i want the first MC to unload automatically when the second MC is loaded ..
currently i have to manually close the first MC after that second MC appeared ..
simple isn't ..? so pls tell me what action script should i use for that purposes .. i'm running out of time here .. so pls pls pls ..
thanx in advance ..
How To Unload MC .. Pls Help Me ..
hi everyone ..
i have one simple question ..
how do i unload a movie clip after loading another movie clip (MC) ..
the situation is like this ..
i have 2 buttons and when i click on the first button a MC will appear on the screen ..
then when i click on the second button, another MC will appear..
the thing is that i want the first MC to unload automatically when the second MC is loaded ..
currently i have to manually close the first MC after that second MC appeared ..
actually i'm having more than 2 buttons ..
the situation above is just an example ..
so what should i do if i have .. let say 10 buttons ..
simple isn't ..? so pls tell me what action script should i use for that purposes .. i'm running out of time here .. so pls pls pls ..
thanx in advance ..
(this is a repost Q)
Unload
This is the script on my buttons:
on (release) {
// _root.loadLevel=10;
_level0.loaderFunction("anypages.swf");
}
This is script on frame 1:
loadLevel = 10;
function loaderFunction(file) {
// this function is called in each page
loadLevel++;
loadMovieNum(file, loadLevel);
}
function deletePreviousLayer() {
unloadMovieNum(loadLevel-1);
}
loadMovieNum("page1.swf", loadLevel);
// this is the first that is loaded
stop();
-----------------------------------------------------------------
Question -- How do I unload "Mail.swf" on all buttons?
-sweetz
Unload This Box
can i unload dynamic text from a mc?
cheers rat
_root.weighttext.loadVariables("leads_sd_weights.t xt");
Need To Unload?
Hi everyone.
I am loading various external SWF (containing video) files into the same blank movie clip. The external files simply replace each other in the blank movie clip on button release -- it seems to work fine.
Should I place "unloadMovie" in the button script to get rid of the currently playing external file, or am I ok just having the files replacing each other in the blank MC? Some computers I test on seem to get loaded, and the (video) files will stop cold. I wonder if I need to REMOVE them instead of REPLACE them...
Here is the script I'm using:
on (release) {
_root.name.attachMovie("ox2",name,1);//loads something from library
_root.loadVideo.loadMovie("ox3.swf");//external file loaded here
stopAllSounds();
}
Any thoughts are greatly appreciated.
Pug
Unload Swf
Is there a way to insert a swf into Dreasweaver and have the Flash player close when the swf finishes playing? (unLoadMovie() removes the swf but leaves the Flash player running)
I’d like to build a complete html page. Use javascript (js file) to load the swf over top of the html and when the swf finishes playing, remove it (movie and player) from the screen so that the html beneath is displayed.
Thanks
Unload Itself?
i have a movie and i have another movie loading into it. and in the second movie i have a button. how do i get that button to unload itself from the origional movie?
thanx
austin
UnLoad
Timeline>
site>
banner>
Symbol 13>
Button
On the site timeline I...
dropZone.loadMovie("http://www.site.com/home.swf", 1)
Now, I want Button to unload that movie and load another. How do I do that...by using _level? If so, what level is it and how do I figure that our for the future?
Unload Swf?
Hi, is there a way to 'unload' swfs? I use this script to load the external swf:
loadMovie("over.swf", 1);
But when I want to go from "over" to "photo" like this:
loadMovie("photo.swf", 1);
It's going very slow and the swfs start running through each other, any help on this? And/or other solutions?
Thanks!
Unload A Mc
I have used loadmovieNum to load movies(swf) into a shell. The movies all load fine,except when one movie is unloaded it has a Movieclip embedded and the movie clip stays in the backround of the next movie loaded.
How do I get this movieclip to unload when the movie(swf) it is in unloads?
Please help...
Unload MC
OK I have a movie with multiple MC's and buttons in it. Right now if you click on two buttons then both MC's will load on top of each other. I would like to make it to where if you click on a button then a MC will load, but then if you click on another button, the 1st MC will unload and the next MC loads. What would the script look like?
Unload Help Please
think its a stupid question, but i cant seem to get it right...
Im trying to unload an image from a loader component that has been uploaded into a combobox (using the filereference upload thing) and from there into the component. Problem is that i can remove the value from the combobox, but when the user uploads a new picture with the same name as the first, it still shows the first picture... I need to unload it from the loadercompunent somehow, but cant get the unload part to work...
any ideas are welcome!
Unload?
I have thumbnails loading with this code:
onClipEvent(load) {
myNumber = 1;
}
on(release){
_root.myPicLoader.contentPath = ("pics/1.jpg");
}
If I'm clicked on the 1st thumbnail, the 1st thumbnail highlights. If I go to another category, the thumbnails disappear (which is what I want).
But if I go back to the category that has the thumbnails, the 1st thumbnail is still highlighted. What code do I use to reset the thumbnails so that none are selected / highlighted?
The thumbnails are all in a movie clip "thumbHolder_mc" - Thanks!
Unload?
Hi, I am loading thumbnails in one of my buttons.
When I click on button #2, I want the xml thumbnails to load.
When I click on button #1, I want the thumbnails to disappear.
I did this by making the visible=false.
The problem is, if I go back to button #2, the thumbnails are there for a half of a second before they start loading again. I have them loading in order, so at first you see all 20 thumbnails, then they disappear and start loading.
Do I need to have some code where they unload, then reload?
Thanks!
How To Unload An Swf
hi, i built my website so that there is an intro scene, and every time someone presses a button from the menu a new swf is loaded into the interface. This also means that my intro scene which is also "home" has movies ontop of it.
problem when someone presses on home now, there is still the movie intop of it, and i dont know how to unload it?
you can see what i mean here
www.frescomaster.eu
Can A SWF Unload Itself?
Is it possible to load a SWF in a mainfilm and when the user click on the loaded SWF unload it and then let the mainfilm now it?
How To Unload ?
Hi…
I am using this code to load text from a xml file
Code:
XML.prototype.ignoreWhite = true;
var audiolist_xml = new XML();
audiolist_xml.load("total.xml");
audiolist_xml.onLoad = function(success) {
if (success) {
eachTrack = this.firstChild.childNodes;
_global.totalTracks_streets = eachTrack.length;
trace("inside");
m_total_songs = totalTracks;
trace(_global.totalTracks_streets);
var i = 0;
….
}
};
So it is loaded… The question is: how to UNLOAD it when I don’t need it anymore and by doing this, free some memory that I need to use…
Or basically, how to FREE memory from that xml load?!
Thanks a lot,
Cheers.
Leo.
Unload();
Hello.
Does any one know the code to unload an UILoader and a TileList once it id loaded?
I'm getting one image one top of the other.
thanks
Unload Flv
Hello,
Just a quick question.
is it possible to unload .flv files from your swf?
thanks for your time.
regards,
Witzak
Unload Xml
hi,
is there a function to unload an xml file ?
thanx
How Can I Unload Swf With Flv When Done
Please Help - What is needed to unload my swf when its flv ends.
ActionScript Code:
stop();
fscommand("fullscreen","TRUE");
var myLoader:Loader = new Loader()
hClip.addChild( myLoader )
intro_btn.addEventListener(MouseEvent.CLICK , clickIntro)
function clickIntro ( evt ){
myLoader.load( new URLRequest("intro2.swf") )
}
How To Unload
I Load the swf files from external and move that loaded swf to one MovieClip.
i want remove that load event or movieclip when i want to load another swf into that movieclip.
Unload Swf
I would like to know how I can give some extend to the following function...
I externally load swf, which all have a unload button and the following code applied to it:
ActionScript Code:
closebutton.addEventListener(MouseEvent.CLICK, unloadFunction);
function unloadFunction(event:MouseEvent) {
dispatchEvent(new Event("UnloadMe", true));
}
function kill():void {
stage.removeEventListener(MouseEvent.CLICK, unloadFunction);
}
Then, in my main swf that loads those external swfs, I have the following code:
ActionScript Code:
stage.addEventListener(MouseEvent.CLICK, clickButton);
function clickButton(e:MouseEvent):void {
switch (e.target) {
case this.b1 :
loadVideo(new URLRequest(extSWF[0]));
break;
case this.b2 :
loadVideo(new URLRequest(extSWF[1]));
break;
// etc.
}
function loadVideo(myrequest:URLRequest):void {
var myloader:Loader=new Loader();
myloader.addEventListener("UnloadMe", unloadFunction);
myloader.load(myrequest);
addChild(myloader);
}
Now, what I want to do is to unload any external swf that might be already loaded and displayed in the main swf; in case the guy who's viewing my page does not click the unload button in the external swf.
THANKS !!!
Unload Yourself
Hi
I searched on this, honest, just got even more sidetracked...
Quick question: is it possible for a movie to unload itself?
Here's the scenario - I'm loading small movies into a "holder" mc on the main timeline of my main movie. I want the wee loaded movies to unload themselves when they're done playing. Is this possible or do I need to unload them from the main movie?
Any help/pointers appreciated,
TIA
D
Unload .swf
im trying to remove the mail.swf when leaving the btn_3, but it just want work. the loadMovie works fine, it pops-up just as I want it to, but it want go away when I want it to.
PHP Code:
onClipEvent (enterFrame) {
if (_root.btn_3, hitTest(_root.head)) {
this.createEmptyMovieClip("mailmc", 1);
mailmc.loadMovie("mail.swf")
this._x = "230";
this._y = "190";
} else {
mailmc.removeMovieClip();
}
}
Unload ?
To see what I'm talking about, create a new Flash MX movie and copy the following code into the first and only frame:
-----------------------------------------------------------
buildButton = function () {
createEmptyMovieClip("button_mc", 10);
button_mc._x = 0;
button_mc._y = 0;
button_mc.lineStyle(1, 0x000000, 0);
button_mc.beginFill(0x000000, 100);
button_mc.lineTo(100,0);
button_mc.lineTo(100,100);
button_mc.lineTo(0,100);
button_mc.lineTo(0,0);
button_mc.endFill();
};
buildBox = function () {
createEmptyMovieClip("box_mc", 5);
box_mc._x = 200;
box_mc._y = 200;
box_mc.lineStyle(1, 0x000000, 0);
box_mc.beginFill(0xCCCCCC, 100);
box_mc.lineTo(300,200);
box_mc.lineTo(300,300);
box_mc.lineTo(200,300);
box_mc.lineTo(200,200);
box_mc.endFill();
};
buildButton();
buildBox();
button_mc.onRelease = function() {
unloadMovie("_level"+5);
}
-----------------------------------------------------------
So why doesn't clicking the black button unload the box_mc movie ?
Thanks,
Stephen.
Do I Need To UnLoad?
I have multiple .swf's being loaded at the viewers choice into an MC. Do they need to be unloaded before the next one is chosen and loaded. Does this make a difference to performance?
Also, if this is the case how would i unLoad a movie, by the viewer clicking the next button to load the next .swf into the MC. Basiclly i think i'd need to unLoad whatever .swf was in the MC using one generic script before the loadMovie command was activated by the button.
If the button code is:
ActionScript Code:
on (press) {loadMovie("p_landscape.swf",_root.graphics);
Would I need to add some unLoad script before this?
How would I tell it to unLoad 'any' movie from the MC?
Hmm???
Unload
Hi friends,
I created movies inside a movie clip
menu_mc.createEmptyMovieClip("thumbnail_mc"+i,i);
now I want to delete or remove all the moieclips inside the menu_mc
How To UnLoad FLV
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("
|