摘要: 这个必须得顶.................##################################1.前几天,我才知道有一种简化的数据交换格式,叫做yaml。我翻了一遍它的文档,看懂的地方不多,但是有一句话令我茅塞顿开。它说,从结构上看,所有的数据(data)最终都可以分解成三种类型:第一种类型是标量(scalar),也就是一个单独的字符串(string)或数字(numbers),比如 "北京" 这个单独的词。第二种类型是序列(sequence),也就是若干个相关的数据按照一定顺序并列在一起,又叫做数组(array)或列表(List),比如 "北京 阅读全文
posted @ 2012-10-17 14:35 playerlife 阅读(1822) 评论(1) 推荐(0) 编辑
摘要: 抽空写的一个验证JS在浏览器之间的奔跑速度测试: FF和chrome遥遥领先啊..... < !DOCTYPE html > < html > < head > < meta charset = "utf-8" / > < title > js运行效率测试 < / title > < / head > < body style = "overflow:hidden;" > < script > var s = function (m) { retu 阅读全文
posted @ 2012-10-17 14:33 playerlife 阅读(726) 评论(0) 推荐(0) 编辑
摘要: 一、什么是匿名函数?在Javascript定义一个函数一般有如下三种方式:函数关键字(function )语句:function fnMethodName(x) { alert(x);} 函数字面量(Function Literals):var fnMethodName = function (x) { alert(x);} Function()构造函数:var fnMethodName = new Function('x', 'alert(x);') 上面三种方法定义了同一个方法函数fnMethodName,第1种就是最常用的方法,后两种都是把一个函数复... 阅读全文
posted @ 2012-10-17 14:29 playerlife 阅读(23007) 评论(0) 推荐(3) 编辑
摘要: 我们在编写较为复杂的JS应用的时候.会使用到N多个方法,,,这种情况下就有可能出现方法冲突..而javascript木有原生的命名空间支持....所以只能模拟一下了: < !DOCTYPE html > < html > < head > < meta charset = "utf-8" / > < title > js namespace< / title > < / head > < body > < script type = "text/javascrip 阅读全文
posted @ 2012-10-17 14:23 playerlife 阅读(287) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html><html><head> <meta charset="utf-8" /> <title>css绝对定位垂直水平居中box</title></head> <body> <div style="width:100%; height:100%; background-color:#CCC; "> <div style="width:100px; height:100px; position:absolute 阅读全文
posted @ 2012-10-17 11:59 playerlife 阅读(580) 评论(0) 推荐(0) 编辑
摘要: 以前一直用sprite套sprite实现滚动......今天发一个清爽一点的....package { import flash.display.Sprite; import flash.geom.Rectangle; import flash.events.MouseEvent; import flash.events.Event; public class SampleScrollRect extends Sprite { private var circle : Sprite; private var slider... 阅读全文
posted @ 2012-10-17 11:51 playerlife 阅读(3894) 评论(0) 推荐(0) 编辑
摘要: package { import flash.display.Sprite; import flash.ui.Mouse; import flash.events.MouseEvent; import flash.events.Event; import flash.display.Shape; public class FollowMouse extends Sprite { private var _icon : Shape; //鼠标样式 private var box : Sprite; /... 阅读全文
posted @ 2012-10-17 11:40 playerlife 阅读(446) 评论(0) 推荐(0) 编辑
摘要: package { import flash.display.Sprite; import flash.display.Bitmap; import flash.display.Graphics; /*示例内容自适应盒子的大小*/ [SWF(width=800, height=600)] public class SampleAdjustSize extends Sprite { private var borderWid:uint=600;//边框宽 private var borderHei:uint=400;... 阅读全文
posted @ 2012-10-17 11:36 playerlife 阅读(1540) 评论(0) 推荐(0) 编辑
摘要: package com.playerlife.www{ import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; import flash.text.TextField; public class Game extends Sprite { /** * * @param event *状态循环........................ */ ... 阅读全文
posted @ 2012-10-17 11:33 playerlife 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 在写一个游戏时...要用到这样的排序....贴出来,,大家一起分享下............package{ import flash.display.Sprite; /** * * @author playerlife * */ public class TestRandomArray extends Sprite{ public function TestRandomArray() { var arr : Array = ["a", "b", "c", "d", "e", "f&q 阅读全文
posted @ 2012-10-17 11:28 playerlife 阅读(998) 评论(0) 推荐(0) 编辑
摘要: //=================Client.as ==============package callback{ import flash.display.Sprite; public class Client extends Sprite{ public function Client() { //调用Seriver类的callFun方法,并把clientFun方法传给callFun方法 var server : Server = new Server(); server.callFu... 阅读全文
posted @ 2012-10-17 11:24 playerlife 阅读(913) 评论(0) 推荐(0) 编辑
摘要: //===============================flash IDE中============================//1.打开ide, 先择-- > 文本工具框2.在属性面板-- > 样式-- > 嵌入3.选择字体名称(任意)-- > 在下方的-- > 字符范围-- > 先择你要使用的字符4.在代码中将TextFiled实例的embedFonts 属性设为true即可;//===============================flash builder中============================//packa 阅读全文
posted @ 2012-10-17 11:18 playerlife 阅读(663) 评论(0) 推荐(0) 编辑
摘要: package { import flash.display.MovieClip; import flash.display.Loader; import flash.net.URLRequest; import flash.events.Event; import flash.display.DisplayObject; import flash.system.ApplicationDomain; import flash.utils.getDefinitionByName; /* * * 用反射在运行时拿到加载进来的swf的C... 阅读全文
posted @ 2012-10-17 11:16 playerlife 阅读(218) 评论(0) 推荐(0) 编辑