- FlashXpert
- FAQ
- Embedding
Embedding
-
How can I embed the player multiple times on the same html page?
Since each player instance must have its own settings.xml file, when you try to embed multiple players, they won't know how to each load its specific settings.xml file. To solve this problem, take a look in the embed code, inside the videoplayer.html file.
You will notice that you can set the path for the settings file there:
1. Create one such "settings" file for each player you want to embed and name them "settings.xml", "settings1.xml", "settings2.xml" and so on until each player has its unique settings file.
2. Rewrite the path to the settings file in the embed code of each player, so their paths refer to the corresponding settings file. -
How can I integrate the player into my full AS2 Flash site?
There are several ways to embed a swf into another one. Here is one such way detailed:
1. Open your site's main fla. Create an empty movieclip named "mc1" on a separated layer on your main fla.
2. Give it an instance name using the properties bar below (name it "mc1" as well).
3. Add the following code on the same frame where you put the empty movie clip:
stop();
mc1.loadMovie("videoPlayer.swf?settingsFile=settings.xml");
4. Copy the entire content of the deploy folder you received when you bought the player and paste it in the same directory where your site's main fla is.
5. Compile your site.
Note: don't worry if it seems it does not load the xml when you compile. It can only load it when in browser. -
How can I integrate the player into my full AS3 Flash site?
Note that you need the AS3 version of our player if you want to embed it into an AS3 flash site. There are several ways to embed a swf into another one. Here is one such way detailed:
1. Open your site's main fla. Create an empty movie clip named "mc1" on a separated layer on your main fla.
2. Give it an instance name using the properties bar below (name it "mc1" as well).
3. Add the following code on the same frame where you put the empty movie clip:
import flash.display.*;
import flash.net.URLRequest;
stop();
var loader:Loader = new Loader();
var url:String = ""videoPlayer.swf?settingsFile=settings.xml";
var urlReq:URLRequest = new URLRequest(url);
loader.load(urlReq);
mc1.addChild(loader);
4. Copy the entire content of the deploy folder you received when you bought the player and paste it in the same directory where your site's main fla is.
5. Compile your site.
Note: don't worry if it seems it does not load the xml when you compile. It can only take it when in browser. -
I use load and unload functions for integrating the player into my site. However, I can still hear the sound of the previously playing media after I unload the videoPlayer, or even after I navigate away from the page. How can I unload the movie clip so that the sound is unloaded as well?
Before you unload the player movie clip, you need to also call the player's own unload function (basically, you first need to unload what the player loaded. Only afterwards you unload the player itself).
Here is the code you should use for unloading the player ("mc1" is the movie clip inside of which you originally loaded the player, as stated in the previous answer in this FAQ):
AS2 code:
mc1.mcVideoPlayer.unload();
mc1.unloadMovie();
AS3 code:
mc1.mcVideoPlayer.unload();
loader.unload();
mc1.removeChild(loader);