Unloading A Child Movie
Hi all,
The first movie is "Home.swf" and I loaded another movie called "childOne.swf" in to the home.swf by this command _root.holder.loadMovie("childOne.swf");, it works fine.
But i need to remove the "childOne.swf" , when clicked on that ... How ?
i tried with this "removeMovieClip("childOne.swf") But its giving error..
Plz help me ..
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 07-01-2003, 09:10 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Unloading Sound In A Child SWF
I have a parent swf that I'm loading child swf's into. I'm using a next button to load and unload the swf's. One of the child swf's has 40 frames of animation. On the 40th frame I'm loading an flv using a video player.
The problem comes when I run the parent swf and I use the next button to skip that child swf. The sound from the flv starts to play on the next swf.
I put the following code into the child swf but because the unload command is in the parent it only acts on the first frame of the child swf.
//I use this code to close the netStream and Net Connection.
function closeAllStreams(evt:Event) {
ns.close();
nc.close();
}
loaderInfo.addEventListener(Event.UNLOAD, closeAllStreams);
//I use this code in the parent to unload the child when the next button is pressed
smartGraphicLoader.unload();
Is there code that will cause the unload to reach all the way to the 40th frame to unload the flv?
//This is the code I'm using to load the
//flv into the video player on the 40th frame of the child swf
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
theVideo.attachNetStream(ns);
ns.play("Hippo_Dog2.flv");
Loading And Unloading AS2 Child From AS3
Hello!
I have this really frustrating problem: I load an AS2 file in an AS3 file, but then I can't unload it. I have to unload it by clicking this sort of 'Home' button in the AS2 file. I've tried the this.parent.parent.removeChild method, I've tried ActionScriptBridge which is buggy as hell. I just have no ideea what to try anymore. It's killing me and I have to finish this thing until tommorow!
Thanks,
Andrei
Deleting Child Movie Clips In Parent Movie Clip
ok so I when I click the bt1 I want it to make the home_text visible and remove all of the movie clips within the CreateXMLGallery function. But when I do gallery.removeMovieClip() it only deletes the gallery and none of the other movie clips that are created within the gallery. Any ideas why? here is the code.
HTML Code:
stop();
/***********Button Functions*************/
launch_mc._visible = false;
easeSpeed = 5;
slider_mc.onEnterFrame = function() {
this._x += (xMove1-this._x)/easeSpeed;
};
bt1.onRollOver = function() {
bt1.blendMode = "invert";
};
bt1.onRollOut = function() {
bt1.blendMode = "normal";
};
bt1.onPress = function() {
xMove = bt1._x;
};
bt1.onRelease = function() {
gallery.removeMovieClip();
home_txt._visible = true;
};
bt2.onRollOver = function() {
bt2.blendMode = "invert";
};
bt2.onRollOut = function() {
bt2.blendMode = "normal";
};
bt2.onPress = function() {
xMove = bt2._x;
};
bt2.onRelease = function() {
gallery.removeMovieClip();
home_txt._visible = false;
createXMLGallery(webXML);
};
bt3.onRollOver = function() {
bt3.blendMode = "invert";
};
bt3.onRollOut = function() {
bt3.blendMode = "normal";
};
bt3.onPress = function() {
xMove = bt3._x;
};
bt3.onRelease = function() {
gallery.removeMovieClip();
home_txt._visible = false;
createXMLGallery(interactiveXML);
};
bt4.onRollOver = function() {
bt4.blendMode = "invert";
};
bt4.onRollOut = function() {
bt4.blendMode = "normal";
};
bt4.onPress = function() {
xMove = bt4._x;
};
bt4.onRelease = function() {
gallery.removeMovieClip();
home_txt._visible = false;
createXMLGallery(avXML);
};
bt5.onRollOver = function() {
bt5.blendMode = "invert";
};
bt5.onRollOut = function() {
bt5.blendMode = "normal";
};
bt5.onPress = function() {
xMove = bt5._x;
};
bt5.onRelease = function() {
gallery.removeMovieClip();
home_txt._visible = false;
createXMLGallery(designXML);
};
/**********End Button Functions**********/
/**********Load XML files**********/
var webXML:XML = new XML();
webXML.ignoreWhite = true;
webXML.onLoad = function(success) {
if (success) {
//trace("web XML File Loaded");
}
};
webXML.load("web.xml");
var interactiveXML:XML = new XML();
interactiveXML.ignoreWhite = true;
interactiveXML.onLoad = function(success) {
if (success) {
//trace("interactive XML File Loaded");
}
};
interactiveXML.load("interactive.xml");
var avXML:XML = new XML();
avXML.ignoreWhite = true;
avXML.onLoad = function(success) {
if (success) {
//trace("audio video XML File Loaded");
}
};
avXML.load("audiovideo.xml");
var designXML:XML = new XML();
designXML.ignoreWhite = true;
designXML.onLoad = function(success) {
if (success) {
//trace("audio video XML File Loaded");
}
};
designXML.load("design.xml");
/**********XML files loaded**********/
/**********Create the Gallery*******/
function createXMLGallery(whichXML) {
var gallery:MovieClip = createEmptyMovieClip("gallery", getNextHighestDepth());
gallery._x = 70;
gallery._y = 170;
var numImages = whichXML.firstChild.childNodes.length;
var spacing:Number = 60;
var columns:Number = 3;
for (var i:Number = 0; i<numImages; i++) {
this.proj_name = whichXML.firstChild.childNodes[i].firstChild.firstChild.nodeValue;
this.proj_type = whichXML.firstChild.childNodes[i].firstChild.nextSibling.firstChild.nodeValue;
this.thumbHolder = whichXML.firstChild.childNodes[i].firstChild.nextSibling.nextSibling.firstChild.nodeValue;
this.picHolder = whichXML.firstChild.childNodes[i].firstChild.nextSibling.nextSibling.nextSibling.firstChild.nodeValue;
this.proj_media = whichXML.firstChild.childNodes[i].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nodeValue;
this.description = whichXML.firstChild.childNodes[i].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nodeValue;
this.proj_link = whichXML.firstChild.childNodes[i].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nodeValue;
this.thumbViewer = gallery.createEmptyMovieClip("thumb"+i, i);
this.thumbViewer._x = (i%columns)*spacing;
this.thumbViewer._y = Math.floor(i/columns)*spacing;
this.thumbLoader = this.thumbViewer.createEmptyMovieClip("thumbnail_image", getNextHighestDepth());
this.thumbViewer.description = this.description;
this.thumbViewer.picHolder = this.picHolder;
this.thumbViewer.proj_link = this.proj_link;
this.thumbViewer.proj_name = this.proj_name;
this.thumbViewer.proj_type = this.proj_type;
this.thumbViewer.proj_media = this.proj_media;
this.thumbViewer.whichXML = whichXML;
this.thumbLoader.loadMovie(this.thumbHolder);
this.thumbViewer.onRollOver = function() {
var proj_name = this.proj_name;
captionFN(true, proj_name, this);
this.onRollOut = function() {
captionFN(false);
};
};
this.thumbViewer.onRelease = function() {
launch_mc._visible = true;
var url = this.proj_link;
var type = this.proj_type;
var media = this.proj_media;
launch_mc.onRelease = function() {
if (type == "Website") {
getURL(url);
} else if (type == "Interactive") {
trace(url);
fscommand("exec", url);
} else if (type == "Design") {
var shade:MovieClip = createEmptyMovieClip("shade", getNextHighestDepth());
with (shade) {
beginFill(0xFFFFFF, 75);
moveTo(0, 0);
lineTo(Stage.width, 0);
lineTo(Stage.width, Stage.height);
lineTo(0, Stage.height);
lineTo(0, 0);
}
shade.useHandCursor = false;
shade.onRelease = function() {
trace("OUCH");
};
shade.onPress = function() {
trace("OUCH");
};
var imageViewer:MovieClip = attachMovie("imageviewer", "imageView", getNextHighestDepth());
imageView._x = Stage.width/2-imageViewer._width/2-10;
imageView._y = Stage.height/2-imageViewer._height/2;
var closeMovie:MovieClip = attachMovie("close", "closeMov", getNextHighestDepth());
closeMovie._x = 568;
closeMovie._y = 75;
closeMovie._width = 48;
closeMovie._height = 19;
closeMovie.onRollOver = function() {
this._alpha = 50;
};
closeMovie.onRollOut = function() {
this._alpha = 100;
};
closeMovie.onRelease = function() {
imageView.removeMovieClip();
closeMovie.removeMovieClip();
shade.removeMovieClip();
thumb.removeMovieClip();
};
var thumb:MovieClip = createEmptyMovieClip("thumb", getNextHighestDepth());
thumb.attachMovie(url, "urlofmovie", getNextHighestDepth());
thumb._x = Stage.width/2-thumb._width/2-10;
thumb._y = Stage.height/2-thumb._height/2;
} else if (type == "Video") {
fscommand("exec", url);
}
};
var thumbInfo:MovieClip = createEmptyMovieClip("thumbinfo", getNextHighestDepth());
//Description field attributes
createTextField("desc", getNextHighestDepth(), 555, 170, 200, 300);
desc.border = false;
desc.multiline = true;
desc.wordWrap = true;
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "Verdana";
my_fmt.size = 12;
my_fmt.align = "justify";
desc.text = this.description+"
Media: "+media;
desc.selectable = false;
desc.textColor = 0xffffff;
desc.setTextFormat(my_fmt);
//End description field attributes
thumbInfo.loadMovie(this.picHolder);
thumbInfo._x = 315;
thumbInfo._y = 200;
};
}
}
/**************End Gallery*******************/
Dynamically Duplication Movie And Its Child Movie Clips
Hi all,
I have a movie clip in my library. This movie clip contains other movie clip also.
Now I want to bring this movie clip to the stage. I have used attachmovie method to do this. Whatever the new name, I have assigned to the movie clip in the AttachMovie method works well. But the movie clips inside that movie clip doesn't have the name.
How to name the movie clip and all its child movie clip.
Thanx
Nag
Loading A Grandchild Movie Into A Child Movie From Parent
hello - Can I load a grandchild movie from the parent? Here is what I have: I have a main move, a child movie and a "grand child" movie.
I want to click a button on the parent ( which is my root) and load the child into a container on the main, then automatically load the grandchild into a container in the child movie. I dont want any scripting in the child movie though. I want the entire thing to be handled from the main root movie.
Can I do this an how? Ive tried:
var mcl:MovieClipLoader = new MovieClipLoader();
mcl.loadClip("child.swf",childHolder);// childHolder is a container in the main.swf
mcl.loadClip("grandchildMovie.swf",grandchildHolde r);//grandchildHolder is a container in the child.swf.
Any advice would be greatly appreciated.
Im running flash 9 from cs3 web bundle.
Accessibility Tabbing From Parent Movie Into Child Movie
Using JAWs, I can tab around in either parent or child movie, but can't get the tab to move from parent movie into child movie.
After tabbing to instance's tab 3 in parent movie, I can't get the tab key to go to instance's tab 4 in child movie. Accessibility panel check boxes for both movies are all checked and the appropriate actionscripting is in the first frame of both movies.
Any ideas???? Thanks.
Oop Question: A Simple Way To Access Methods In Child Classes From Other Child Class
hi All, I have another oop question.
I'd like to call a method in a child class from another child class.
I'd like to do it without instantiating the other child class...
an example will be easier to see what I mean
document class
ActionScript Code:
package
{
import flash.display.*
public class Tester extends MovieClip
{
var ch1:Child1;
var ch2:Child2;
function Tester()
{
ch1 = new Child1();
ch2 = new Child2();
}
}
}
child 1
ActionScript Code:
package
{
class Child1 extends MovieClip
{
function Child1()
{
trace("Child1 is working");
}
public function hello()
{
trace("Child1 Hello function")
}
}
}
child 2
ActionScript Code:
package
{ import flash.display.*
class Child2 extends MovieClip
{
function Child2()
{
trace("Child2 is working");
//Tester.ch1.hello();
}
}
}
the commented line in Child2 is what I'm asking about. is there any way to do this without defining the Tester class in Child2?
... I mean, without saying : var tstr:Tester = new Tester(); in Child2... and then calling the function via tstr.hello();
thank in advance guys..
Stop FLV Playback In Child When Removing Child (or At Least Silence Audio)
I'm working on a flash site with a number of different "states" (home, features, demo, etc.) each of which is a movie clip with its own actionscript, added as a child when requested, removed when the user chooses a new state.
One of the states plays short FLV videos. The problem is, when switching away from that state to a different state, even though the child is removed, the current video apparently keeps playing as I can hear the audio continuing on.
To demonstrate, the site is here. Click on "Demo", then play one of the videos and switch to a different state (home, features, whatever) while the video plays.
I'm trying to call a function in the child to stop video playback (first checking whether the function exists before trying to call it). The checking part works, but the function call is giving me a "call to possibly undefined method" error when publishing. Probably because I'm calling it the wrong way.
Here's the "remove child" code used after switching to a new state:
Code:
var child:DisplayObject;
while(stateContainer.numChildren > 1)
{
child = stateContainer.getChildAt(0);
if ('stopPlayback' in child)
{
trace('exists');
child.stopPlayback();
}
else
{
trace('does not exist');
}
stateContainer.removeChildAt(0);
}
Can you tell me a better way to do this? I find it strange that it traces "exists" when the function exists, but still complains that child.stopPlayback() (might not) exist.
Variables Of A Child Not Visible To A Function In The Child Called From Its Parent ?
sorry, this is a repeat thread, but couldn't change the title on the old one, someone must know the solution to this problem, I just dont think i worded it correctly enough for someone who knew what i was talking about to notice last time.
Ive got a movieclip that creates and adds a child mc then calls a function in the new mc. the function runs, but the local vars for the new mc aren't visible to the function. Is there a special way to call a function so that its scope is in the child, not in the parent ? ( i assume thats where it is, even though a trace of this returns the correct object type )
ie:
[Parent Clip]
--[child clip: movGraph]
--variable ( var thegraph:MovieClip = this; )
--[function loadMe]
--(trace (theGraph); )
calling movGraph.loadMe spits out undefined or null object error, as opposed to
[object movGraph]
obviously i want to do a whole lot more than trace out the object type, and trace(this) in the function returns [object movGraph]. the variable "theGraph" declared in the child isn't available or its null somehow.
Can anyone tell me where I'm going wrong ? - any help would be appreciated. at the moment I'm having to add all the code in the function instead of the "root" of the child. which really defeats the point.
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 A Movie-itself
I have 2 movies: MoviaA.swf and MovieB.swf. Inside movie A there is a button that when clicked will load MovieB.swf onto layer 10. Inside MovieB.swf is a button that when clicked, I want to unload itself (MovieB.swf) from MovieA.swf. How can I accomplish this?
Unloading A Movie From Within Itself
I have a movie [B.swf] which loads into an empty clip [empty] within a movie [A.swf]. Is it possible to unload movie B using a button within movie B? I'm trying various combinations but seem to be getting nowhere - if anyone out there knows what i mean, please reply....thanks!
Unloading A Movie
ok, when you click on a button in my site, it will load a movie into the main stage. what actions would I put in a button to make that loaded movie disappear? I tried "unload movie" but it unloads the whole site and not just the movie. any one can help?
Unloading A Movie
Hi I'm using Flash MX. I dropped a movie onto the stage as a short intro and now I want to unload it the problem is I can't get it to go away. I tried the unload command but it's still there. What am I doing wrong? Is there any other way to get rid of a movie clip?
Any help would be greatly appreciated.
Jer
Unloading A Movie
I need some help unloading a movie. I have a "loader" movie that plays and calls my web page. I am using the command:
loadMovieNum("KSWeb.sfw",1) in my loading movie to call and load my web page. In my web page I am using the command:
unloadMovie("loader.swf"), but as soon as I do that my web page does not display. If I take it out of the web page then the loader restarts and my web page flickers. Can someone help me please.
Thanks
Unloading A Movie
ok lets see if I can explain clearly..
I have a movie running in level 0 with a button that loads another movie onto level 1. On this Level 1 movie I have a button that closes it by using the "unload level 1 movie". What I want to be able to do is have the original level 0 movie goto and play at a certian frame.... any suggestions (something tells me this is not as hard as I think).
help!...... Glenn
Unloading A Movie
Hey, I loaded a swf into a target, and I am trying to make a button that unloads itself from the target. I want to do this because when I load the swf into a target on my main swf, I lose control of all of the buttons on my main swf. I think it has something to do with the fact that the swf I'm loading has a drag action(rotating car)......anyways, can someone help me? Thanks.
Help Unloading Movie
I have a menu with five buttons. ineed to be able to click each button in the menu unloading the currently loaded movie by animating it out then animating the new movie in. Any clues?
Unloading Movie
Hi I've few problem in unloading .swf movie from an application file. I've created following files.
Start.exe
firstmovie.swf
secondmovie.swf
thirdmovie.swf
From "start.exe", i'm loading "firstmovie.swf" using script as follows:
on (release) {
loadMovieNum("firstmovie.swf", 1);
}
From "firstmovie.swf", i'm loading "secondmovie.swf" as follow:
on (release) {
loadMovieNum("secondmovie.swf", 1);
}
From "secondmovie.swf", i'm loading "thirdmovie.swf" as follow:
on (release) {
loadMovieNum("thirdmovie.swf", 1);
}
From "thirdmovie.swf", I want to come back to a scene(called "home") in the "start.exe". Can anybody tell me what is the proper solution.
PLS HELP ME!!!
Unloading A Movie
I have a main movie in which I load other movie clicps (.swf) files.
On the external .swf files that I load into the main movie, I have a button on the .swf file that I added the unload code to.
on (press) {
gotoAndPlay(5); Goes and play a transistion in the main movie
unloadMovie("test.swf"); Then it unloads itself from the main movie
}
Guys I have no idea if I am making sense here. all I want to do is unload what I have loaded into the main movie by attaching the code to the external file to be loaded in.
Unloading A Movie
Greetings,
I'm trying to load and unload an external movie by using an empty movie clip. For example I have an empty movie clip with the instance name 'load' and when I press a button my movie called 'testmov.swf' appears within it.
This works fine but when it comes to unloading the movie I can't seem to make it go away. This is the script I am using;
load button
on (release) {
_root.loader.loadMovie("testmov.swf");
}
unload button
on (release) {
_root.loader.unloadMovie;
}
Any suggestions?
Many thanks
SA
Unloading A Movie
My flash movie will be positioned absolutely in my HTML page. Underneath it will be some other components (images and text).
The flash movie will act as an intro, and I want the movie to unload itself after it is finished playing, therefore revealing the components underneath it.. Is this possible? If so, how can I get the movie to unload itself and completely disappear from the page?
thanks!
Movie Unloading Itself.
I have two Flash files, parent.swf and child.swf.
I want the parent to load the child movie.
I then want to have a button on the child that unloads itself.
In the child I have the following code:
button1.onRelease = function()
{
unloadMovie(this._parent);
}
Is the above a good way to do what I want?
When the movie unloads, the dummy movie onto which I am loading onto 'seems' to dissapear. When I load the child movie again, it still seems to load fine.
I just wanted to double check that everything was OK.
ANY feedback to the above would be REALLY appreciated.
(I've attached my files (MX2004) if anyone just for reference.)
Thanks.
OM
Unloading Movie
I am loading a swf movie into an empty movie symbol.
I'd like to have a button within the loaded movie that will unload itself from the main timeline.
How can i do this?
on (release) {
_parent.gbl_mc.unloadmovie;
}
i do that and it unloads everything in my master movie.
thanks for the help in advance.
Unloading A Movie?
I'm using this snippet of code
onClipEvent(load){
this.duplicateMovieClip("strip2",1);
}
this works great, but when my maintimeline progresses the MC "strip2" still duplicates itself even though it's not on the stage.
Is there a command to get this to unload permenntly either on button click or just a main timeline action?
Thanks for any help in advance
Unloading A MOvie
hey, I have this code to load a movie.
cuadro5.onPress = function () {
_root.createEmptyMovieClip("container", 1);
loadMovie("photo.swf", "container");
container._x = 100 ;
container._y = 200 ;
}
How can I unload this movie when I clik another button?
thank you!
Unloading Movie
I have created a main page which has 4 links using the code
loadMovie("/oli/home.swf", "_root.loadInTo");
this works fine and i even managed to stop the buttons working in the background. However i have a "X" button which i want to kill/unload/remove the loaded .swf e.g. in this case on release remove home.swf. I cannot get it to work.
unloadmovie does not work as i am in a different .swf, so there is not a loadInTo MC which it would be removing from. is there some kind of "kill or self-destruct" command i can use?
any help or further questions. thanks.
Unloading Movie
unloadMovie();
----
on (release) {
unloadMovie("areyouready.swf");
}
Yeah It doesn't work when I have it in a button lol.. somebody help?
[F8] Unloading A Movie
hey there,
we're building a website and we have it set up where both the intro to the site and the site itself are in a single master.fla which brings in both the intro swf and the site swf. Its working fine except that once the intro is done and the site is loaded, the intro won't go away. Is there a way to unload the intro movie that i'm not seeing... i've tried unloadMovieClip and removeMovieClip but none seem to work...we just need to know how to make the intro...disappear
thanks
Help Unloading Movie
Hi friends... Somebody Help me. i did a Snow falls effect in flash with actionscript. That Script is....
------------------------------------------------------------------------
init = function () {
width = 800;
// pixels
height = 600;
// pixels
max_snowsize = 10;
// pixels
snowflakes = 50;
// quantity
for (i=0; i<snowflakes; i++) {
t = attachMovie("snow", "snow"+i, i);
t._alpha = 20+Math.random()*560;
t._x = -(width/2)+Math.random()*(1.5*width);
t._y = -(height/2)+Math.random()*(1.5*height);
t._xscale = t._yscale=50+Math.random()*(max_snowsize*10);
t.k = 1+Math.random()*2;
t.wind = -1.5+Math.random()*(1.4*3);
t.onEnterFrame = mover;
}
};
mover = function() {
this._y += this.k;
this._x += this.wind;
if (this._y>height+50) {
this._y = -20;
}
if (this._x>width+20) {
this._x = -(width/2)+Math.random()*(5.5*width);
this._y = -20;
} else if (this._x<-20) {
this._x = -(width/2)+Math.random()*(5.5*width);
this._y = -20;
}
}
init();
------------------------------------------------------------------------
successfully i done it. but now i want to Unload all attached movie... I try some methods... but i cannt do..
plz somebody help me....
Help With Unloading A Movie
i have a movie clip acting as a button, and i'd like for it load a swf to an empty "container" clip on release and then within that swf have a button for the user to click to unload it. what action do i add to that button within the swf?
Movie Unloading Itself.
is there a way for having a loaded movie unload itself through action scripting?
i have a movie called "a.swf", loaded into a movie called "nest" into level 1.
When "M" amount of frames have been processed i want "a.swf" to unload from "nest". This is what I have tried, but to no avail.
ActionScript Code:
if (t >= m) {
_parent.unloadMovieNum(1);
}
Any suggestions? Cause i think i am out of ideas.
Unloading Movie
I have my main movie clip and then I have a load movie that then loads on top. This is fine however when the new swf loads on top of this the sound plays and you get double the sound.
How do you prevent this? You can't really unload the main swf becase you havent loaded it in the first place.
Help With Unloading Movie
So here's the situation.
I'm trying to create a flash movie that has a two buttons and a loader component.
One button will pull a video from one streaming source and load it using the loader, the other will pull from another streaming source and load it using the same loader.
When I click button 1 the stream loads up fine and in my FMS Admin console, I see the number of clients increase by 1. When I click button 2, the steam loads up and the total client increase again.
So basically, everytime I click the button, the number of clients increases even if I load the same stream over and over again. This will continue until I close the movie or the server limit is reached (I am currently using the development version of FMS).
My code is pretty simple.
It's as follows:
btn1.onPress = function() {
loader1.unload();
loader1.load("url1");
}
btn2.onPress = function() {
loader1.unload();
loader1.load("url2");
}
The issue here is that I can't get it to properly unload the movie so the connection with FMS remains. I've tried making button 1 load the streame and button 2 unload the stream, but no matter how much I press button 2, it would not unload and the stream will remain there running.
If anyone has any suggestions, it would be much appreciated.
Thanks.
Unloading SWF Movie
Hi,
I've been working on a CD-Rom presentation with Flash and so far I was mostly using AS1 and AS2 to built it. I started to learn some AS3 for a part of the presentation but now I'm running into issue, here's the main one:
I'm loading different SWF movie one on top of the other, and unloading them as needed, now this is very easy with AS1 (loadmovie and unloadmovie function are simple to use), but when I'm loading my file built with AS3 I can't figure out how to unload it. The AS3 movie is loaded on the Level 5, I just want to make sure that when I'm unloading the file it's not unloading everything else.
Can anyone help me.
Yann Poirier
Unloading Movie
WHat am I doing wrong.
I have a main movie lets call it main "A", I am loading in an "test.swf" file in to main movie "A", I want once the user finish viewing it they have the option to unload it - and be where they were.
This is what I did.
I append a button to test.swf - to unload itself once clicked. I used
on (release) {
unloadMovie ("fullstory.swf");
}
This does nothing at all.
So I tried this instead:
on (release) {
unloadMovie (0);
}
Well it works, but it unload everything including Main movie "A"
I don't know what I am doing wrong. I referrenced what I want to unload and it does not work..
Help .. anybody
Help Unloading Movie
Hi friends... Somebody Help me. i did a Snow falls effect in flash with actionscript. That Script is....
------------------------------------------------------------------------
init = function () {
width = 800;
// pixels
height = 600;
// pixels
max_snowsize = 10;
// pixels
snowflakes = 50;
// quantity
for (i=0; i<snowflakes; i++) {
t = attachMovie("snow", "snow"+i, i);
t._alpha = 20+Math.random()*560;
t._x = -(width/2)+Math.random()*(1.5*width);
t._y = -(height/2)+Math.random()*(1.5*height);
t._xscale = t._yscale=50+Math.random()*(max_snowsize*10);
t.k = 1+Math.random()*2;
t.wind = -1.5+Math.random()*(1.4*3);
t.onEnterFrame = mover;
}
};
mover = function() {
this._y += this.k;
this._x += this.wind;
if (this._y>height+50) {
this._y = -20;
}
if (this._x>width+20) {
this._x = -(width/2)+Math.random()*(5.5*width);
this._y = -20;
} else if (this._x<-20) {
this._x = -(width/2)+Math.random()*(5.5*width);
this._y = -20;
}
}
init();
------------------------------------------------------------------------
successfully i done it. but now i want to Unload all attached movie... I try some methods... but i cannt do..
plz somebody help me....
Unloading Movie And Then Some...
Last edited by kinkladze : 2006-03-08 at 16:46.
I'm loading some FLV files to a movie and want to be able to make them automatically hide when they end. Any ideas how i can do this other than embeeding in a timeline and using the visable coding?
Cheers
Unloading Movie
I am trying to do something I know is simple and must be staring me in the face - but am going bonkers trying to figure it out.
I have this script
on (release) {
loadMovieNum("try.swf", 1);
_level0._alpha = "50";
}
on (releaseOutside, rollOut) {
loadMovieNum("", 1);
_level0._alpha = "100";
}
it loads the external movie 'try' when I clip on various buttons and as you can see when I releaseOutside or rollOut it unloads it and set the alph of the main movie back to 100.
What I would like to be able to do is - load the movie and set the alpha to 50 (as I do) then when the movie try has played through, unload it and set the alpha to 100 without using the "releaseOutside or rollOut "
I know this is possible - I have tried using if (_framesloaded >= _totalframes) but don't know enough to refer it to the try movie in level 1
I would REALLY appreciate ysomeones help
Child Movie Control Parent Movie
My colleague is trying to work this out.
He has a main movie that calls a swf into itself. In essence it calls a menu into itself. This menu needs to control the parent movie. Can this be done?
Steven.
Fade From Child Movie To Parent Movie
Ok.. so - I have a parent movie which has loaded a second movie at level 1. Is there a simple way to have the following occur:
- hit a 'home' button within the second movie so that it plays around 20 frames to the end of it's timeline WHILE it goes to and plays from a specified frame in the parent movie?
What I'm after is a transitional fade from the child movie back to the parent; a sort of fade down of the child and fade up of the parent. At the end of the child fade it will unload itself.
Any suggestions? I need a quick solution!
Many thanks!
tonto
Moving A Duplicated Movie To A Child Movie
There must be a simple solution to this but I really can't find it. I'm loading an external SWF 'X' into movie clip 'A'. Then within movie 'C' inside movie 'B' inside movie 'A' I need to create 30 copies of movie 'X'. If i try to copy 'X' using duplicateMovieClip within 'C', the copies of 'X' sit inside 'A' and not 'C' where I need them. Can I movie the copies into 'C'? Can I create them in 'C' in the first place? Or do I need to use AttachMovie but if so, how do I LINK my dynamically loaded movie? Thanks
How To Replay A Movie From A Child Movie In Flash 5?
Hi
I'm using Flash 5 and I have a movie inside a movie where the replay button is placed. In the on release event I don't know what code to use. I've tried the following but it didn't work:
gotoAndPlay (1);
gotoAndPlay ("Scene 1", 1);
_root.gotoAndPlay (1);
_parent.gotoAndPlay (1);
And other variations of this, but nothing seems to do the job.
Could someone help with this please.
Thanks
Access Parent Movie From Child Movie
Hi,
Is it possible to access the Parent movie from a movie that is loaded within it?
Say i want a button in the child movie that goes to a certain frame in the parent movie?
Thanks guys..
Linking From Child Movie To Parent Movie
Hey there,
So, I have a little movie where I am trying to link from a child movie clip that is being loaded into a parent movie click. The way this is configured is that I have the parent movie clip, I choose a page and the page is being loaded into the loader. Now once the child movie loaded in the loader the navbar is no longer in the parent movie but in the child movie and I want to know how to control the parent movie with the child movie navbar. I want to send the parent movie to a different frame in the movie to either load the home page content or to load a different page...
I have been using this.
In my child movie i have 2 links and one transition so I am sending a variable and the variable should be loaded on the last frame of the transition:
Code:
Links:
on(release){
page = "bag";
gotoAndPlay("close");
}
Last frame:
MovieClip(parent).gotoAndPlay(page);
also tried
_root.gotoAndPlay(page);
and that is not working, now i am really really new at ActionScript and just dont get why it isnt working...
Help guys please,
Nick
RemoveChild? I Want To Remove The Previous Child Before Adding A New Child
I tinkered with AS3 a few months back, but don't have ANY of the old scripts and can't remember much.
I'm calling a method to add a new MovieClip to the Stage from the library, I've got that setup and working but each new instance overlay's the old one and doesn't replace.
I clearly need to removeMovieClip() but that is an AS2 function not AS3?
removeChild returns an error:
**
TypeError: Error #2007: Parameter child must be non-null.
at flash.display:isplayObjectContainer/removeChild()
at LukeSturgeon/loadPage()
at LukeSturgeon/navButtonHandler()
**
my two key functions are:
**
/**
* loadPage method
*/
public function loadPage(page_str:String):void {
removeChild(page)
var page:MovieClip = getPage(page_str);
///
page.x = padding_left;
page.y = padding_top;
this.addChild(page);
}
/**
* getPage method
*/
private function getPage(page_str):MovieClip {
var new_page:MovieClip;
///
switch (page_str) {
case "Profile" :
new_page = new Profile();
break;
case "Contact" :
new_page = new Contact();
break;
default :
new_page = new Work();
}
return new_page;
}
this version (minus the removeChild line) is viewable at http://www.lukesturgeon.co.uk/as3
any thoughts? it's probably so simple!!!
Unloading A .swf So The Main Movie Can Be Seen
I have my home page on the main timeline in the main movie of my flash show. When I try to get back there(after navigating to different areas), it dosen't do anything. It just stays put on whatever .swf that was loaded.
How do i get back to my main page or main timeline?
|