摘要: package com.light.algorithm { /** * 排序算法合集· * @author light */ public class Sort { private static var len:uint = 0; /** * 冒泡排序 Bubble Sort * 原理: * 比较n轮,每一轮都把最大元素移动到数组后端。 * @return */ public static functi... 阅读全文
posted @ 2013-08-27 17:31 ndljava 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 直接上代码:package cn.ndl.ui { import flash.display.GradientType; import flash.display.Shape; import flash.display.SpreadMethod; import flash.display.Sprite; import flash.geom.Matrix; import flash.text.TextField; public class EcoRect extends Sprite { private var ttf:TextField;... 阅读全文
posted @ 2013-08-27 10:25 ndljava 阅读(561) 评论(0) 推荐(0) 编辑
摘要: as3种常见的弹性效果公式以及波形运动等as3动画效果公式代码整理,对于常用的来说作者整理的很全面,包括AS3的进制转换颜色提取等效果:AS3缓动公式:sprite.x += (targetX – sprite.x) * easing;//easing为缓动系数变量sprite.y += (targetY – sprite.y) * easing;AS3弹性公式:vx += (targetX – sprite.x) * spring;//spring为弹性系数vy += (targetY – sprite.y) * spring;sprite.x += (vx *= friction);//f 阅读全文
posted @ 2013-08-06 19:38 ndljava 阅读(928) 评论(0) 推荐(0) 编辑
摘要: 八进制和十六进制?编程中,我们常用的还是10进制……必竟C/C++是高级语言。比如:int a = 100,b = 99;不过,由于数据在计算机中的表示,最终以二进制的形式存在,所以有时候使用二进制,可以更直观地解决问题。但,二进制数太长了。比如int 类型占用4个字节,32位。比如100,用int类型的二进制数表达将是:0000 0000 0000 0000 0110 0100面对这么长的数进行思考或操作,没有人会喜欢。因此,C,C++ 没有提供在代码直接写二进制数的方法。 用16进制或8进制可以解决这个问题。因为,进制越大,数的表达长度也就越短。不过,为什么偏偏是16或8进制,而不其它的, 阅读全文
posted @ 2013-08-06 19:33 ndljava 阅读(886) 评论(0) 推荐(0) 编辑
摘要: /* Copyright (c) 2008, Adobe Systems Incorporated All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, th... 阅读全文
posted @ 2013-05-27 17:28 ndljava 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 原来mask 添加到舞台和不添加是一样的效果,但是有时候就必须添加才能显示, 你妹的adobe 阅读全文
posted @ 2013-04-08 14:44 ndljava 阅读(333) 评论(0) 推荐(0) 编辑
摘要: package { import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Matrix; import flash.geom.Point; import flash.geom.Rectangle; public class Bitmap9 extends Bitmap { private var rect:Rectangle; private var _w:Number=0; private var _h:... 阅读全文
posted @ 2012-12-07 20:05 ndljava 阅读(341) 评论(0) 推荐(0) 编辑
摘要: as3中 scrollRect 会固定其宽高,必须临时记录 阅读全文
posted @ 2012-11-30 15:25 ndljava 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 这是基类:package cn.ndl.test { import flash.display.Bitmap; import flash.display.Sprite; import flash.display.TriangleCulling; import flash.geom.Matrix3D; import flash.geom.Point; import flash.geom.Vector3D; public class SphereBasic extends Sprite { [Embed(source="http://www.... 阅读全文
posted @ 2012-07-10 16:10 ndljava 阅读(2515) 评论(0) 推荐(0) 编辑
摘要: package com.ddd{ import flash.display.Bitmap; import flash.display.Sprite; import flash.display.StageScaleMode; import flash.events.Event; import flash.geom.Matrix3D; import flash.geom.Vector3D; public class Triangles extends Sprite { private var points:Vector.<Points3... 阅读全文
posted @ 2012-04-27 19:36 ndljava 阅读(641) 评论(0) 推荐(0) 编辑