导入Flashpaper并增加Loading进度条

发布于:
Script

高手自动飘过。。。根据FlashPaper Documentation 中的 Loading FlashPaper 2.0 documents into Flash 章节编写,代码有点乱。。反正功能很简单,懒得整理了。。AS我也是个半吊子,参考文档是2.0写的。。我就改吧改吧。整出来能用就行了。。

Flashpaper影片实例:fp_mc

Loading文本:loadingtext

Loading文本:loadingmc

//import Oval.as  
Stage.scaleMode = "noScale";  
Stage.align = "TL";  
 
var resizeListener = new Object();  
 
var resize_fp = function() {  
    var fp = fp_mc.getIFlashPaper();  
    fp.setSize(Stage.width,Stage.height);  
    setloadingsize();  
}   
resizeListener.onResize = resize_fp;  
 
Stage.addListener(resizeListener);   
//-------------  
 
var setloadingsize = function(){  
loadingmc._y = Stage.height/2;  
loadingmc._x = Stage.width*0.1;  
loadingmc._width = Stage.width*0.8;  
loadingtext._x = Stage.width*0.5;  
loadingtext._y = Stage.height/2-18;  
}  
setloadingsize();  
//------------------------  
 
onEnterFrame = function ()   
{  
    var Total = fp_mc.getBytesTotal();  
    if(Total>lt;0)  
    {  
        loadingtext._x = Stage.width*0.5-50;  
        loadingtext.text="文件载入错误..";  
        loadingmc.gotoAndPlay(100);  
        onEnterFrame = null;  
        return;  
    }  
    else if(Total>lt;=12){return;}  
      
    var Loaded = fp_mc.getBytesLoaded();  
      
    trace(Math.round(Loaded*100/Total));  
    loadingmc.gotoAndStop(Math.round(Loaded*100/Total));  
    loadingtext.text=Math.round(Loaded*100/Total)+"%";  
    if ( Loaded == Total) {   
        onEnterFrame = null;  
        loadingtext.text="";  
        loadingmc.gotoAndPlay(100);  
    }  
}  
dest_mc._visible = false;  
fp_mc._x=0;  
fp_mc._y=0;  
//var myOval:Oval = Oval(attachMovie("Oval","Oval_1",1));  
//var xx:MovieClip = MovieClip()  
 
//--------------------------  
var url:String = _root._url;  
var query:String = url.substring(url.indexOf("?")+1);  
var arr:Array = query.split(">amp;")  
var fp_url:String = "content.swf";  
for(var i=0;i>lt;=arr.length-1;i++){  
     //trace( arr[i].split("=")[0] + "的值是:" + arr[i].split("=")[1] );  
     if(arr[i].split("=")[0]=="file")  
     {  
        fp_url = arr[i].split("=")[1] +".swf";  
     }  
}  
 
trace(fp_url);  
loadFlashPaper(fp_url,   
    fp_mc,   
    fp_mc._width,   
    fp_mc._height,   
    null);  
function loadFlashPaper(  
   path_s,   // path of SWF to load  
   dest_mc,  // MC which we should replace with the SWF  
   width_i,  // new size of the dest MC  
   height_i, // new size of the dest MC  
   loaded_o) // optional: object to be notified that loading is complete  
{  
   var intervalID = 0;  
   var loadFunc = function()  
   {  
      dest_mc._visible = false;  
      var fp = dest_mc.getIFlashPaper();  
      if (!fp)  
         return;  
      if (fp.setSize(Stage.width,Stage.height) == false)  
         return;  
      dest_mc._visible = true;  
      dest_mc.toolbar_mc.brandClip_mc.swapDepths(1000);  
      dest_mc.toolbar_mc.brandClip_mc.removeMovieClip();  
      clearInterval(intervalID);  
      loaded_o.onLoaded(fp);  
        
   }  
   intervalID = setInterval(loadFunc, 100);  
   dest_mc.loadMovie(path_s);  
 
 
  nbsp;///trace("kk");  
} 

仍有几个问题没有解决:

1.加载时flash自动缩放,想在flash尺寸大于flashpaper时绽放100%

Free,Open source Mail Server – XMail Server Lite

发布于:
服务器技术

免费开源的邮件服务器。


Open source e-mail server for Windows and Linux platforms. Provides fast AJAX webmail and POP3/SMTP services.

  XMail Server Lite是一个开源的email服务器,并提供一个Ajaxed Webmail系统。提供Window&Linux OSs两种不同的安装包。该服务器能够管理SMTP/ESMTP&POP3协议,并拥有一个基于Web的管理控制面板。它能够支持无限个域名/用 户,包括虚拟域名和别名。 XMail Lite还提供防病毒集成,垃圾邮件过滤和一个记录所有活动的日记系统。

XMail Server Lite

AfterLogic Xmail Server 也是基于Xmail Server开发的,只是在界面管理方面使用的是C#开发的。

Red5教程和Red5主机

发布于:
JavaScript服务器技术

Red5是一个相当惊人的服务器软件,Java编写的。Red5开发团队已经在努力使其成为一个开源替代Adobe FMS – Flash Media Server 的媒体服务器。

Red5是一个非常合适的视频点播技术的应用,流媒体,发布,mealtime collaboration,多玩家游戏等等…

Red5是对所有共享主机托管方案。默认情况下,red5服务器包括fitcDemo,oflaDemo,SoSample等一些简单示例应用程序的预安装。

目前流行的CSS+DIV的命名规则

发布于:
Script

下面是目前流行的CSS+DIV的命名规则:
页头:header
登录条:loginBar
标志:logo
侧栏:sideBar
广告:banner
导航:nav
子导航:subNav
菜单:menu
子菜单:subMenu
搜索:search
滚动:scroll
页面主体:main
内容:content
标签页:tab
文章列表:list
提示信息:msg
小技巧:tips
栏目标题:title
友情链接:friendLink
页脚:footer
加入:joinus
指南:guild
服务:service
热点:hot
新闻:news
下载:download
注册:register
状态:status
按钮:btn
投票:vote
合作伙伴:partner
版权:copyRight

Jquery使用小技巧

发布于:
Script
/* 禁止右键点击
view plaincopy to clipboardprint? */
$(document).ready(function(){
		$(document).bind("contextmenu",function(e){return false;});
});

 /*隐藏搜索文本框文字view plaincopy to clipboardprint?*/
$(document).ready(function() {
		$("input.text1").val("Enter your search text here");
		textFill($('input.text1'));
		});


	function textFill(input){ //input focus text function
		var originalvalue = input.val();
		input.focus( function(){
			if( $.trim(input.val()) == originalvalue ){ input.val(''); }
		});
	input.blur( function(){
			if( $.trim(input.val()) == '' ){ input.val(originalvalue); }
		});
});
		 /*在新窗口中打开链接view plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		 //Example 1: Every link will open in a new window   
		    $('a[href^="http://"]').attr("target", "_blank");     
		 //Example 2: Links with the rel="external" attribute will only open in a new window   
		    $('a[@rel$='external']').click(function(){     
		 this.target = "_blank";     
		    });     
		 });     
		 // how to use   
		 <A href="http://www.opensourcehunter.com" rel=external>open link</A>    
		/*检测浏览器  
		    注: 在版本jQuery 1.4中,$.support 替换掉了$.browser 变量。  
		    view plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		 // Target Firefox 2 and above   
		 if ($.browser.mozilla && $.browser.version >= "1.8" ){     
		 // do something   
		 }     
		 // Target Safari   
		 if( $.browser.safari ){     
		 // do something   
		 }     
		 // Target Chrome   
		 if( $.browser.chrome){     
		 // do something   
		 }     
		 // Target Camino   
		 if( $.browser.camino){     
		 // do something   
		 }     
		 // Target Opera   
		 if( $.browser.opera){     
		 // do something   
		 }     
		 // Target IE6 and below   
		 if ($.browser.msie && $.browser.version <= 6 ){     
		 // do something   
		 }     
		 // Target anything above IE6   
		 if ($.browser.msie && $.browser.version > 6){     
		 // do something   
		 }     
		 });   
		/*预加载图片  
		view plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		    jQuery.preloadImages = function()     
		   {     
		 for(var i = 0; i").attr("src", arguments[i]);   
		   }   
		 };   
		 // how to use   
		 $.preloadImages("image1.jpg");     
		 });   
		/*页面样式切换*/ 
		view plaincopy to clipboardprint?  
		 $(document).ready(function() {     
		     $("a.Styleswitcher").click(function() {     
		 //swicth the LINK REL attribute with the value in A REL attribute   
		         $('link[rel=stylesheet]').attr('href' , $(this).attr('rel'));     
		     });     
		 // how to use   
		 // place this in your header   
		 <LINK href="default.css" type=text/css rel=stylesheet>     
		 // the links   
		 <A class=Styleswitcher href="#" rel=default.css>Default Theme</A>     
		 <A class=Styleswitcher href="#" rel=red.css>Red Theme</A>     
		 <A class=Styleswitcher href="#" rel=blue.css>Blue Theme</A>     
		 });    
		/*列高度相同  
		如果使用了两个CSS列,使用此种方式可以是两列的高度相同。  
		view plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		 function equalHeight(group) {     
		     tallest = 0;     
		     group.each(function() {     
		         thisHeight = $(this).height();     
		 if(thisHeight > tallest) {     
		             tallest = thisHeight;     
		         }     
		     });     
		     group.height(tallest);     
		 }     
		 // how to use   
		 $(document).ready(function() {     
		     equalHeight($(".left"));     
		     equalHeight($(".right"));     
		 });     
		 });   
		/*动态控制页面字体大小  
		用户可以改变页面字体大小  
		view plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		 // Reset the font size(back to default)   
		 var originalFontSize = $('html').css('font-size');     
		     $(".resetFont").click(function(){     
		     $('html').css('font-size', originalFontSize);     
		   });     
		 // Increase the font size(bigger font0   
		   $(".increaseFont").click(function(){     
		 var currentFontSize = $('html').css('font-size');     
		 var currentFontSizeNum = parseFloat(currentFontSize, 10);     
		 var newFontSize = currentFontSizeNum*1.2;     
		     $('html').css('font-size', newFontSize);     
		 return false;     
		   });     
		 // Decrease the font size(smaller font)   
		   $(".decreaseFont").click(function(){     
		 var currentFontSize = $('html').css('font-size');     
		 var currentFontSizeNum = parseFloat(currentFontSize, 10);     
		 var newFontSize = currentFontSizeNum*0.8;     
		     $('html').css('font-size', newFontSize);     
		 return false;     
		   });     
		 });   
		/*返回页面顶部功能  
		view plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		 $('a[href*=#]').click(function() {     
		 if (location.pathname.replace(/^//,'') == this.pathname.replace(/^//,'')   
		  && location.hostname == this.hostname) {     
		 var $target = $(this.hash);     
		    $target = $target.length && $target     
		    || $('[name=' + this.hash.slice(1) +']');     
		 if ($target.length) {     
		 var targetOffset = $target.offset().top;     
		   $('html,body')     
		   .animate({scrollTop: targetOffset}, 900);     
		 return false;     
		    }     
		   }     
		   });     
		 // how to use   
		 // place this where you want to scroll to   
		 <A name=top></A>     
		 // the link   
		 <A href="#top">go to top</A>     
		 });   
		/*获得鼠标指针XY值  
		view plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		    $().mousemove(function(e){     
		 //display the x and y axis values inside the div with the id XY   
		     $('#XY').html("X Axis : " + e.pageX + " | Y Axis " + e.pageY);     
		   });     
		 // how to use   
		 <DIV id=XY></DIV>     
		 });    
		/*验证元素是否为空  
		    view plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		 if ($('#id').html()) {     
		 // do something   
		    }     
		 });    
		/*替换元素  
		view plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		    $('#id').replaceWith('   
		 <DIV>I have been replaced</DIV>   
		 ');     
		 });    
		 jQuery延时加载功能view plaincopy to clipboardprint?  
		 $(document).ready(function() {     
		    window.setTimeout(function() {     
		 // do something   
		    }, 1000);     
		 });    
		/*移除单词功能view plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		 var el = $('#id');     
		    el.html(el.html().replace(/word/ig, ""));     
		 });  
		/*  验证元素是否存在于Jquery对象集合中  
		        view plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		 if ($('#id').length) {     
		 // do something   
		   }     
		 });    
		/*使整个div可点击view plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		     $("div").click(function(){     
		 //get the url from href attribute and launch the url   
		       window.location=$(this).find("a").attr("href"); return false;     
		     });     
		 // how to use   
		 <DIV><A href="index.html">home</A></DIV>     
		 });    
		/*ID与Class之间转换当改变Window大小时,在ID与Class之间切换  
		    view plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		 function checkWindowSize() {     
		 if ( $(window).width() > 1200 ) {     
		         $('body').addClass('large');     
		     }     
		 else {     
		         $('body').removeClass('large');     
		     }     
		    }     
		 $(window).resize(checkWindowSize);     
		 });    
		 /*克隆对象view plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		 var cloned = $('#id').clone();     
		 // how to use   
		 <DIV id=id></DIV>     
		 });   
		/*使元素居屏幕中间位置view plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		   jQuery.fn.center = function () {     
		 this.css("position","absolute");     
		 this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");     
		 this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");     
		 return this;     
		   }     
		   $("#id").center();     
		 });    
		/*写自己的选择器view plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		    $.extend($.expr[':'], {     
		        moreThen1000px: function(a) {     
		 return $(a).width() > 1000;     
		       }     
		    });     
		   $('.box:moreThen1000px').click(function() {     
		 // creating a simple js alert box   
		       alert('The element that you have clicked is over 1000 pixels wide');     
		   });     
		 });    
		 /* 统计元素个数view plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		    $("p").size();     
		 });    
		 /* 使用自己的 Bulletsview plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		    $("ul").addClass("Replaced");     
		    $("ul > li").prepend("? ");     
		 // how to use   
		  ul.Replaced { list-style : none; }     
		 });   
		 /* 引用Google主机上的Jquery类库Let Google host the jQuery script for you. This can be done in 2 ways.  
		    view plaincopy to clipboardprint?*/ 
		 //Example 1   
		 <SCRIPT src="http://www.google.com/jsapi"></SCRIPT>     
		 <SCRIPT type=text/javascript>    
		 google.load("jquery", "1.2.6");    
		 google.setOnLoadCallback(function() {    
		 // do something  
		 });    
		 </SCRIPT><SCRIPT src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type=text/javascript></SCRIPT>     
		 // Example 2:(the best and fastest way)   
		 <SCRIPT src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type=text/javascript></SCRIPT>    
		/*禁用Jquery(动画)效果  
		view plaincopy to clipboardprint?*/ 
		 $(document).ready(function() {     
		     jQuery.fx.off = true;     
		 });    
		 与其他Javascript类库冲突解决方案view plaincopy to clipboardprint?  
		 $(document).ready(function() {     
		 var $jq = jQuery.noConflict();     
		    $jq('#id').show();     
		 });   

今天汉化了一个flash相册。

发布于:
Script

 今天汉化了一个flash相册。把过程记录下来。以防忘记

1.更改XML文件为UTF-8编码

2.删除动态文本框里面内嵌的其他语言字体 (AS:texte_txt.embedFonts = "true",改为false或者注释掉)

3.更改文字字体为中文字体

4.this.setMask(mascara);//遮罩,其实非必须

5.好像没有了esotropia。。。

Win Server 2003安装天翼Live最新版(Live1.5.1)

发布于:
服务器技术

  微软开发的天翼Live原本是要求客户端环境为XP SP2或者Vista,但Win 7下也可以选择兼容性检查,然后根据提示安装,使用都是正常的。旧版本也能通过修改兼容运行方式来安装到Win Server 2003,但新版已经不行了。经过下午的研究,终于找到一位牛人的帖子,并根据这个方法,修改成功了。帖子里说的是1.5版,现在最新的是1.5.1,但同样可用,只是不能直接用绝对位置了。

C# interface 接口理解

发布于:
Microsoft.Net

  针对接口编程能帮助达到面向对象开发和设计中"低耦合"的要求.

  举个例子:某公司有一台特殊打印机,还可以使用一年,一年后可能换为另一种打印机,这两种打印机都特殊而贵.所以现在的程序希望换了打印机后也少量修改就可用.

方法:

  1,定义一个打印机接口.

  2,定义打印机类A,B,分别实现此接口.

  3,定义一个工厂类,在类中可选择返回由A实现的接口,或者由B实现的接口.

  4,在程序中使用打印机时,就可以使用工厂类来调用打印机,而不需要知道具体的是什么打印机.如果打印机换了,只需要修改工厂类就行了.如果有一千个地方都调用过打印机,就不需要一个一个修改.修改一个地方就行了.接口充当一个隔离层的作用.

//定义打印机接口
interface Iprint {
	bool PrintData(string data);
 }
 //定义打印机类A,实现接口,(继承)
 class PrintA:Iprint {
	 public virtual bool PrintData(string data){ //具体业务逻辑略 } 
}

//定义打印机类B,实现接口,(继承)
class PrintB:Iprint {
	public virtual bool PrintData(string data){         //具体业务逻辑略     }
}
//定义工厂类
class PrintFactory{
		public Iprint CreatePrint(){ 
		//返回一个由打机类A,或B实现的接口,比如
		return new PrintA();
    } 
}
//通过工厂类,调用打印机
private void button1_Click(object sender,EventArgs e) {
		PrintFactory myFactory=new PrintFactory();
		Iprint myPrint=myFactory.CreatePrint();
		myPrint.PrintData("这样做很方便啊");
} 

抽象类,接口,委托与事件

发布于:
Microsoft.Net

抽象类:

是事物的本质,可以有属性,可以有默认实现.
可以当做共性抽象出来的.
接口:
是事务的行为,不可以有属性,也没有默认实现.
只能是行为的共性抽象出来.
委托:
类似于c中指针的概念,允许程序以方法为作为参数
事件:
是基于委托的,是对象产生的消息.具有多路广播功能.
配合委托完成多种设计模式.
比如一个带报警功能的车门,那么门的大小尺寸,厚度,车门状态是属性,开关是默认行为,开门,关门,报警都是行为.车主和小偷是开门的主体.
那么在设计的时候就应该是

三大电信运营商与银联共商移动支付标准

发布于:
Microsoft.Net

  通信行业网站C114报道,工信部通信发展司政策标准处处长谢雨琦8月27日透露,中国人民银行和三大电信运营商、中国银联等相关单位昨日召开座谈会,讨论移动支付标准问题。

  谢雨琦是在今天上午举行的“2010中国移动支付应用发展大会”上作此番表示的。报道引述她的话称,这表明跨行业、跨部门合作推进移动支付产业的发展,移动支付业务的标准制定工作已经开始。

  目前,国内使用的移动支付方案有四大类。三大电信运营商在移动支付标准的选择上不尽相同。此外,银联也推出基于SD卡的支付解决方案。而谁最终将成为主导国内手机支付的标准仍未有定论。