当前位置: 首页 > news >正文

怎么搞自己的网站科技网站哪个好

怎么搞自己的网站,科技网站哪个好,wordpress 首页折叠,wordpress安全设置教程as3项目要调用外部swf里的类有3种方法#xff1a; 1.将外部的swf发布为swc#xff0c;使用时将swc引用添加到相应的项目中#xff0c;这应该是最简单的一种引用。不过当项目中的类或组件比较多时就会使项目发布生成的swf文件大小过大; 2.通过资源绑定外部的#xff0c;然后…  as3项目要调用外部swf里的类有3种方法   1.将外部的swf发布为swc使用时将swc引用添加到相应的项目中这应该是最简单的一种引用。不过当项目中的类或组件比较多时就会使项目发布生成的swf文件大小过大;   2.通过资源绑定外部的然后直接通过类名获取。如[Embed(sourceassets/icon/skin.swf,symbolBtn_Max)],这种方法也会引起swf文件过大;   3.通过域来来获取外部swf里的绑定类这种方法可以在需要用时才去加载相应的swf文件然后再获取所需要的类。   下面是根据第三种方法来获取所需要的类   package com.mobiano.flipbook.pageeditor {import com.flasht.tui.display.TArrow;import com.mobiano.flipbook.config.FlipBookConfig;import com.tflash.Components.util.SWFLoader;import flash.display.DisplayObject;import flash.errors.IOError;import flash.events.Event;import flash.events.IOErrorEvent;import flash.events.ProgressEvent;import flash.utils.Dictionary;public class PlugInManager{public static var allExternalClass:Object{};//public var loadingQueue:Object{};//public var swfLoader:SWFLoader;public var loadingQueue:Dictionarynew Dictionary();private static var canInstace:Booleanfalse;private static var instace:PlugInManager;private var filePrefix:String./files/pageConfig/;private var fileSuffix:String.swf;public function PlugInManager(){if(!canInstace){throw new Error(Cant new PlugInManager); }}public static function getInstace():PlugInManager{if(instacenull){canInstacetrue;instacenew PlugInManager();canInstacefalse;}return instace;} public function getComponent(target:TAnnoPlugIn,cpName:String,extClassName:String):void{if(cpNamenull||cpName.length1||extClassNamenull||extClassName.length1)return ;if(allExternalClass.hasOwnProperty()){//return allExternalClass[cpName];var swfLoader:SWFLoaderallExternalClass[cpName];var cl:ClassswfLoader.GetClass(extClassName);if(cl!null){var extObj:IPlugInInterfacecreateSWFClass(cl);if(extObj!null){target.extObjextObj;}}}else{load(target,cpName,extClassName);}//return null;}public function getSwfUrl(cpName):String{if(cpName!null){return filePrefixcpNamefileSuffix;}return null;}protected function getURLFrom(url:String):String{return com.mobiano.flipbook.config.FlipBookConfig.getURLForm(url);}private function load(target:TAnnoPlugIn,cpName:String,extClName:String):void{var swfUrl:StringgetSwfUrl(cpName);if(swfUrlnull||swfUrl.length1)return;swfUrlgetURLFrom(swfUrl);var swfLoader:SWFLoadernew SWFLoader(swfUrl);swfLoader.addEventListener(Event.COMPLETE,onComplete);swfLoader.addEventListener(ProgressEvent.PROGRESS,onProgress);swfLoader.addEventListener(IOErrorEvent.IO_ERROR,onIOError);var obj:Object{target:target,compontName:cpName,extClassName:extClName};//loadingQueue[cpName]obj;loadingQueue[swfLoader]obj;swfLoader.Load();}private function onComplete(evt:Event):void{trace(evt.currentTarget);if(evt.currentTarget is SWFLoader){var loader:SWFLoaderevt.currentTarget as SWFLoader;if(loader in loadingQueue){var obj:ObjectloadingQueue[loader];if(obj[target]obj[compontName]obj[extClassName]){var cpName:Stringobj[compontName];var extClassName:Stringobj[extClassName];allExternalClass[cpName]loader;var cl:Classloader.GetClass(extClassName);var target:TAnnoPlugInobj[target];if(cl!null){//allExternalClass[cpName]cl;var extObj:IPlugInInterfacecreateSWFClass(cl);if(extObj!null){target.extObjextObj;}}}//loader.GetClass(//var target:TAnnoPlugInloadingQueue[loader];} }}private function createSWFClass(cl:Class):IPlugInInterface{var extObj:IPlugInInterface;try{if(cl!null){extObjnew cl();}}catch(e:Error){return null;}return extObj;}private function onProgress(evt:ProgressEvent):void{}private function onIOError(evt:IOError):void{throw new Error(Load swf error:evt);}} }package com.tflash.Components.util {import flash.display.DisplayObject;import flash.display.Loader;import flash.display.LoaderInfo;import flash.events.Event;import flash.events.EventDispatcher;import flash.events.IEventDispatcher;import flash.events.IOErrorEvent;import flash.events.ProgressEvent;import flash.net.URLRequest;import flash.system.ApplicationDomain;import flash.system.LoaderContext;[Event(namecomplete, typeflash.events.Event)][Event(nameprogress,typeflash.events.ProgressEvent)][Event(nameio_error,typeflash.events.IOErrorEvent)]public class SWFLoader extends EventDispatcher{private var loader:Loader;private var content:DisplayObject;private var loadComplete:Booleanfalse;private var url:String;public function SWFLoader(url:String){this.urlurl;}public function Load(url:Stringnull):void{if(url!null){this.urlurl;}loadCompletefalse;if(loadernull){loadernew Loader();}else{loader.unloadAndStop(true);if(loader.contentLoaderInfo.hasEventListener(Event.COMPLETE)){loader.contentLoaderInfo.removeEventListener(Event.COMPLETE,onLoadComplete);}if(loader.contentLoaderInfo.hasEventListener(ProgressEvent.PROGRESS)){loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR,onLoadIOError);}if(loader.contentLoaderInfo.hasEventListener(IOErrorEvent.IO_ERROR)){loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR,onLoadIOError)}}var context:LoaderContextnew LoaderContext();context.applicationDomainnew ApplicationDomain(ApplicationDomain.currentDomain);var request:URLRequestnew URLRequest(this.url);loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onLoadComplete);loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,onLoadProgress);loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,onLoadIOError);loader.load(request,context);}private function onLoadProgress(evt:ProgressEvent):void{this.dispatchEvent(evt);}private function onLoadComplete(evt:Event):void{evt.currentTarget.removeEventListener(Event.COMPLETE,onLoadComplete);evt.currentTarget.removeEventListener(IOErrorEvent.IO_ERROR,onLoadIOError);evt.currentTarget.removeEventListener(IOErrorEvent.IO_ERROR,onLoadIOError);content(evt.currentTarget as LoaderInfo).content;loadCompletetrue;this.dispatchEvent(new Event(Event.COMPLETE));}private function onLoadIOError(evt:IOErrorEvent):void{evt.currentTarget.removeEventListener(Event.COMPLETE,onLoadComplete);evt.currentTarget.removeEventListener(IOErrorEvent.IO_ERROR,onLoadIOError);evt.currentTarget.removeEventListener(IOErrorEvent.IO_ERROR,onLoadIOError);this.dispatchEvent(evt);}/*** 获取当前ApplicationDomain内的类定义** name类名称必须包含完整的命名空间,如 Grave.Function.SWFLoader* info加载swf的LoadInfo不指定则从当前域获取* return获取的类定义如果不存在返回null*/public function GetClass(name:String):Class{if(loadCompleteloader!null){if(loader.contentLoaderInfo.applicationDomain.hasDefinition(name)){return loader.contentLoaderInfo.applicationDomain.getDefinition(name) as Class;}else{return null;}}return null;}public function GetContent():DisplayObject{return content;}public function GetLoader():Loader{return loader;}} }转载于:https://www.cnblogs.com/zhepama/p/3467153.html
http://www.pierceye.com/news/374063/

相关文章:

  • 网站开发用什么图片格式最好网站数据库搬家
  • 宜宾建设网站企业所得税税负率
  • 广州网站二级等保上海企业网站模板
  • 做任务赚话费的网站网站直播间 是怎么做的
  • 合肥住房城乡建设部的网站传媒公司是干嘛的
  • 网站建设公司盈利深圳保障性住房在哪里申请
  • 网站建设(信科网络)谷歌推广怎么开户
  • 活动策划网站有哪些温州网页设计美工
  • 网站描述代码怎么写做正规小说网站
  • 无锡外贸网站制作公司php网站开发薪资 深圳
  • 做卡盟网站赚钱吗为企业制定网络营销方案
  • lol视频网站模板网站定制案例
  • 海兴县网站建设郑州嵌入式培训机构
  • 网站建设怎么记账韩国 电商网站
  • 公司介绍网站怎么做的网站建设的广告语
  • 茂名网站建设托管阿里云 wordpress主机名
  • 投票活动网站怎么做郑州营销型网站制作教程
  • 如何做一个导航网站凡科建设网站怎么保存
  • 哪个网站能叫我做直播回放广州十大猎头公司排名
  • 四川网站建设那家好百度爱采购竞价
  • 怎么做提卡密网站万游wordpress 验证
  • 威宁住房和城乡建设局网站网站介绍怎么写
  • 百度站长平台快速收录wordpress hook机制
  • 衡水提供网站设计公司哪家专业网站维护简单吗
  • 域名购买后 怎么创建网站网站内部优化是什么
  • 做微信公众号第三网站整站外包优化公司
  • 济南协会网站设计团队网站后台建设编辑器
  • 行业查询网站拖式网站建设
  • 网站设计文献网站开发与维护岗位说明书
  • 公司制作网站东莞南城房价