## Print2Flash Document API Sample for ActionScript2 documents for Flex

### Sample function:

This sample demonstrates how a Print2Flash document using ActionScript2 can be embedded into a Flex application and programmatically manipulated using Print2Flash Document API.

Note: Embedding of ActionScript2 documents in Flex and using Print2Flash Document API from it is possible but not recommended. The method demonstrated by this sample is deprecated due to poor interoperability support by the Flash Player between ActionScript2 and ActionScript3 movies. It is preferable to use ActionScript3 documents with Flex. See the sample located in the "DocumentAPI\ActionScript3 documents\Samples\Flex" folder of SDK archive.

### Installation instructions:

Just unpack the sample folder to disk.

### Usage instructions:

The sample contains the standard Flex project files altogether with a sample Print2Flash document located in bin\sample.swf file.

To launch the sample:

1. Launch the sample by double clicking bin\docapisample.html file in Windows Explorer.
2. You should see a sample Flex application with a Print2Flash document embedded in it You can manipulate the document either from its native gray toolbar or using buttons located above the movie. These buttons are contained in the Flex application and the button clicks are communicated to the embedded Print2Flash document via Print2Flash Document API.
   Also, above the Print2Flash document you should see a current page number indicator which is updated if you scroll the document. These updates are performed with Print2Flash Document API events.

To see and analyze the source code you need to open docapisample.mxml file either in a plain text editor or Adobe Flex Builder. Of course, you can load your own Print2Flash documents using this sample. Note that to load a document in Flex and access it via Print2Flash Document API you should clear "Disable Print2Flash Document API support" option in the Protection tab of Document Options window when converting the document. Also, you must generate ActionScript2 documents in order to be able to use them with this sample. This is controlled with Flash Document Format field in the Flash Output Tab of Document Options window.

Copyright (C) Print2Flash Software. All rights reserved | www.print2flash.com