[flexcoders] FlashPaper in SWFLoader

2006-10-25 Thread Nick Collins



I'm having problems loading a FlashPaper document into a SWFLoader. It loads just fine, but the scaling isn't as I'd like it. Instead of scaling like it does when you load it into a browser window, where the controls stay the same height and just the viewing area scales, the FlashPaper maintains it's default scaling. I think the default size is like 400 x 300, and it just scales that, control bar and all. Is there any way within the SWFLoader to have the FlashPaper display like it does in the browser window?


__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Software development tool
  
  
Software development
  
  
Software development services
  
  


Home design software
  
  
Software development company
  

   
  






  
  Your email settings: Individual Email|Traditional 
  Change settings via the Web (Yahoo! ID required) 
  Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured 
   
Visit Your Group 
   |
  
Yahoo! Groups Terms of Use
   |
  
   Unsubscribe 
   
 

  




__,_._,___



Re: [flexcoders] FlashPaper in SWFLoader

2006-10-25 Thread Darron J. Schall
If you're using Flex 1.5, use the FlashPaperLoader class from Matt 
Chotin:  
http://www.cflex.net/showfiledetails.cfm?ChannelID=1Object=FileobjectID=117

If you're using Flex 2, it's a lot trickier.  Normally, you resize the 
FlashPaper.swf by using the FlashPaper API [1], and just calling the 
setSize( width, height ) method.  However, because the FlashPaper.swf 
lives inside of AVM1 and the Flex 2 loading .swf lives inside of AVM2, 
you can't just directly talk between them.

I've come up with a solution, but it's not exactly trivial.  I'll 
describe it here at a high level, and hopefully get it up on my weblog 
sometime in the near future when I have some time to package it up.

* Create a FlashPaperLoader.swf in Flash that uses a MovieClipLoader to 
load the FlashPaper document.  In this loader.swf, you need to shimmy in 
methods for communication between AVM1 and AVM2.  It's possible to use 
either LocalConnection or ExternalInterface for this, but essentially, 
the FlashPaperLoader.swf is responsible for exposing methods to AVM2 
that simply proxy the method call and parameters to the loaded 
FlashPaper.swf document.
* Instead of loading the FlashPaper.swf directly, load the 
FlashPaperLoader.swf proxy and pass it the URL of the real 
FlashPaper.swf to load.  Use the AVM1/AVM2 communication mechanism you 
created in the previous step to send progress information from the 
loading movie over to Flex 2, so that you can report load progress 
effectively to the user.
* When the load is complete, call the setSize on the 
FlashPaperLoader.swf, again, using the AVM1/AVM2 communication 
mechanism.  When you call setSize on FlashPaperLoader, it should proxy 
that call to the loaded FlashPaper document.
* Use the resize event in Flex 2 to make setSize calls, so that 
resizes the browser or container sets the correct FlashPaper size.

When all is said and done, you end up with the desired behavior of 
loading a FlashPaper document, having it fill the available area, and 
having the correct scale.  Again, it's not exactly trivial to get this 
working, but I'm hoping to release my FlashPaperLoader component and 
support files sometime in the near future.

Good luck,

-d

[1] 
http://www.adobe.com/support/documentation/en/flashpaper/2/flashpaper_api/flashpaper_api4.html

Nick Collins wrote:

 I'm having problems loading a FlashPaper document into a SWFLoader. It 
 loads just fine, but the scaling isn't as I'd like it. Instead of 
 scaling like it does when you load it into a browser window, where the 
 controls stay the same height and just the viewing area scales, the 
 FlashPaper maintains it's default scaling. I think the default size is 
 like 400 x 300, and it just scales that, control bar and all. Is there 
 any way within the SWFLoader to have the FlashPaper display like it 
 does in the browser window?

  



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 



Re: [flexcoders] FlashPaper in SWFLoader

2006-10-25 Thread Nick Collins



Yeah, I did something similar to that but ran into problems with it loading multiple instances of that flashpaper loader swf where it kinda crapped out, so I was looking for a way to just load in the Flashpaper swfs (cfreport generated) directly.
On 10/25/06, Darron J. Schall [EMAIL PROTECTED] wrote:













  



If you're using Flex 1.5, use the FlashPaperLoader class from Matt 
Chotin:  
http://www.cflex.net/showfiledetails.cfm?ChannelID=1Object=FileobjectID=117


If you're using Flex 2, it's a lot trickier.  Normally, you resize the 
FlashPaper.swf by using the FlashPaper API [1], and just calling the 
setSize( width, height ) method.  However, because the FlashPaper.swf 
lives inside of AVM1 and the Flex 2 loading .swf lives inside of AVM2, 
you can't just directly talk between them.

I've come up with a solution, but it's not exactly trivial.  I'll 
describe it here at a high level, and hopefully get it up on my weblog 
sometime in the near future when I have some time to package it up.

* Create a FlashPaperLoader.swf in Flash that uses a MovieClipLoader to 
load the FlashPaper document.  In this loader.swf, you need to shimmy in 
methods for communication between AVM1 and AVM2.  It's possible to use 
either LocalConnection or ExternalInterface for this, but essentially, 
the FlashPaperLoader.swf is responsible for exposing methods to AVM2 
that simply proxy the method call and parameters to the loaded 
FlashPaper.swf document.
* Instead of loading the FlashPaper.swf directly, load the 
FlashPaperLoader.swf proxy and pass it the URL of the real 
FlashPaper.swf to load.  Use the AVM1/AVM2 communication mechanism you 
created in the previous step to send progress information from the 
loading movie over to Flex 2, so that you can report load progress 
effectively to the user.
* When the load is complete, call the setSize on the 
FlashPaperLoader.swf, again, using the AVM1/AVM2 communication 
mechanism.  When you call setSize on FlashPaperLoader, it should proxy 
that call to the loaded FlashPaper document.
* Use the resize event in Flex 2 to make setSize calls, so that 
resizes the browser or container sets the correct FlashPaper size.

When all is said and done, you end up with the desired behavior of 
loading a FlashPaper document, having it fill the available area, and 
having the correct scale.  Again, it's not exactly trivial to get this 
working, but I'm hoping to release my FlashPaperLoader component and 
support files sometime in the near future.

Good luck,

-d

[1] 
http://www.adobe.com/support/documentation/en/flashpaper/2/flashpaper_api/flashpaper_api4.html


Nick Collins wrote:

 I'm having problems loading a FlashPaper document into a SWFLoader. It 
 loads just fine, but the scaling isn't as I'd like it. Instead of 
 scaling like it does when you load it into a browser window, where the 
 controls stay the same height and just the viewing area scales, the 
 FlashPaper maintains it's default scaling. I think the default size is 
 like 400 x 300, and it just scales that, control bar and all. Is there 
 any way within the SWFLoader to have the FlashPaper display like it 
 does in the browser window?

  


  















__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Software development tool
  
  
Software development
  
  
Software development services
  
  


Home design software
  
  
Software development company
  

   
  






  
  Your email settings: Individual Email|Traditional 
  Change settings via the Web (Yahoo! ID required) 
  Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured 
   
Visit Your Group 
   |
  
Yahoo! Groups Terms of Use
   |
  
   Unsubscribe 
   
 

  




__,_._,___



Re: [flexcoders] FlashPaper in SWFLoader

2006-10-25 Thread Darron J. Schall
The solution I used was to just create a unique id when you want to load 
a FlashPaper.swf, and pass that value to the loader.  The AVM1/AVM2 
communication channels then use that specific id so that you can load 
multiple isntances of them without interfering with each other.

As and aside, we're using cfreport to load our FlashPaper.swfs into 
Flex 2 as well.  My fingers are crossed that theres an upgrade coming 
down the line to ColdFusion that would make FlashPaper SWF9 compatible 
so we can talk directly with the loaded reports.  One can hope.. but 
until then, the AVM1/AVM2 solution isn't bad once you get it in place. 

Like I said, I'll try to get it packaged up on my weblog soon so you can 
see how to do it.

-d

Nick Collins wrote:

 Yeah, I did something similar to that but ran into problems with it 
 loading multiple instances of that flashpaper loader swf where it 
 kinda crapped out, so I was looking for a way to just load in the 
 Flashpaper swfs (cfreport generated) directly.





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/