How to print from flex app by clicking print in context menu
I want my flex 4 application to print proper picture w开发者_如何学运维hen I click on print in context menu of Adobe Flash Player. Is it possible?
Proper picture - picture just a bit different then you see at the screen. I mean some colors are different.The "print" context menu item is not suitable for printing from Flex applications. It is more appropriate for Flash applications created with Flash Professional. You should implement your own printing functionality.
If you wish to print from the context menu then you could create a Custom "context menu" in flex via the ContextMenu and ContextMenuItem classes. See also Working with Menus in the AS3 Developer's Guide.
To change the context menu:
var my_cm:ContextMenu = new ContextMenu();
my_cm.hideBuiltInItems();
var printItem:ContextMenuItem = new ContextMenuItem("Print proper image");
my_cm.customItems.push(printItem);
this.contextMenu = my_cm;
Don't forget that you can't use the "Print"
caption, because it is reserved for the internal print function (see Restrictions).
精彩评论