Blink
Threadersteller
Dabei seit: 05.12.2005
Ort: Frankfurt
Alter: 43
Geschlecht:
|
Verfasst Mi 25.01.2006 14:57
Titel neue swf-datei in sprite laden |
|
|
Hallo alle miteinander,
ich möchte in meine index.swf -datei zwei weitere swf-files laden (movie1swf und movie2.swf), wenn die entsprechenden buttons geklickt wurden. hierzu gibt es auch ne menge postings in verschiedenen foren. ich bin dabei auch auf den begriff "sprite" gestoßen. dazu gibt mir die hilfe von flash mx nicht mal einen eintrag.
wie kann ich das denn am besten umsetzen?
die movie.swf-files sind ein stück kleiner als die index.swf.
ich wollte, dass die entsprechenden importierten moviefiles in so einem sprite unter meinen buttons ablaufen...
außerdem funzt das mit loadmovie nicht...kann mir da jemand helfen?
danke!
|
|
copic
Dabei seit: 09.07.2004
Ort: Stuttgart
Alter: 42
Geschlecht:
|
Verfasst Mi 25.01.2006 15:34
Titel
|
|
|
Code: | loadMovie()
Availability
Flash Player 3.
Usage
loadMovie(url:String,target:Object [, method:String]) : Void
loadMovie(url:String,target:String [, method:String]) : Void
Parameters
url The absolute or relative URL of the SWF 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:///.
target A reference to a movie clip object or a string representing the path to a target movie clip. The target movie clip is replaced by the loaded SWF file or image.
method An optional parameter specifying an HTTP method for sending 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
Function; loads a SWF or JPEG file into Flash Player while the original SWF file plays.
Tip: If you want to monitor the progress of the download, use MovieClipLoader.loadClip() instead of this function.
The loadMovie() function lets you display several SWF files at once and switch among SWF files without loading another HTML document. Without the loadMovie() function, Flash Player displays a single SWF file.
If you want to load a SWF or JPEG file into a specific level, use loadMovieNum() instead of loadMovie().
When a SWF file is loaded into a target movie clip, you can use the target path of that movie clip to target the loaded SWF file. A SWF file or image loaded into a target inherits the position, rotation, and scale properties of the targeted movie clip. The upper left corner of the loaded image or SWF file aligns with the registration point of the targeted movie clip. Alternatively, if the target is the root Timeline, the upper left corner of the image or SWF file aligns with the upper left corner of the Stage.
Use unloadMovie() to remove SWF files that were loaded with loadMovie().
Example
Usage 1: The following example loads the SWF file circle.swf from the same directory and replaces a movie clip called mySquare that already exists on the Stage:
loadMovie("circle.swf", mySquare);
// equivalent statement (Usage 1): loadMovie("circle.swf", _level0.mySquare);
// equivalent statement (Usage 2): loadMovie("circle.swf", “mySquare”);
The following example loads the SWF file circle.swf from the same directory, but replaces the main movie clip instead of the mySquare movie clip:
loadMovie("circle.swf", this);
// Note that using "this" as a string for the target parameter will not work
// equivalent statement (Usage 2): loadMovie("circle.swf", “_level0”);
The following loadMovie() statement loads the SWF file sub.swf from the same directory into a new movie clip called logo_mc that’s created using createEmptyMovieClip():
this.createEmptyMovieClip("logo_mc", 999);
loadMovie("sub.swf", logo_mc);
You could add the following code to load a JPEG image called image1.jpg from the same directory as the SWF file loading sub.swf. The JPEG is loaded when you click a button called myBtn_btn. This code loads the JPEG into logo_mc. Therefore, it will replace sub.swf with the JPEG image.
myBtn_btn.onRelease = function(){
loadMovie("image1.jpg", logo_mc);
};
Usage 2: The following example loads the SWF file circle.swf from the same directory and replaces a movie clip called mySquare that already exists on the Stage:
loadMovie("circle.swf", “mySquare”);
See also
_level, loadMovieNum(), MovieClip.loadMovie(), MovieClipLoader.loadClip(), unloadMovie()
|
|
|