Script for embedding Print2Flash swf file into a movie frame
Posted: Sun Jul 06, 2014 5:10 pm
I used the following script for attaching swf files made from FlashPaper 2.0 into Flash:
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);
loaded_o.onLoaded(fp);
}
intervalID = setInterval(loadFunc, 100);
dest_mc.loadMovie(path_s);
}
function onLoaded(fp)
{
// loading is complete, so we can now adjust the current page, zoom, etc.
// go to page 50.
fp.setCurrentPage(1);
// change magnification to 47%
fp.setCurrentZoom(47);
}
loadFlashPaper("/Work/Name of Movie.swf", Movie, 965, 539.7, this);
I created a new swf using Print2Flash but did not change any of the script in Flash. The swf appears within the movie like FlashPaper, but the magnification is 57% instead of 47%, it is not centered in the same location as before, etc. Should I be using a different script?
Thanks!
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);
loaded_o.onLoaded(fp);
}
intervalID = setInterval(loadFunc, 100);
dest_mc.loadMovie(path_s);
}
function onLoaded(fp)
{
// loading is complete, so we can now adjust the current page, zoom, etc.
// go to page 50.
fp.setCurrentPage(1);
// change magnification to 47%
fp.setCurrentZoom(47);
}
loadFlashPaper("/Work/Name of Movie.swf", Movie, 965, 539.7, this);
I created a new swf using Print2Flash but did not change any of the script in Flash. The swf appears within the movie like FlashPaper, but the magnification is 57% instead of 47%, it is not centered in the same location as before, etc. Should I be using a different script?
Thanks!