Trying Embed Hangs my Flash Player

Publishing Print2Flash Documents embedding them in Flex applications
Post Reply
swidnikk
Posts:4
Joined:Mon Dec 17, 2007 4:03 am
Trying Embed Hangs my Flash Player

Post by swidnikk » Mon Dec 17, 2007 4:07 am

I have tried several approaches to embed a print2flash swf in my Flex and Flash applications but every time I try to load... the swf hangs my player. I tried another simple swf file as a sanity check and it works fine. Are there any exampled of how to do this?

I am using the free version at this time.

Code: Select all

<mx:SWFLoader id="Doc" source="@Embed(source='Print2FlashDoc.swf')"/>	

Code: Select all

<mx:SWFLoader id="Doc" source="Print2FlashDoc.swf"/>	

Code: Select all

<mx:Image source="assets/Print2FlashDoc.swf"/>
And in a simple as3 class that extends sprite and calls this function... still does not work.

Code: Select all

//////////////////////////////////////////
		// Loading to a container
		//
		private var container:Sprite;
		private var pictLdr:Loader;
		public function loaderExample2():void
		{
			container = new Sprite();
			
			addChild(container);
			pictLdr = new Loader();
			var pictURL:String = "assets/print2flashfile.swf"
			var pictURLReq:URLRequest = new URLRequest(pictURL);
			pictLdr.load(pictURLReq);
			pictLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);
		}
		
		function imgLoaded(e:Event):void
		{
			container.addChild(pictLdr.content);
		}
Thanks.

BTW, persistent login option of the forums doesn't seem to be working either =(

staff
Posts:267
Joined:Sat Dec 15, 2007 4:48 pm

Re: Trying Embed Hangs my Flash Player

Post by staff » Mon Dec 17, 2007 6:56 pm

Please check this page for information on Flex embedding: http://print2flash.com/help/UsingDocume ... omFlex.php
Also, Print2Flash SDK contains a sample of embedding in Flex. (The SDK can be downloaded from http://print2flash.com/download.php , the sample is located in DocumentAPI\Samples\Flex folder of SDK archive)

swidnikk
Posts:4
Joined:Mon Dec 17, 2007 4:03 am

Re: Trying Embed Hangs my Flash Player

Post by swidnikk » Mon Dec 24, 2007 7:50 pm

First of all I'm using FlashDevelop and not Flex Builder. I downloaded the SDK and am trying to get the sample working. Something still isn't working though I've set up everything properly. I get a blank screen and am forced to kill the Flash Player process.

In debugging, I placed trace statements in each of the api functions found in Print2FlashDoc.mxml and nothing prints.

Any suggestions as to what I should check?

swidnikk
Posts:4
Joined:Mon Dec 17, 2007 4:03 am

Re: Trying Embed Hangs my Flash Player

Post by swidnikk » Sun Dec 30, 2007 5:54 am

I've spent some more time trying to figure this out with no luck. Is there anyone there that can point me in the right direction? Is there somewhere specific that I can place a trace statement perhaps?

Is there version of Flex that Print2Flash is known not to work?

I'm going to try without Flex, see how that goes, and then post back here if I have any success.

Thank you.

staff
Posts:267
Joined:Sat Dec 15, 2007 4:48 pm

Re: Trying Embed Hangs my Flash Player

Post by staff » Sun Jan 06, 2008 6:57 pm

The Flex SDK sample was designed and tested in Flex Builder 2. We also tried to compile the sample manually using only Flex SDK, and the sample worked, too. To compile using Flex SDK, you need to issue a command such as this:

Code: Select all

mxmlc docapisample.mxml
We suspect that if you get a blank screen, you run into Flash Player security settings problem when running the Flex sample from local disk. Try to upload the compiled sample to a web site and access it from there. (You'll need to upload docapisample.swf and sample.swf files and images folder).

If you still need to run the sample from local disk, you need to add the sample movie to the local trusted sandbox. This can be done, for example, by adding a file composed of line such as this

Code: Select all

E:\Print2FlashSDK\DocumentAPI\Samples\Flex\bin\docapisample.swf
to the c:\WINDOWS\system32\Macromed\Flash\FlashPlayerTrust directory. More information on this can be found in this document: http://www.adobe.com/devnet/flashplayer ... curity.pdf

davidzh
Posts:1
Joined:Thu Jan 17, 2008 5:31 pm

Re: Trying Embed Hangs my Flash Player

Post by davidzh » Thu Jan 17, 2008 5:37 pm

I'm having the exact same problem with Flex 3 Beta 3. I tried compiling the example. While it compiles fine, it hangs my browser.

Could you guys provide a fix for this problem? We are serious about licensing print2flash for our application. However, not being able to embed the end product in a flex application is a significant issue.

Thanks,

swidnikk
Posts:4
Joined:Mon Dec 17, 2007 4:03 am

Re: Trying Embed Hangs my Flash Player

Post by swidnikk » Fri Jan 18, 2008 7:07 am

Hi,
Though I haven't found the time to try out the solution suggested above yet, I think you should try checking your sandbox security settings. I read on a post in another forum about a similar problem with Adobe FlashPaper: the problem being: SWF works fine as a standalone, but when loaded by another SWF it doesn't work.

I agree with davidzh though, that it would be nice to see a formal explanation or example about this.

Thanks.

staff
Posts:267
Joined:Sat Dec 15, 2007 4:48 pm

Re: Trying Embed Hangs my Flash Player

Post by staff » Fri Jan 18, 2008 11:48 am

davidzh wrote:I'm having the exact same problem with Flex 3 Beta 3. I tried compiling the example. While it compiles fine, it hangs my browser.
Thanks,
We checked the sample from the SDK in Flex Builder 3 Beta 3 (build 3.0.1910133) and it worked fine. We imported a sample from SDK into Flex Builder 3, compiled and run it from there, and it worked without a problem. Do you mean our original sample does not work for you? Try to upload all the sample files to a web server and check if it works from a web server via http. Perhaps it is stil a security problem.

Post Reply