Useful links:
Adobe Official API for Flash Paper 2
Hacking Flash Paper
Flash Paper API Object Dump
To use the following code simply create a new Flash Document and dump this into the action panel. For this to work you must has first created a Flash Paper document which this code will load.
function loadFlashPaper(
path_s, // path of SWF to load
dest_mc, // MC which we should replace with the SWF
width_i, // new size of the dest MC
height_i, // new size of the dest MC
loaded_o) // optional: object to be notified that loading is complete
{
var intervalID = 0;
var loadFunc = function()
{
dest_mc._visible = false;
var fp = dest_mc.getIFlashPaper();
if (!fp)
return;
if (fp.setSize(width_i, height_i) == false)
return;
dest_mc._visible = true;
clearInterval(intervalID);
_level0.dest_mc.toolbar_mc._alpha = 0; //hides toolbar completely
// _level0.dest_mc.document_mc.bg_mc._alpha = 0; //scroll bar
_level0.dest_mc.toolbar_mc.brandClip_mc._visible = 1; //Macromedia Branding - violate current EULA to hide
loaded_o.onLoaded(fp);
}
intervalID = setInterval(loadFunc, 100);
dest_mc.loadMovie(path_s);
}
_root.createEmptyMovieClip("dest_mc",0);
foo = {};
foo.onLoaded = function(fp){
trace(fp);
}
loadFlashPaper("WhartonCentury.swf",dest_mc,462, 604,foo);
No comments:
Post a Comment