Professional Documents
Culture Documents
I haven't worked with Flash Paper a lot but seems like we are starting to use it more at work. A
client had this nice technical illustration that he wanted transformed into Flash Paper. The
illustration was huge so when it was zoomed out it looked bad. I looked around and found that
there is a Flash Paper API. This provided some nice features such as controlling the zoom, etc...
That worked nicely but I need to find a way (once zoomed in) to reposition the "page". I couldn't
find anything readily so I dug through the objects with loops and found a way. I thought I'd share
this find.
While I'm on a Flash Paper kick I guess I'll post this technote about getting a Landscape Flash
Paper.
The code below uses code written by Damian Taggart to interface an swf wrapper which loads
the Flash Paper swf file and then uses the API included within it to modify the document - from
DevMX.
Stage.scaleMode = "noScale";
Stage.align = "TL";
stop();
([path to Flash paper .swf, destination mc,width, height, optional: obj to recieve notification
when loading completes])
*/
trace(pathToSWF);
var intval = 0;
var loadFP = function () {
destMC._visible = false;
var fp = destMC.getIFlashPaper();
if (!fp) {
trace("not loaded");
return;
return;
}else {
destMC._visible = true;
clearInterval(intval);
onLoaded(fp);
destMC.loadMovie(pathToSWF);
function onLoaded(fp) {
fp.enableScrolling(true)
fp.setSize(Stage.width,Stage.height);
fp.setCurrentZoom(186);
for(c in fp.m_mainMC.document_mc){
trace("c" + c);
fp.m_mainMC.document_mc.y_sb.m_scrollPosition = 180;
fp.m_mainMC.document_mc.x_sb.m_scrollPosition = 20;
As you can see it was two measly lines that go and reference the scrollbars and set the positions.
fp.m_mainMC.document_mc.y_sb.m_scrollPosition = 180;
fp.m_mainMC.document_mc.x_sb.m_scrollPosition = 20;
You can do the same by hitting the mc that is scrolled (just do some for in loops - you'll find it)
and repositioning it - just keep in mind this screws scrollbars up so I don't advise this unless you
have the scrollbars shut off.
2:18 PM | Permalink
26 comments
thx for the link back ;-)
http://www.macromedia.com/devnet/flashpaper/articles/import_flpaper2.html
Using an event to capture the loaded clip load will then allow you to modify the loaded swf
(flash paper in this case) as above with some minor code modifications.
So I thought maybe I could designate the popup window to load the movieclip that has the
flashpaper swf embedded in it. That would, in theory, allow me to resize the flashpaper
document.
....
function onLoaded(fp) {
trace("UI changes called");
fp.enableScrolling(true)
//not stage size but the
//size of the flsh paper
//window you desire
fp.setSize(150,150);
....
3)Now when you run the main FLA with the Window component and load the wrapper swf your
flash paper should be sized accordingly.
You could probably do the same by listening for the load event on the window component and
attempting to modify the variable "fp" by referencing it from your _root FLA. I don't like the
window component so I avoided that...
The wrapper will load the flash paper swf into itself and then make the api call function
showPrintUI( flag ) see here:
http://www.macromedia.com/support/documentation/en/contribute/2/flashpaper_api/flashpaper_
api03.html
-Sarge
Posted by Sarge | 9:12 PM
gracias por el scrip me ayudo mucho, gracias tio!
Checkout http://www.zanzibarfiction.com
I've been trying out the function of function showPrintUI (false), and can't figure out how to
make it work, I'm a beginner in Flash, can you please help me?
Thanks,
this.holder_mc.toolbar_mc.attachMovie("Fcover", "brandClip_mc",
this.holder_mc.toolbar_mc.brandClip_mc.getDepth());
but you can't replace it, at least that is how it appears to me.
I wanted to use it to submit some writing of mine to a site that is basically an art community. The
only problem is that the player is too small, and I don't know how to resize it (using the embed
code is not an option as I don't have any control over that)
So I came across this article and I did a little research. Forgive me if I'm misunderstanding this,
but, doesn't this just load a .swf file that is elsewhere on the computer?
I mean, if I had my own website this wouldn't be a problem as I'd also upload that separate .swf
file to the same directory or whatever. Isn't there any way at all to merge the two documents into
one that loads and is resized/etc?
I apologize if I confused anyone, because I'm not too sure how to explain this...
I kind of assumed I was out of luck :( I wish the actual flashpaper application had size/dimension
settings instead >_<
Thanks for the code, really helping to get a grip on FlashPaper. However, I do have a question
which I would love help with...
Long story short, I just want to get the page movieclips into their own seperate swfs. I don't need
any of the extra functionality FP adds, just the converted PDF pages. I see I can access the pages
at fp.m_mainMC.document_mc.pages_mc.page1_mc etc, but how would I get a page into a
seperate swf on its own?
Can someone help me with this? I need to import a flash paper swf from INSIDE my main swf
and it just wont work. I can see the images but cant see anything more. need help really quick
plz!