Hi,
I have recently downloaded the commercial trial (2.7:32 bit) of
Print2Flash and the SDK (2.7). So far Flex (Builder 2) integration is
going well, although I still have a few issues:
1. Is it possible to change the light blue background colour behind the doc?
If not with the public API, maybe there is a programmatic way I can do it?
I'm looking for any solutions here. If I'm unable to make the background
white this is going to be a show-stopper for me WRT Print2Flash.
2. Can I get the document to appear scrolled down slightly?
For aesthetic reasons, I need the doc to appear scrolled down a tiny bit.
I have tried hiding the document, setting the scroll using setScrollPosition,
then making it visible in the onLoaded event. Unfortunately the doc still
appears unscrolled then flicks down after about 1/2 a second. Any
suggestions on this?
3. Is it possible to change the Print2FlashDoc source property dynamically?
Ideally I would like a single Print2FlashDoc in my markup and load different
swf docs into it via script. I have tried setting the source property to a different
doc in script, but the new document does not appear.
If I can find solutions to the above issues, I would happily buy a full
commercial licence and go with Print2Flash for our site.
Many thanks
Flex SDK Questions
Re: Flex SDK Questions
1. Currently there is no function in Document API to set document area background color. However, if you used Print2Flash document from ActionScript 2, the color could be changed with the code like this:
but as you are loading documents from Flex, this would not work as cross-scripting between AS2 and AS3 movies is not allowed. A possible solution is to embed a Print2Flash document into a "wrapper" AS2 movie (created with Macromedia Flash Professional or Adobe CS3 with AS2 support) which would load your document and sets the color using the code above. Then you could load that wrapper movie instead of the document itself into Print2FlashDoc Flex component.
This solution should work but it appears rather cumbersome and we'll probably include a direct API function for changing colors in future versions of Print2Flash
2. This is possible to achieve. The problem is document becomes visible before scrolling is completed due to asynchronous nature of AS2/AS3 interaction. To make it work, you need to do the following:
a) Hide the Print2FlashDoc component instance before loading the document by setting its visible property to false
b) implement an onLoaded event handler and put the code such as this there:
This will make the document to scroll a bit from the top
c) implement an onVisibleAreaChanged event handler and add this code there:
This will make the document visible again after scrolling is completed
3. Please download the latest SDK (2.7.0.1) from http://print2flash.com/download.php This problem is fixed there
Code: Select all
p2f.DocArea.setStyle("backgroundColor", 0x800000)
This solution should work but it appears rather cumbersome and we'll probably include a direct API function for changing colors in future versions of Print2Flash
2. This is possible to achieve. The problem is document becomes visible before scrolling is completed due to asynchronous nature of AS2/AS3 interaction. To make it work, you need to do the following:
a) Hide the Print2FlashDoc component instance before loading the document by setting its visible property to false
b) implement an onLoaded event handler and put the code such as this there:
Code: Select all
doc.setScrollPosition(new Print2Flash.Point(0,5))
c) implement an onVisibleAreaChanged event handler and add this code there:
Code: Select all
if (event.area.vPosition==5) doc.visible=true;
3. Please download the latest SDK (2.7.0.1) from http://print2flash.com/download.php This problem is fixed there
Re: Flex SDK Questions
Beautiful! Thank you, this is just the solution I was looking for. I was already using a "wrapper" AS2 movie, just as you suggested, to gain access to the p2f onload event and to show a "loading" message as my server processes the document itself.staff wrote:1. Currently there is no function in Document API to set document area background color. However, if you used Print2Flash document from ActionScript 2, the color could be changed with the code like this:but as you are loading documents from Flex, this would not work as cross-scripting between AS2 and AS3 movies is not allowed. A possible solution is to embed a Print2Flash document into a "wrapper" AS2 movie (created with Macromedia Flash Professional or Adobe CS3 with AS2 support) which would load your document and sets the color using the code above. Then you could load that wrapper movie instead of the document itself into Print2FlashDoc Flex component.Code: Select all
p2f.DocArea.setStyle("backgroundColor", 0x800000)
Are there other properties/methods that I am able to access in a similar fashion? For example, am I able to modify the background colors of other parts of the flash UI? Am I able to modify borders and border colors? [Are all of these properties already listed somewhere, and I'm just missing it?]
In particular, just like SamK, I would also like to make the background color white [already done - thanks!], but I want to show a darker border around each page, to distinguish pages from the background. Can this be accomplished? Thanks in advance.
Re: Flex SDK Questions
Oh good. I thought I might have to implement my own "InternalInterface" to do this. I'll give it a go.A possible solution is to embed a Print2Flash document into a "wrapper" AS2 movie (created with Macromedia Flash Professional or Adobe CS3 with AS2 support) which would load your document and sets the color using the code above. Then you could load that wrapper movie instead of the document itself into Print2FlashDoc Flex component.
A new backgroundColor property in the next API would be great..
This worked, thanks. I actually tried onVisibleAreaChanged at one point, but not with the vPosition check.a) Hide the Print2FlashDoc component instance before loading the document by setting its visible property to false
b) implement an onLoaded event handler
c) implement an onVisibleAreaChanged event handler
Will do, thanks for all the help.Please download the latest SDK This problem is fixed there
Re: Flex SDK Questions
Actually for scrolling the document pages Print2Flash uses standard ScrollPane Flash component. It has a number of properties and methods which you can use to achieve additional functionality. Here is the link to the help page on this component: http://livedocs.macromedia.com/flash/8/ ... 03977.html Colors of this component are controlled by styles which are detailed here: http://livedocs.macromedia.com/flash/8/ ... 03975.htmljaymz wrote: Are there other properties/methods that I am able to access in a similar fashion? For example, am I able to modify the background colors of other parts of the flash UI? Am I able to modify borders and border colors? [Are all of these properties already listed somewhere, and I'm just missing it?]
In particular, just like SamK, I would also like to make the background color white [already done - thanks!], but I want to show a darker border around each page, to distinguish pages from the background. Can this be accomplished? Thanks in advance.
To draw a border around a page, you may obtain a reference to the page movie instance using this code:
Code: Select all
var page1=doc.Pages[0].movie
Note that all these methods are currently undocumented and may stop to work in future versions of Print2Flash. We plan to add documented methods for doing this in the future.
Re: Flex SDK Questions
Cool. This sounds just what I was looking for again! I'll check it out today. Thanks for your fast reply... keep up the good work, all!staff wrote: Actually for scrolling the document pages Print2Flash uses standard ScrollPane Flash component. It has a number of properties and methods which you can use to achieve additional functionality. Here is the link to the help page on this component: http://livedocs.macromedia.com/flash/8/ ... 03977.html Colors of this component are controlled by styles which are detailed here: http://livedocs.macromedia.com/flash/8/ ... 03975.html