Public Function Setpicdata (parmproductnameid:int): void{ Trace ("The method Setflipbookdata in SWF is called, the array of parameter images Received::" + Parmproductnameid);
Productnameid = Parmproductnameid; Return
}//End Function
1, the SWF document class inside, write good flex call interface method;
2.
Flex loads the SWF file.
Gets the document class to the SWF, calling directly inside the interface method.
It then sets the display content in the SWF.
Initialize map public Function initialize (): Void{_zmdemoapp = Applicationfacade.getinstance (). Zmdemoapp;var _anliswfurl: String = Al_swfnamepath + ". swf"; if (_swfloader) {_swfloader.unload (); _swfloader = null;} _swfloader = new Loader (); _swfloader.contentloaderinfo.addeventlistener (Event.complete,anlicompletehandler); _swfloader.contentloaderinfo.addeventlistener (progressevent.progress, onloadprogress); _ SwfLoader.contentLoaderInfo.addEventListener (Ioerrorevent.io_error,onioerrorhandler); _swfloader.load (New URLRequest (_anliswfurl));} public Var Myasfunctions:object; As function object document class object Private function Anlicompletehandler (event:event): void{_ SwfLoader.contentLoaderInfo.removeEventListener (Event.complete,anlicompletehandler); _swfloader.contentloaderinfo.removeeventlistener (progressevent.progress, onloadprogress); _ SwfLoader.contentLoaderInfo.removeEventListener (Ioerrorevent.io_error,onioerrorhandler);//Manage as file objects, This object can call the open interface in the SWF myasfunctions = event.target.loader.content;//passing parameters to the SWF image array and width height myasfunctions.setpicdata (2);}
Flex with the loaded SWF parameter to get the document class