View comments | RSS feed

MovieClip.loadMovie()

Availability

Flash Player 5.

Usage

my_mc.loadMovie(url:String [,variables:String]) : Void

Parameters

url The absolute or relative URL of the SWF file or JPEG file to be loaded. A relative path must be relative to the SWF file at level 0. Absolute URLs must include the protocol reference, such as http:// or file:///.

variables An optional parameter specifying an HTTP method for sending or loading variables. The parameter must be the string GET or POST. If there are no variables to be sent, omit this parameter. The GET method appends the variables to the end of the URL and is used for small numbers of variables. The POST method sends the variables in a separate HTTP header and is used for long strings of variables.

Returns

Nothing.

Description

Method; loads SWF or JPEG files into a movie clip in Flash Player while the original SWF file is playing.

Tip: If you want to monitor the progress of the download, use MovieClipLoader.loadClip() instead of this function.

Without the loadMovie() method, Flash Player displays a single SWF file and then closes. The loadMovie() method lets you display several SWF files at once and switch between SWF files without loading another HTML document.

A SWF file or image loaded into a movie clip inherits the position, rotation, and scale properties of the movie clip. You can use the target path of the movie clip to target the loaded SWF file.

When calling loadMovie(), set the MovieClip._lockroot property to true in the loader movie, as shown in the following code. If you don't set _lockroot to true in the loader movie, the loader has access only to its own library, but not the library in the loaded movie:

myMovieClip._lockroot = true;

Use the MovieClip.unloadMovie() method to remove SWF files or images loaded with the loadMovie() method. Use the MovieClip.loadVariables() method to keep the active SWF file, and update the variables of the SWF file with new values.

Using event handlers with MovieClip.loadMovie() can be unpredictable. If you attach an event handler to a button using on() or if you create a dynamic handler using an event handler method such as MovieClip.onPress, and then you call loadMovie(), the event handler does not remain after the new content is loaded. However, if you attach an event handler to a movie clip using onClipEvent() or on(), and then call loadMovie() on that movie clip, the event handler remains after the new content is loaded.

You can extend the methods and event handlers of the MovieClip class by creating a subclass. For more information, see "Assigning a class to a movie clip symbol" in Using ActionScript in Flash.

Example

As shown in the following example, you can use loadMovie() to load the image picture.jpg into a movie clip and use the MovieClip.onPress() method to make the image act like a button. Loading a JPEG using loadMovie() replaces the movie clip with the image but doesn't give you access to movie clip methods. To get access to movie clip methods, you must create an empty parent movie clip and a container child movie clip. Load the image into the container and place the event handler on the parent movie clip.

// Creates a parent movie clip to hold the container
this.createEmptyMovieClip("logo_mc", this.getNextHighestDepth());
// creates a child movie clip inside of "mc_1"
// this is the movie clip the image will replace
logo_mc.createEmptyMovieClip("container_mc",0);
logo_mc.container_mc.loadMovie("http://www.macromedia.com/images/shared/product_boxes/80x92/studio_flashpro.jpg");
// put event handler on the parent movie clip mc_1
logo_mc.onPress = function() {
   trace("It works");
};

See also

MovieClip.loadMovie(), loadMovieNum(), MovieClip.loadVariables(), MovieClip.unloadMovie(), unloadMovie(), unloadMovieNum()

Comments


recoveredfromflashMX2004 said on Aug 4, 2004 at 3:26 PM :
mrkandersn said on Jun 11, 2004 at 5:32 PM :

Is the loading of JPEGs via loadMovie() subject to cross-domain
restrictions as described here?
http://www.macromedia.com/support/flash/ts/documents/
loadvars_security.htm


Der Picknicker said on Jun 16, 2004 at 2:46 PM :

Does MovieClip.loadMovie() overload the _global object???
Fumio Nonaka said on Aug 13, 2004 at 12:54 AM :
Flash Player 6 or later is needed to load JPEG files with the method.
This should be noted in the Availability.

See: "Macromedia Flash Player 5 and image linking"
http://www.macromedia.com/support/flash/ts/documents/
runtime_import.htm
Francis Cheng said on Aug 13, 2004 at 9:45 AM :
Thanks, I've added the JPEG information to the availability section. It will appear the next time we publish these pages.
johnnystorm0 said on Sep 1, 2004 at 12:39 PM :
I've noticed that if you use loadMovie under a mask with multiple
keyframes or setMask() that this causes the loaded mc to unload. I also
noticed that if you have a mult-frame mc under a mask with multiple
keyframes that the mc will start over when you get to the second key
frame.

My take on this is that each new instance of a mask layer causes the
movieclips underneath it to reload. In the case of a loaded movie you
lose the content.

Is it possible to load movies into the library for use with attachMovie?
other then using a shared library.
johnnystorm0 said on Sep 1, 2004 at 1:24 PM :
How is it you solve your own problems after you've asked for help. The
mask issue only happens when you use shape tweens not MC
instances.
InternetInfinity said on Oct 11, 2004 at 10:47 AM :
It looks like the printJob() class will not print your dynamically loaded images unless the images are loaded. A solution for this is to use the MovieClipLoader.loadClip() in order to motitor the status of the images loaded before printing.
No screen name said on Oct 12, 2004 at 1:24 PM :
Here is an example using GET/POST:

Suppose the following exist and are all kosher:
myMC : a movieclip
myURL: the url from which I wish to load
myVar : the variable I wish to send to the url

Then
myMC.myVar=myVar;
myMC.loadMovie(url,"POST");
will load the movie and send the variable myVar (along with all other variables on the myMC timeline) using the POST method. (Replace "POST" with "GET" if you prefer that method.)

To access this posted method using, say php, you could use, for example:
$myVar=$_POST['myVar'];
spinstir said on Oct 29, 2004 at 7:49 AM :
Has anyone been able to use loadMovie() with _lockroot to load an external SWF and access its library from the loading SWF via attachMovie()?
Whittaker007 said on Nov 3, 2004 at 6:11 PM :
Is there an event to check if a loaded .swf has finished loading? You can't access the contents of a loaded clip until it has completely loaded, so I figured that if I used:

var loaded_mc = this.createEmptyMovieClip("loaded", 1);
loaded_mc.loadMovie("movieToLoad.swf");
loaded_mc.onLoad = function() {
trace("Movie has loaded");
}
loaded_mc.onData = function() {
trace("Movie has recieved data");
}

Neither of these events fires, and the only way to make sure it has loaded is to use setInterval or wait until the next frame.
Whittaker007 said on Nov 3, 2004 at 6:31 PM :
It seems you need to use the MovieClipLoader class' listeners to capture those events. And for those interested you need to use the MovieClipLoader.onLoadInit event which occurs AFTER the MovieClipLoader.onLoadComplete event, which I'm sure makes sense in somebodys warped mind...
foshae8 said on Feb 13, 2005 at 11:34 AM :
Hi Johnnystorm0,
I was having the same problem as you with loading (loadMovie) an
external .swf or .jpg into blank MC that was masked by a layer mask
having multiple keyframes. I also tested the setMask() function but had
the same issue.

I then added the setMask() script on EACH keyframe where there was a
keyframe for the layer mask (note: the layer mask is NOT a real layer
mask, it's a movie clip instance in which I use the setMask() function to
mask the loaded .swf). Make sure the movie clip instance you are using
as a "Mask" has the same instance name for each keyframe.

If this doesn't make sense, download this tutorial and add a couple
keyframes to the movie clip instance being used as a mask, and add the
same setMask() script to each keyframe. You can modify the size of the
movie clip mask on each frame and you will notice that the external .jpg
DOES NOT unload. :o) Good Luck and I hope this helps!

http://actionscript-toolbox.com/samplemx_loadjpg.php
No screen name said on Feb 16, 2005 at 6:51 PM :
Why is there no support for POST/GET variables in the loadClip function like in loadMovie?
SpaceMonkey2000 said on Mar 2, 2005 at 9:21 AM :
The documentation says:

If you don't set _lockroot to true in the loader movie, the loader has access only to its own library, but not the library in the loaded movie

I haven't been able to get *any* movie to access the library of another movie at runtime. The parent can't do an attachMovie of an asset in the library of a child movie, and the child can't do an attachMovie of an asset in the library of the parent movie. The only effect lockroot seems to have is that if you don't do lockroot on the child, then the child can't even do an attachMovie of an asset in it's own library.

Here is the code I have:

test0 is an asset in the parent library
test1 is an asset in the child library

Code in parent:

ld1.loadMovie("child.swf");
ld1._lockroot = true;
_root.attachMovie("test0", "junk0", _root.getNextHighestDepth()); //works
_root.attachMovie("test1", "junk1", _root.getNextHighestDepth()); //doesn't work

Code in child:

this.attachMovie("test0", "junk0", this.getNextHighestDepth()); //doesn't work
this.attachMovie("test1", "junk1", this.getNextHighestDepth()); //works

If I remove the line, "ld1._lockroot = true;" from the parent, the attachMovie of test1 in the child doesn't work either.

Is there something I am doing wrong, or is the documentation wrong?
lobstu said on Mar 16, 2005 at 12:26 PM :
_lockroot and attachMovie

Loading a child swf and attaching mc's from it's library in the parent? As mentioned twice before in the comments above, the documentation teases us by hinting that it could be possible... and that's where it stops!

I am already successfully accessing variables in both child and parent from both, using Security.allowDomain and LocalConnection.allowDomain.

What's the final judgement? Can we do this or not? If we can, how?!

Thanks!
Francis Cheng said on Apr 16, 2005 at 5:13 AM :
To share library assets at runtime, you need to use Runtime Shared Libraries (RSLs). The sentence about using lockroot should say:
If you don't set _lockroot to true for the loaded movie, any references to _root in the loaded movie will point to the _root of the loader instead of the _root of the loaded movie.
jelaplan said on Apr 22, 2005 at 9:44 AM :
Here's a tip:
I had a lot of trouble referencing a method from the load event of SWF that I loaded with loadMovie. There are a variety of resources on this topic and the consensus is to use onClipEvent(load) on the clip that is being loaded. But, I was dynamically creating my clip and I couldn't figure out where to put my onClipEvent. The solution I came up with is:
- I created a SWF that I wanted to load. I put a empty clip in that SWF and attached the onClipEvent(load) to it. In that handler, I referred to _root.mymethod to gain access to methods defined on the _root of the movie I used to load my SWF. The mechanism for the scoping of _root in this situation is not that clear to me but it works.

Then in my main movie, I used loadMovie
this.createEmptyMovieClip("LoggingLibrary_mc",this.getNextHighestDepth());
loadMovie("CommLoggingLibrary.swf", LoggingLibrary_mc);

My real confusion was trying to add onClipEvent to LoggingLibrary_mc. Since it is dynamic, I couldn't find a way to assign that event handler.

The following article helped me more than anything else.
http://iat.ubalt.edu/courses/old/idia619.185_Sp03/drawing.shtml

I also tried the following without success.
// on my _root frame
this.createEmptyMovieClip("LoggingLibrary_mc",this.getNextHighestDepth());
this.LoggingLibrary_mc.onData = function() {
trace("Data Loaded");
newProblem();
};
loadMovie("CommLoggingLibrary.swf", LoggingLibrary_mc);
Francis Cheng said on Apr 22, 2005 at 12:19 PM :
Hi jelaplan,
You will have better luck using the MovieClipLoader class.
Vitalie said on May 6, 2005 at 10:15 AM :
Isn't it just stupid for not being able to access the library assets from a parent movie? What's the heck is that? Why use RSL's when the "things" are already there and they even have their linkage name set-up and exported for the ActionScript? What's the reason to block the assets' exchange in the same movie?

Please send me an email if there is any reasonable work around, because I'm desperate lately finding more and more other issues all the time. I'm on a tight deadline - thanks.
vitalie_cartera@yahoo.com
webb_dev said on May 12, 2005 at 7:20 PM :
Lots of comments for something that SHOULD simply work.

I can't even get a movie to load with Both methods:

loadMovie("ProofOfConcept-Demo.swf",holder_mc);
trace("loadMovie frames: " +holder_mc._totalframes);
holder_mc.loadMovie("ProofOfConcept-Demo.swf","");
trace("holder_mc.loadMovie frames: " +holder_mc._totalframes);

Each trace returns "endefined". Yet the following works:

loadMovie("ProofOfConcept-Demo.swf",this);

Any assistance would be appreciated...
Francis Cheng said on May 12, 2005 at 9:11 PM :
Hi webb_dev,

The clip you are loading into, holder_mc, must exist before you load anything into it. Your code works fine for me if I first create holder_mc:

createEmptyMovieClip("holder_mc", 0);
No screen name said on May 17, 2005 at 8:25 AM :
I am wondering if anyone can tell me how to stop playing an animation loaded in a dynamic created move clip.

my_clip.createEmptyMovieClip("container", this.getNextHighestDepth());
my_clip.container.loadmovie("animation.swf");
my_clip.container.stop();
my_clip.container._visible = false;

please tell why these four lines of code is not working.
Francis Cheng said on May 17, 2005 at 9:54 AM :
The loadMovie() method makes an asynchronous call to load the movie. This means that Flash Player doesn't stop all execution after you call loadMovie() and wait until the movie is loaded before executing the next line of code (which in your case is calling stop()). You should look into the MovieClipLoader class, which allows you to tell when the movie has loaded. Here is some quick sample code that makes your example work, assuming that the my_clip movie clip already exists:
my_clip.createEmptyMovieClip("container", 1);
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
target_mc.stop();
};
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip("animation.swf", my_clip.container);
Geoff_Austin said on May 18, 2005 at 7:27 AM :
As part of a component I'm building I've loaded a JPG using :

var myImage:MovieClip;
myImage.loadMovie("myimage.jpg");

Works fine, but how do I get the ssize of the JPG?
myImage._width and myImage._height both return 0.

Is it a timing problem - should I use the MovieClipLoader class?
Or are there other ways of getting the JPG width and height?
GuidoDez said on May 18, 2005 at 2:43 PM :
i've search around and was not able to find any information about define dynamically a movieClip path. i'm trying to load a external file into a mc using a variable as path

function loadImg(target, image) {
this[target].loadMovie(image);
}
targetCorrect="_root.mcFather.mcSon"
loadImg (targetCorrect,"myImage.jpg")
swartz1999 said on May 18, 2005 at 7:49 PM :
Hi Guido. Your code will work if you remove "_root" from the assignment for the targetCorrect variable.

targetCorrect="mcFather.mcSon"
swartz1999 said on May 18, 2005 at 8:05 PM :
Hi Geoff. Yes, you should use the MovieClipLoader class. Also, you may need to set a timeout to access the height and width of the image:

this.createEmptyMovieClip("image_mc", this.getNextHighestDepth());
var mclListener:Object = new Object();
mclListener.onLoadComplete = function(target_mc:MovieClip) {
setTimeout(200, "trace(target_mc._height)");
var t = setInterval(traceWidthHeight, 200)

function traceWidthHeight() {
clearTimeout(t);
trace(target_mc._width);
trace(target_mc._height)
}
}

var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip("myimage.jpg", image_mc);
No screen name said on May 29, 2005 at 5:17 PM :
I'm having troubles trying to pass an object through to the movie that needs to be loaded...

suppose I have the object 'phase' (which has variables and arrays of different properties...
also I have a movie clip called tab which has an movie instance called tabContent...

now I want the movie.swf which has a variable 'phase' to be equal to the parameter 'phase' passed into makeTab...

now I try to run this

function makeTab(phase) {
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
target_mc.phase = phase;
};
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip("movie.swf", newTab.tabContent);
}

yet I can't get the 'phase' object into 'movie.swf'
Snaux said on May 30, 2005 at 1:25 PM :
I'm having problems with download speed using loadmovie() over a high-speed line. All I'm trying to do is create a simple download speed tester in Flash, one that can handle 30Mbs lines (typical cable/dsl xfer rate is 4Mbs, so this is *really* fast).

I'm using this function to load a 10MB submovie over a 30Mbs Fibre-optics connection, but cannot achieve speeds faster than 7Mbps. Outside of Flash, I can use http to access the same data file at 25Mbs

Everything seems to zoom along nicely until it's downloaded about 8Mb of data, then the download chokes and grinds to a virtual halt for the remainder of the download. Frankly, it looks like I'm overloading some kind of internal buffer, so I'm wondering if such a buffer actually exists.

Does anybody know any way to improve performance? I don't really care what I'm downloading - all I'm trying to do is test the user's connection speed as accurately as possible...
No screen name said on Jun 2, 2005 at 1:41 PM :
trying desperately to do an onLoad on a movieclip and failed quite dismally... very simple AS follows... function which sets a global variable, defines an onLoad event handler for a child movieclip, and then loads an image (jpg) into a movieclip -- at the point i would expect the onLoad event to fire, but it blatently is not. Anyone able to offer any assistance on this matter please?

PS. i have tried making the loadMovie call before and after the event declaration... and everything else i can think of too for that matter... please help... :(

function cBGImage(imageName) {

_root.newBGImage = imageName;

pageContent.bgChanger.bgImageX.bgImage.onLoad = function() {
pageContent.bgChanger.bgImageX.bgImage.loadMovie(imageName);
pageContent.bgChanger.gotoAndPlay(2);
}

pageContent.bgChanger.bgImageX.bgImage.loadMovie(imageName)

}
No screen name said on Jun 6, 2005 at 10:53 AM :
Don't quote me on this, but I believe the onLoad() event occurs when a
movie clip is "arrived upon" by the timeline that nests it. In other words,
there's confusion caused by the use of the word "load" for two very
different phenomena:

1) the appearance of a movieclip in a timeline that's playing, and
2) the completion of a dynamic loadMovie() process.

I've had luck with various other techniques, such as creating an
onClipEvent(enterFrame) function for the clip that keeps checking its
getBytesLoaded() value against its getBytesTotal() value, or creating an
interval that keeps "polling" the movieclip to see if it's done loading yet.
I'd recommend either of these approaches--or use the MovieClipLoader
class (which is something I've been warned away from, but can't
remember why).
rosshk said on Jun 12, 2005 at 12:54 PM :
I am using Flash MX (Flash 6) and am trying to load an image into a movie dynamically by using loadMovie() to load the image into a movie.

I am trying to add a preloader so that a "loading" message is displayed prior to the image appearing. However, the getBytesLoaded() and get BytesTotal() methods do not seem to take the size of the jpg into consideration (just the size of the .swf)...how can I get these to include the value of the image? Or is there some kind of other workaround...
No screen name said on Jun 21, 2005 at 3:34 PM :
Is it possible to send a movieclip that has loaded a jpg in it back to the server and have the server pull the jpg out of the movieclip?
Zoli_ said on Jul 2, 2005 at 2:22 PM :
I just made a picture viewer for large pictures.

Works fine but when I load a really large .jpg file (eg:3072x2078) with the loadMovie command, the loaded image will "cut" to 2880x2048.

I made a test with a pure loadMovie command, and found its really cut the loaded image.

Why, why, why... Tell me plz.

I dont understand, but I am afraid its a bug.

Thx.
effari said on Jul 4, 2005 at 3:20 PM :
I have a simple question about loadVariable

This is the problem:
Am using " loadVariable", to load some information from a CF Form, to a SWF movie and works fine, but am having the following issue. If the person make a mistake in the form and the person get back and fixed, in the SWF the new info is not updated and still showing the first data loaded. the only way to update is clenaing the temporary internet files.

Question:
How cant i make the SWF update the new info?
czieler said on Jul 14, 2005 at 9:37 AM :
I am using LoadMovie in several different swf files that are all embedded inside of each other. The final swf file has an object inside of it, named mapObj. Inside of flash video player, I am able to access this object once the file has loaded, by saying my_outmc.my_innermc.mapObj ... and everything works great. For some reason though, when running in a web browser, my_outmc.my_innermc.mapObj never becomes defined, even though I can see on stage that the swf file which contains mapObj has been loaded, because its visible. Has anyone else had an issue like this?
imd_engineer said on Jul 18, 2005 at 6:08 PM :
To the person that wants to send jpg data to the server...

This functionality is not currently supported. Perhaps if you're giving users the ability to manipulate images, you could store and transmit those manipulations to the server as text command data?
imd_engineer said on Jul 18, 2005 at 6:16 PM :
Hey Zoli,

Unfortunately, It seems you have reached the upper limit available for stage dimensions.

http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004&file=00000118.html

If you would like to see this changed in future versions, please feel free to submit an enhancement request at:
http://www.macromedia.com/software/flash/contact/wishlist/

Thanks for bringing this to our attention!
No screen name said on Jul 21, 2005 at 11:29 PM :
//I load a jpeg file use Movieclip.loadmovie() ,it can run
_root.createEmptyMovieClip ("loader", 10);
loader.onData = positionIt;
loader.loadMovie ("pic.jpg");
/////////////////
//But if l want change the size,code like
_root.createEmptyMovieClip ("loader", 10);
loader._width = 100;
loader._height = 100;
loader.loadMovie ("pic.jpg");
//But it don't change size,moreover i can't see the picture.I can do these use MovieClipLoader Class . but I want know why the I can't see picture?
ali mills said on Jul 22, 2005 at 12:37 AM :
Hey No screen name from Jul 21, 2005 at 11:29 PM,

It sounds like you already know that you should really be using the following code:

var listener:Object = new Object();
listener.onLoadInit = function(mc:MovieClip) {
mc._width = 100;
mc._height = 100;
}

var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(listener);

var container:MovieClip = this.createEmptyMovieClip("container", this.getNextHighestDepth());
mcLoader.loadClip("challsheff.jpg", container);

So, I won't get into the MovieClipLoader. Your question is, "why the I can't see picture" when doing the following:

var loader:MovieClip = this.createEmptyMovieClip("loader", this.getNextHighestDepth());
loader._width = 100;
loader._height = 100;
loader.loadMovie(YOUR_JPG_URL);

While I'm not *exactly* sure, but I suspect that it's because the createdEmptyMovieClip doesn't actually have any visual representaion, and attempting to set the _width before it does sends it spiralling towards infinity looking for some drawing bounds. I think this is the case, because of how the following code works:

var loader:MovieClip = this.createEmptyMovieClip("loader", this.getNextHighestDepth());
loader.lineTo(JPG_WIDTH, JPG_HEIGHT);
loader._width = 100;
loader._height = 100;
loader.loadMovie(YOUR_JPG_URL);

The above does what you're looking for. If you play with JPG_WIDTH or JPG_HEIGHT you'll notice that the smaller either number gets, the closer to infinity the visual representation of your image becomes.
ali mills said on Jul 22, 2005 at 12:40 AM :
In the above comment, the string "challsheff.jpg" should actually be YOUR_JPG_URL. I doubt many of you out there are very interested in loading a photo of two of DC's greatest skateboard legends, Chris Hall and Seah Sheffy. Sorry about that.
SIMDESIGNS said on Aug 16, 2005 at 8:33 AM :
I'm using loadMovie to dynamically load some images into my flash powered blog, but I find that Flash clips a couple pixels the right and bottom edges of the jpegs whenever it displays them, regardless of the width and height.
How can I correct this.
hibiscusroto said on Aug 19, 2005 at 11:00 AM :
I think I'm having a similar issue...I want to load a bunch of child movie clips one at a time...all of my movies are loading and playing, but I cant control the timeline...but I can control _x and _y...here's my code...

var arrayOfScenes:Array = Array();
arrayOfScenes[0] = "01-01";
arrayOfScenes[1] = "01-03";
arrayOfScenes[2] = "01-04";
arrayOfScenes[3] = "01-05";
arrayOfScenes[4] = "01-06";
setInterval(loadAllContentMovieClips, 500, arrayOfScenes);


function loadContentMovieClip(objectName, depthLevel){
this.createEmptyMovieClip(objectName, depthLevel);
swfName = (objectName + ".swf");
_root[objectName].loadMovie(swfName);
_root[objectName].gotoAndStop(1); // this does not work
_root[objectName]._x = -100; // this works
}

function loadAllContentMovieClips(){
for (var i:Number = 0; i<arrayOfScenes.length; i++) {
if(! _root[arrayOfScenes[i]]){
if(i == 0){
loadContentMovieClip(arrayOfScenes[i], i);
} else if(_root[arrayOfScenes[i - 1]]._framesloaded == _root[arrayOfScenes[i -1]]._totalframes) {
// previous movie loaded, time to load another one
loadContentMovieClip(arrayOfScenes[i], i);
}
} else if (i == arrayOfScenes.length - 1 && _root[arrayOfScenes[i]]._framesloaded == _root[arrayOfScenes[i]]._totalframes){
trace('all movie clips loaded, clearInterval');
// not sure how to do this >> clearInterval goes here to stop this function from running
}
}
}
Snaux said on Aug 19, 2005 at 12:42 PM :
I've noticed the same thing. Interestigly, it only happens when the jpg loads to the screen visibly; if you load offscreen and then move it, or if you refresh the screen by going to a new frame and back again, it works fine.

Total pain in the arse, mind you, but it does seem to clear up the problem. My guess is that it's a bug in the loader object...
No screen name said on Oct 26, 2005 at 1:39 PM :
MM needs to add an example of how to use the "variables" paramter.
douglaschen said on Nov 7, 2005 at 2:55 PM :
I noticed that Flash Player 7 does not show jpg image that is saved in Baseline Optimized or Progressive format by Phoshop when using loadMovie method. If your image doesn't show up, please check if it's saved in standard format. Maybe the document should mention this.
nekcih said on Nov 14, 2005 at 4:07 PM :
I discovered a strange solution to my problem where multiple streams never get closed when using the loadMovie() method.

_root.SCO_PH.SCO.unloadMovie();
_root.SCO_PH.SCO.loadMovie(""); // this is the kicker
_root.SCO_PH.SCO.loadMovie(sLessonSco_Url);

It appears that the loadMovie() method will kill current download streams if you pass it an empty string. Executing it without the empty string didn't solve the problem.
SqueezeDigital said on Mar 20, 2006 at 8:03 AM :
It appears loadMovie does not throw an exception Error object when loading an swf that doesn't exist.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/mx2004/main_7_2/00001519.html