[原]WordPress 评论表情插件 silver smilies v0.2 发布(38 位领导批示)

终于有时间更新表情插件了(查看 silver smilies v0.1)

修改了部分方法. 表情直接从目录中读取.所以现在可以方便的增减表情图片了.只需把图片放入face目录即可.不过暂时还不支持中文图片名称.

其它的都很简单.自己看吧^_^

Download

效果预览:

silver_smilies_0_2

AS3学习之路(4) 绘图板示例(0 位领导批示)

很简单的小例子..主要需要掌握的是绘制图形的 drawRect, lineStyle, moveTo, lineTo等方法..鼠标事件侦听的重要性就不再复述.

p.s. cookbook的确是很好的入门书籍.全是实例.^_^

?View Code ACTIONSCRIPT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package
{
	import flash.display.Sprite;
	import flash.events.MouseEvent;
 
	public class ClassGraphics extends Sprite
	{
		private var mySprite:Sprite;
 
		// 构造函数
		public function ClassGraphics()
		{
			this.mySprite = new Sprite();
			addChild(this.mySprite);
			this.mySprite.graphics.beginFill(0x336699);
			this.mySprite.graphics.drawRect(0, 0, 550, 400);
			this.mySprite.graphics.endFill();
			this.mySprite.addEventListener(MouseEvent.MOUSE_DOWN, spriteMouseDown);
			this.mySprite.addEventListener(MouseEvent.MOUSE_UP, spriteMouseUp);
		}
 
		// 鼠标按下事件
		private function spriteMouseDown(event:MouseEvent):void
		{
			this.mySprite.graphics.lineStyle(1, 0, 1);
			this.mySprite.graphics.moveTo(mouseX, mouseY);
			this.mySprite.addEventListener(MouseEvent.MOUSE_MOVE, spriteMouseMove);
		}
 
		// 鼠标离开事件
		private function spriteMouseUp(event:MouseEvent):void
		{
			this.mySprite.removeEventListener(MouseEvent.MOUSE_MOVE, spriteMouseMove);
		}
 
		// 移动事件
		private function  spriteMouseMove(event:MouseEvent):void
		{
			this.mySprite.graphics.lineTo(mouseX, mouseY);
		}
	}
}

源文件下载

Tags : , ,

AS3学习之路(3) 使用组件(0 位领导批示)

打算写一个AS3+PHP+MySQL的留言本.(当初学习PHP第一个练习也是留言本-_,-+), 完成部分..使用了Flash CS3 的内置组件: TextInput, TextArea, Label 及 Button

?View Code ACTIONSCRIPT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package com
{
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import flash.display.StageScaleMode;
	import flash.display.StageAlign;
	import fl.controls.Label;
	import fl.controls.TextInput;
	import fl.controls.TextArea;
	import fl.controls.Button;
 
	public class ClassMain extends Sprite
	{
		private var userName:TextInput;
		private var userNameLabel:Label;
		private var message:TextArea;
		private var messageLabel:Label;
		private var button:Button;
 
		// 构造函数
		public function ClassMain()
		{
			stage.scaleMode = "noScale";
			stage.align = StageAlign.TOP_LEFT;
 
			this.initMc();
		}
 
		// 一点准备工作
		private function initMc():void
		{
			this.userName = new TextInput();
			addInput(this.userName, "userName", 50, 10, 200, 18);
 
			this.userNameLabel = new Label();
			addLabel(this.userNameLabel, "呢称:", 10, 10, 40, 18);
 
			this.message = new TextArea();
			addTextArea(this.message, "message", 50, 40, 400, 100);
 
			this.messageLabel = new Label();
			addLabel(this.messageLabel, "留言:", 10, 40, 40, 18);
 
			this.button = new Button();
			addButton(this.button, "提交", 350, 150);
		}
 
		// 创建Label
		private function addLabel(label:Label, text:String, x:uint, y:uint, width:uint, height:uint):void
		{
			label.text = text;
			label.move(x, y);
			label.setSize(width, height);
			addChild(label);
		}
 
		// 创建文本框
		private function addInput(input:TextInput, name:String, x:uint, y:uint, width:uint, height:uint):void
		{
			input.name = name;
			input.move(x, y);
			input.setSize(width, height);
			addChild(input);
		}
 
		// 创建文本域
		private function addTextArea(textArea:TextArea, name:String, x:uint, y:uint, width:uint, height:uint):void
		{
			textArea.name = name;
			textArea.move(x, y);
			textArea.setSize(width, height);
			textArea.condenseWhite = true; 
			addChild(textArea);
		}
 
		// 创建按钮
		private function addButton(button:Button, value:String, x:uint, y:uint):void
		{
			button.label= value;
			button.move(x, y);
			addChild(button);
		}
	}
 
}

未完成之前..源码还是不放出了..

Tags : , ,

AS3学习之路(2) 读取XML(1 位领导批示)

AS3对XML的操作实在是太方便了(E4X ECMAScript for XML 没错.就是ECMAScript 如果JS比较好的同学对这个也很熟悉吧)..

AS2时读取XML需要用到 firstchild 等奇怪的东东.. 看来没学过AS2也是很有好处的..活活..

?View Code ACTIONSCRIPT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package
{
	import flash.display.*;
	import flash.text.*;
	import flash.xml.*;
	import flash.net.*;
	import flash.events.Event;
 
	public class ClassSubFeed extends Sprite
	{
		var temp:TextField;	
		var myXmlUrl:URLRequest;
		var myLoader:URLLoader;
		var xmlUrl:String;
		var xmlContent:XML;
 
		public function ClassSubFeed()
		{
			temp = new TextField();
			temp.x = 10;
			temp.y = 10;
			temp.width = 530;
			temp.height = 350;
			temp.border = true;
			temp.borderColor = 0x669900;
			temp.multiline = true;
			temp.htmlText = 'loading.....';
			addChild(temp);
 
			// xml地址
			xmlUrl = "http://www.zdyi.com/feed";
			this.loadXml(xmlUrl);
		}
 
		private function loadXml(xmlUrl:String):void
		{
			myXmlUrl = new URLRequest(xmlUrl);
			myLoader = new URLLoader(myXmlUrl);
			myLoader.addEventListener(Event.COMPLETE, onloaded);
		}
 
		private function onloaded(event):void
		{
			xmlContent = XML(myLoader.data);
			temp.htmlText = '已经读取feed,正在准备.....';
			this.parseData(xmlContent);
		}
 
		private function parseData(xmlContent:XML):void
		{
			var rrsTitle:String = xmlContent.channel.title;
			var rrsLink:String = xmlContent.channel.link;
			temp.htmlText = "<h3><a href='" + rrsLink + "' target='_blank'>" + rrsTitle + "</a></h3><br /><br />";
 
			for each(var item:XML in xmlContent..item)
			{
				var itemTitle:String = item.title.toString();
				var itemLink:String = item.link.toString();
				temp.htmlText += "<div><h4><a href='" + itemLink + "' target='_blank'>" + itemTitle + "</a></h4></div><br /><br />";
			}
		}
	}
}

源文件下载

Tags : , ,

AS3学习之路(1) 一个简单的实例, 打字效果(0 位领导批示)

最近开始学习AS. 在日志上胡乱记录几个实例..以备回顾..

?View Code ACTIONSCRIPT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package
{
	import flash.display.MovieClip;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.text.TextFieldAutoSize;
	import flash.events.*;
	import flash.utils.Timer;
 
	public class ClassTyped extends MovieClip
	{
		var txt:TextField = new TextField();
		var txtF:TextFormat = new TextFormat();
		var cont:String = new String();
		var i:uint = 0;
 
		// 构造函数
		public function ClassTyped()
		{
			cont = "打字效果测试. By Silver...........";
			txtF.font = "微软雅黑";
			txtF.size = 14;
			txtF.color = 0x669900;
			txt.defaultTextFormat = txtF;
 
			var timer:Timer = new Timer(120, cont.length);
			timer.addEventListener(TimerEvent.TIMER, timerHandler);
			timer.start();
		}
 
		private function timerHandler(event):void
		{
			txt.selectable = false;
			txt.appendText(cont.charAt(i));
			txt.autoSize = TextFieldAutoSize.LEFT;
			txt.wordWrap = true;
			txt.width = 200;
			addChild(txt);
			txt.x = (txt.stage.stageWidth - txt.width) / 2;
			txt.y = (txt.stage.stageHeight - txt.height) / 2;
			i++;
		}
	}
}

源文件下载

[转]PHP 5.3中的命名空间使用方法浅述(1 位领导批示)

PHP 5.3 的一个新的重要特性就是 命名空间(namespace)。
这一特性在 PHP5.0x 时候就提出过,后来被取消并安排在 PHP6 中实现。而此次又再次“提前”到了 PHP 5.3 发布,可见开发人员对其的重视以及谨慎的态度。

官方发布时说明文档的内容可能已过期(documentation maybe out dated),所以在这里简单的说明命名空间的用法:首先是声明一个命名空间,加入了新的关键字 namespace ,其应在类文件的开头

全文阅读 »

[备忘]Windows 定时关机(3 位领导批示)

点击 开始 -> 运行

输入 at 00:00 Shutdown -s 这样电脑就会在0点时自动关机

默认有30秒钟的倒计时并提示保存工作

如果想以倒计时的方式关机 则输入Shutdown.exe -s -t 600 表示 600秒后自动关机

[原]WordPress 友情链接插件 ubb sustain blogroll v0.1 发布(0 位领导批示)

要问我这个插件有什么用? 它唯一的能做的就是让你的友情链接能支持UBB代码. –____-!!

BT的需求下产生的BT插件..现放出 V0.1

效果预览:

xxxxxxxxxxxx

下载地址:

www.zdyi.com/wp-content/uploads/2009/06/ubb-sustain-blogroll.rar

php strtotime函数参数详解[备忘](3 位领导批示)

1.月,日英文名及其常用缩写清单:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
january
february
march
april
may
june
july
august
september
sept
october
november
december
sunday
monday
tuesday
tues
wednesday
wednes
thursday
thur
thurs
friday
saturday

全文阅读 »

6月27日组团观<变形金刚II> 合影(3 位领导批示)

三里屯美嘉欢乐影城外…

DSC_7736_jpg_thumb

随机显示的10篇日志

评论最多的10篇日志

浏览最多的10篇日志