To print a page in FLEX using javascript functions

To print the current page in flex its a simple app i will tell u how to do it.
The method used navigateTOURL() and class used URLRequest and a package used

first put a button control to call the function to print page. like shown below

<mx:Button id=”b1″ click=”printpagecall(event)” label=”print Me”/>

import the package*;

define the function as shown below

public function printpagecall(e:Event):void {
var u:URLRequest = new URLRequest(“javascript:printpage()”);  —> calling a function defined in html wrapper in script tag

now define the function printpage() in the html wrapper as shown below
<script lan………> in script tag
function printpage()
window.print();———> this will raise a dialog box  to print


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: