FlashPaper 0.8 has been released.
I’m not exactly sure how many people are using my FlashPaper component but it has been in dire need of an update.
I originally built the component when I was still learning how to best write components, and at the time I thought the best way was to use the version 2 architecture. Unfortunately I soon realized that that meant a lot of unneeded overhead.
So version 0.7 is a complete rewrite from the ground up! No more version 2 architecture. It extends a custom Component class (that allows it to work with Flash Player 6) which in turn extends MovieClip directly. You should notice a significant filesize drop in the final swfs.
Changes:
1) Complete rewrite … extends MovieClip instead of using the V2 architecture.
2) Added the official Macromedia fix to a bug that can plague FlashPaper.
3) Updated the events and added a few more … NOTE: many event names have changed.
4) The interface IFlashPaper and the class SelectionRange have been implemented. This allows the return values from several of the methods to be accurate.
5) Fixed several small yet annoying bugs.
6) Completely updated the documentation.
Description:
The FlashPaper component simplifies the process of working with the FlashPaper API and adds functionality either not documented or not provided in the API.
Installation:
– Unzip FlashPaper_0.7.zip
– DoubleClick on FlashPaper.mxp to install with the Extension Manager.
Documentation:
FlashPaper Component Documentation
This is a great component. But how would I assign the swf location dynamically as a variable?
Hey Steve,
That’s covered in the documentation. Look at “documentPath”. You can set the documentPath dynamically and then call “load” on the FlashPaper component.
Great,
I have not got it to work, I set the instance name and tried “document_fp.load(“mcs_detai_3_25l.swf”);”
did not work. What do I put in the component as the document name?
thanks
steve
Hey Steve,
You’re right … I’ve posted a fix for that issue.
You can download the latest version of the component, 0.7.1, from the “DOWNLOADS” link above.
Thanks and let me know if you run into any other issues.
Thanks for excellent component.
I just have one problem. When I use the function _root.document_fp.destroy(); to unload a flashpaper when opening other swf files in targets, it’s impossible to load the _root.document_fp.load(); later on.
Any clues on how to do this?
That update worked great, thank you.
steve
Which update are you refering to, Steve?
The problem as I have described in the posting above is still there, unfortunately.
Kind regards, Magnus
Hey Magnus,
Steve’s referring to the issue he brought up above, not your comment.
Yours is not truly an issue, just a misuse of the method destroy().
Destroy does not just unload the FlashPaper document but also does what the name entails and destroys the actual reference to the component completely. It frees up all memory used by the FlashPaper component.
I am looking into adding an unload() method as well that will help you out, I can now see why you were confused… I’ll keep you posted.
Yes, I was referring to update version 0.7.1
Is there a way to change the accent shade, from that strange green, on the active scrollbar?
steve
Steve,
I’ve done a lot of digging into the green coloring of the flashpaper documents, and unfortunately it seems like the graphics that are used, ie the scrollbar, buttons, etc, are actual Flash Graphics and not MovieClips, which means that they do not have instance names, which in turn means that they cannot be targetted to dynamically change their color. This was an unfortunate oversight at Macromedia, forcing the highlight color to be one specific color. It would be really nice to have a property, like highlightColor, to globally change all the green to any other color. But to the best of my knowledge that is not possible. If anyone else knows differently please let me know.
Your FlashPaper component is a true marvel. If you would like to see a simple end-use, vist http://www.infonomx.com/Flash/FlashPaper2.html Your component allows the navigation of a FlashPaper document using topics. That is, the list component is populated with topics from a XML file which includes label=topics and data=page number associated with topics. Scroll down the page to download demo and code.
Can you repeat this same magic in Flex 2? If so, I’ll donate a $100.
Thanks,
Jim Canady
infonomx2@mindspring.com
Is there a way to set the width to 100%? Or… resize dynamically?
I have an area on the page that changes width and I would like the flashpaper file to always fill 100% of the available width.
It is easy to set the and tags to 100%, but the flashpaper file always stays at whatever width I specify in your component.
Help?
Does anyone have any suggestions for my question regarding dynamic widths? Can I set the Flash Paper doc to 100%…. I really want to avoid switching to an embedded pdf if at all possible.
Hey Mike,
Yes you can set the width to 100%…
just call myFlashPaper.currentZoom = 100;
You can also set the document to show the exact width of the document by calling myFlashPaper.currentZoom = “width”; … and you can set it to “page” if you want the entire page to be seen.
If you want to resize the actual FlashPaper component you will need to setup a Stage listener and set the width and height of the component on resize.
I too have been trying to get the FlashPaper component to resize with the browser window. It works in the default FlashPaper implementation and is even something they list in the “FlashPaper Features,” but it goes away when you modify the interface. Jase, can you tell us how to set up the Stage listener that will do this?
Thank you for the excellent component. The tutorial was really helpful too.
Joseph
I`m trying to use getIFlashPaper func to
change thr way flashPaper deals with hyperlink.
I can get it working without using the component but not with. Any ideas? Many thanks.
var flashpaperListener:Object = new Object;
flashpaperListener.onLoadComplete = function(evtObj:Object) {
trace (“onLoadComplete: ” + evtObj.target);
var fp = this.myFlashPaper.getIFlashPaper()
fpAPI=fp;
_global.originalFlashPaperAPI={
goToLinkTarget: fpAPI.goToLinkTarget
}
// replace with our own API-method
fpAPI.goToLinkTarget=function(x,y){
if (x.indexOf(“www.asfunction.com”)
is there a way to make a save as pdf button?
Hello Mark! Bless you sir for making this component. I have not used it yet, but am thrilled that I can assert more control over the UI if I or my clients wish. Where is your tip jar? 🙂
I have put in a feature request with Adobe for FP to support PARAM attributes for rudimentary control on load. That should not impact the need for security provided via API control or commercial options like at Zanzibar Fiction.
It’s possible to force via actionscript the scrolling of pages (in order to simulate mouse wheel)?
Something like doScroll(nLines);
I really need that..
Hi,
I’m a beginner in AS and i wish to use flashpaper .swf with your component on flash8.
I have website with contener.swf and nav.swf.
In contener there is MC in wich i load .swf i want.
such .swf are flashpaper filer. How i use your component ?
Thanks
Philippe
This a great component, and it’s much appreciated. I’m having a problem, however getting it to work. When I test in flash, everything is fine, but when viewed in IE6, the events aren’t working. I tested this with a very simple file that called the fp .swf and implemented a button that I could use to resize it after it loaded. It works fine when tested in flash, but it will not resize when viewed in IE6. Any suggestions?
Hi there! This component is just awesome! Everything works just fine, BUT something really akward happens every time I load that swf that holds the component onto level 1 through a button in a swf on level 0 a browser window opens up with the flashpaper at the same time, which I really dont want. I am higly confused and would be really thankfull if you could help me! Kind regards from good old Germany, Frieda
Hi. Thanks for this component. It’s easy to use it and to configurate it.
Nevertheless I have a little problem. I’m trying to use it as a Pdf viewer. And it don’t works.
Is there some parameters to adjust?
Any ideas?
Gauvain, this is not a PDF viewer. You’ll have to convert your PDFs to Flash using the original Macromedia FlashPaper application. Then use the resulting SWF with this component.
Now I’m having a problem with resizing the FlashPaper component. I’m using the following code:
function onResize()
{
myFlashPaper._width=Stage.width;
myFlashPaper._height=Stage.height;
}
But that doesn’t work propery. The second I start resizing the window, the FlashPaper component becomes completely distorted! (it becames too small and too wide, so it’s unreadable). How can I fix that?
BTW, I’m also using this at the beginning of the code:
Stage.align = “TL”;
Stage.scaleMode = “noscale”;
Stage.addListener(this);
So the stage aligns to the top left, the movie doesn’t automatically scale (because then the Flashpaper UI would resize too), and then a listener is added so the onResize() method works.
Everything seems to be working fine, except that the Flashpaper component becomes distorted when resizing the window 🙁
Any ideas?
OMA
Ok, I got it! I finally found the way to dinamically resize the FlashPaper Component when resizing the window of the player or web browser. I just had to check the component documentation 😉
This is the code that works:
Stage.align = “TL”;
Stage.scaleMode = “noscale”;
Stage.addListener(this);
function onResize()
{
myFlashPaper.setSize(Stage.width,Stage.height);
}
onResize();
With that, it will get automatically resized when the user resizes the container window (if it’s a web page, make sure the Flash movie is set to 100% width and height). Using this method, the UI (the top bar with icons) won’t get bigger when resizing, only the display area will get bigger.
OMA