Code: Select all
import Print2Flash.*;
var _mClip:MovieClip;
this.stage.scaleMode = "noScale";
var P2FDoc:Print2FlashDoc=new Print2FlashDoc("load/GlobalLocateChipsetDatasheet.swf",0,0,600,800,this);
P2FDoc.addEventListener("onLoaded", onP2FLoaded);
function onP2FLoaded(e:flash.events.Event) {
trace("file loaded.");
P2FDoc.setCurrentZoom(100);
P2FDoc.getCurrentZoom(ongetCurrentZoom);
P2FDoc.setScrollPosition(new Print2Flash.Point(0,0));
_mClip = P2FDoc.getPage(1);
P2FDoc.getScrollPosition(onGetScrollPosition);
}
function onPageChanged(e:PageChangedEvent) {
trace("page changed to " + e.page.toString());
}
P2FDoc.addEventListener("onPageChanged", onPageChanged);
function ongetCurrentZoom(page:Number):void {
trace("current zoom - " + page);
}
function onGetPageMovie(_mClipVar:MovieClip):void {
_mClip = _mClipVar;
}
function onGetScrollPosition(ptLocalObj:Object):void {
trace(ptLocal);
var ptLocal:Print2Flash.Point = Print2Flash.Point(ptLocalObj);
//trace("current position - " + ptLocal.x + "," + ptLocal.y);
}
1061: Call to a possibly undefined method getPage through a reference with static type Print2Flash:Print2FlashDoc.
I tried replacing the line
Code: Select all
_mClip = P2FDoc.getPage(1);
Code: Select all
P2FDoc.getPage(onGetPageMovie, 1);
Code: Select all
P2FDoc.getPage(1, onGetPageMovie);
Am facing similar problems with getScrollPosition call as well. The error am getting is
Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095: flash.net.LocalConnection was unable to invoke callback CallBack. error=TypeError: Error #1034: Type Coercion failed: cannot convert Object@5ab69e9 to Print2Flash.Point.
Any insight will be highly appreciated.
Thanks in advance.