The p2f document panel is not resizing according to the browser window.
ie. if the browser window opening in small size and after that when we try to maximize it, the document is remaining in small size
and also in other case
ie. the size will remain maximum even after we reduce the browser window size .
how can this be avoided?
Resizing according to the browser page?
Re: Resizing according to the browser page?
When your stage resizes, you want to make sure that your print2flash doc resizes along with it. I got around that problem while embedding in Flash by creating an onResize listener on the Stage itself. Inside the listener, use p2fDoc.setSize, passing Stage.width and Stage.height.
-
- Posts:6
- Joined:Wed Mar 05, 2008 11:35 am
Re: Resizing according to the browser page?
Anyone have any code samples for dealing with the resizing issue? Or other suggestions?
So, far I haven't had any luck making it work.
Many thanks,
David
So, far I haven't had any luck making it work.
Many thanks,
David
Re: Resizing according to the browser page?
I don't know Flex... but here is the AS2 code that is working for me:davidrepas wrote:Anyone have any code samples for dealing with the resizing issue? Or other suggestions?
Code: Select all
var stageListener:Object = new Object();
stageListener.onResize = function () {
p2fDoc.setSize(Stage.width, Stage.height);
}
Stage.addListener(stageListener);
Hope it helps!
Re: Resizing according to the browser page?
In Flex you can use this approach:
1. Add this code into your application:
2. Call appInit at application start, for example, call it from applicationComplete event handler
3. Set "100%" as a value for width and height application properties. Your application tag should look like this:
1. Add this code into your application:
Code: Select all
import mx.events.ResizeEvent;
public function appInit():void {
addEventListener(mx.events.ResizeEvent.RESIZE, onResize);
onResize(null);
}
public function onResize(event:mx.events.ResizeEvent):void {
doc.setSize(width,height);
}
3. Set "100%" as a value for width and height application properties. Your application tag should look like this:
Code: Select all
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="Print2Flash.*" width="100%" height="100%" applicationComplete="appInit()">
-
- Posts:6
- Joined:Wed Mar 05, 2008 11:35 am
Re: Resizing according to the browser page?
Perfect! Thanks.
Re: Resizing according to the browser page?
Hi,
I have same to do with flex 3.
This is error I have when window resized in debug mode. However it works in release mode.
undefined
at mx.managers::SystemManager/Stage_resizeHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\SystemManager.as:2580]
ruslan
I have same to do with flex 3.
This is error I have when window resized in debug mode. However it works in release mode.
undefined
at mx.managers::SystemManager/Stage_resizeHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\SystemManager.as:2580]
ruslan