摘要:写在这里,方便查阅NativeApplication.nativeApplication.autoExit = true;// 主窗体关闭也跟着关闭Debug.trace('ToursLocalConnection :: appExePath = ' + appExePath);currFile =...
阅读全文
摘要:Flash Player的安全管控通过权限管控和安全沙箱实现。在纵向上Flash Player使用权限机制管理SWF运行的安全性。在横向上,Flash Player使用安全沙箱机制管理SWF运行的安全性。 权限管控是指系统管理员、Flash Player用户、网站管理员以及Flash应用开发人员对于SWF可以执行的权限的控制。权限管控模型如下权限控管按照从上至下的约束方式进行,越往下权限越低。1.位于顶层的是系统管理员管控。系统管理员通过设置mms.cfg跟设置全局信任目录来控制Flash Player的控制权限。1.1 mms.cfg配置文件win7下载位于C:\Windows\Sys...
阅读全文
摘要:Sprite居然没有removeAllChildren(),removeAllListeners()这样的方法,这让多少程序内存泄露。后来的starling明显人性化了removeChildren(beginIndex:int = 0, endIndex:int = -1, dispose:Boolean = false):voidRemoves a range of children from the container (endIndex included).removeEventListeners(type:String = null):voidRemoves all event lis
阅读全文
摘要:之前做项目的时候,需要同时拖拽两个以上的Sprite对象。相当郁闷的是拖拽第二个sprite,或者调用任何一个sprite的stopDrag方法,第一个sprite就失效了。作为Sprite对象的方法,这显然不合适,adobe官方API也没有说明。后来自己写了个DragManager,代码如下 1 package com.cong.managers 2 { 3 import flash.display.Stage; 4 import flash.display.DisplayObjectContainer; 5 import flash.utils.Dicti...
阅读全文
摘要:1.Matirx 位移,缩放,平行扭区 1 var matrix:Matrix = new Matrix(); 2 //x方向平移100,y方向平移200 3 matrix.translate(100, 200); 4 //matrix.tx = 100; 5 //matrix.ty = 200; 6 //x方向缩放0.5,y方向缩放0.5 7 matrix.scale(0.5, 0.5); 8 //matrix.a = 0.5; 9 //matrix.d = 0.5;10 //顺时针方向旋转45度11 matrix.rotate(Math.PI/4);12 //ma...
阅读全文
摘要:1.给sprite设置背景色给sprite设置背景色,spr.opaqueBackground = 0xFFCC33,在尺寸变化的时候自动重绘背景。需要注意的是背景不能接受鼠标事件,接受鼠标事件的话,需要用graphics绘制背景。2.在ByteArray里writeUTF("中方汉字"),输出长度为12,一个汉字占了3字节。writeMultiByte("中方汉字","gb2312"),输出长度为8,一个汉字占2字节。writeMultiByte("中方汉字","utf-8"),输出长度为12
阅读全文
摘要:import flash.events.MouseEvent;a.b.addEventListener(MouseEvent.CLICK,bclickHandler);function bclickHandler(e:MouseEvent):void{ trace("bclick"); a.addEventListener(MouseEvent.CLICK,aclickHandler);}function aclickHandler(e:MouseEvent):void{ trace("aclick");} 第一次点击B方块,会发现输出 bclick a
阅读全文
摘要:b2ContactListerner.BeginContact(contact:b2Contact)中:contact.getManifold().m_localPlaneNormal.x和contact.getManifold().m_localPlaneNormal.y两个属性标识接触面的法线向量trace(contact.GetManifold().m_localPlaneNormal.x , contact.GetManifold().m_localPlaneNormal.y ); trace(Math.atan2(contact.GetManifold().m_localPla...
阅读全文
摘要:import flash.net.FileReference;import flash.events.Event;load();function load():void{ var file:FileReference = new FileReference(); file.browse(); file.addEventListener(Event.SELECT,onSelect); file.addEventListener(Event.COMPLETE,onComplete);}function onSelect(e:Event):void{ var target:FileReference
阅读全文