Page 1 of 1

Embed p2f files in flex at compile time

Posted: Mon Mar 16, 2009 1:55 pm
by shahgun
I am trying to embedded the SWF generated by Print2Flash in another Wrapper SWF file. We want to put some custom code (like entitlements check) before showing P2F SWF file. Hence we thought of using a wrapper SWF file which will load the P2F internally. We want to remove the original p2f swf file after doing this.


I am trying to do it in following ways:

Sample.swf is created by Print2Flash.



1. This displays the P2F file inside the wrapper. But this approach loads the P2F SWF from the given location dynamically. In our application, the P2F file is secured and can be shown only to entitled users. Hence, we want to follow the 2nd approach detailed below which is not working for us.


<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="Print2Flash.*">

<ns1:Print2FlashDoc x="10" y="10" width="100%" height="100%" id="doc" source=”sample.swf">

</ns1:Print2FlashDoc>

</mx:Application>


2. Doesn’t Work – This does not display the P2F file at all.


<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="Print2Flash.*">

<ns1:Print2FlashDoc x="10" y="10" width="100%" height="100%" id="doc" source="@Embed(source='sample.swf')">

</ns1:Print2FlashDoc>

</mx:Application>