robotlegs

Filed Under (AS3) by CouldHll on 16-04-2012

Tagged Under : , ,

http://www.robotlegs.org/

Robotlegs is a pure AS3 micro-architecture (framework) with a light footprint and limited scope. Simply put, Robotlegs is there to help you wire your objects together. It provides the glue that your application needs to easily function in a decoupled way. Through the use of automated metadata based dependency injection Robotlegs removes boilerplate code in an application. By promoting loose coupling and avoiding the use of Singletons and statics in the framework Robotlegs can help you write code that is highlytestable.

运用依赖注入在MVC框架下,实现了依赖自动化,确实很方便。

字体损坏导致系统里无法使用

Filed Under (AS3) by CouldHll on 06-02-2012

Tagged Under :

问题描述:昨天加班帮做Castrol研发体验中心工业屏,在Mac下导入字体,在Flash中怎么找怎么没有。

问题分析:又导入了几遍,重启也没有用。

问题解决:咨询Cailven,让PS里看看,字体也没有。最后重新下了字体文件,马上就好了。。。感谢Cailven

IN2AR

Filed Under (AS3, Augmented Reality) by CouldHll on 19-12-2011

Tagged Under : , ,

IN2AR is an Adobe Flash AS3 Library that allows you to detect images and estimate their pose using standard webcams/cameras. The pose information can be used to place 3D objects and/or videos onto the image and create wonderfull Augmented Reality applications, or to createunique games that can be controlled by movements of your image.

http://www.in2ar.com/

AIR在Mac和PC平台下隐藏文件问题

Filed Under (AS3) by CouldHll on 04-12-2011

Tagged Under : ,

问题描述:今天加班帮惠氏Wyeth启斌illuma抽奖AIR。在Mac下开发完去PC上测试,发现Mac上一切正常,而PC上程序无法顺利运行。

问题分析:把源代码转到PC运行,一步一步排查。发现PC上会加载隐藏文件,而Mac上不会加载隐藏文件。正是这些隐藏文件的加载导致不正常。

问题解决
添加如下代码:

if(!file.isHidden)

一切OK了。

总结:Mac系统会忽略隐藏文件,与PC上会遍历所有文件不同。这也许是AIR的bug。

AIR在Mac和PC平台下路径问题

Filed Under (AS3) by CouldHll on 22-07-2011

Tagged Under : ,

问题描述:前些日子Vision部在给Timberland做年会用的年度报表应用软件。因为需要用在Mac和PC平台,所以使用AIR平台开发。因为一直在PC中开发,所以PC一切正常,但是到了Mac中就回报错。

问题分析:那天正好是Adobe Suite CS5.5发布会,回来后加了个通宵,帮Cailven解决这个bug。因为报错是报的类库中,一直在类库中找寻解决办法。搞了一个晚上,突然发现AIR返回的path不一样。

问题解决
把如下代码:
var path : String = file.nativePath;
改写为:
var path : String = file.url;
一切OK了。

总结:file.nativePat对于Mac是不适用的,请使用file.url代替。这也许是AIR的bug。

Excel Library

Filed Under (AS3) by CouldHll on 07-07-2011

Tagged Under : ,

最近公司里在做Timberland的一个内部使用的数据分析软件,AIR的,需要读excel,找了点读xlsx的类库,最后选择Rxlsx。一个是比较新,一个是支持office2007格式。

老外写的类库:http://code.google.com/p/as3xls/

国人写的类库:http://code.google.com/p/rxlsx/

 

PV3D中removeChild内存泄露问题

Filed Under (AS3) by CouldHll on 28-01-2011

Tagged Under : , ,

问题描述
今天cailven用pv3d做Parkroyal Mt demo的时候一直很卡,经过他反复测试,发现是因为里面反复使用了pv3d内建的removeChild()方法。一开始认为是贴图无法被清空造成的,后来他改成了线框贴图,依然很卡。
问题分析
他的代码是这样的。
var agency:DisplayObject3D=new DisplayObject3D();
agency.removeChild(beforetarget);
scene.addChild(beforetarget);
scene.removeChild(nowtarget);
agency.addChild(nowtarget);
beforetarget=nowtarget;
他一开始以为是贴图信息无法清楚造成的,后来把材质改成了线框去跑,依然卡的不行,一打开时候有27fps,这段代码运行个20多遍在线框的情况下依然变成了5fps。
但是我的项目要求又必须得大量使用加载入容器,然后移除到场景的方法。
现在确定就是这段代码惹得祸,只要不removeChild,不addChild,程序可以一直维持27fps,一用就开始越来越卡。
问题解决
因为pv3d的内建removeChild有bug不完善,所以他跳过了这个步骤,直接使用了代码:
var agency:DisplayObject3D=new DisplayObject3D();
agency=nowtarget;
直接用agncy指过去,运行下来确实不卡了。
(感谢Cailven提供)

Flash全屏输入文本框不能输入问题

Filed Under (AS3) by CouldHll on 23-12-2010

Tagged Under : ,

问题描述:最近做AMG多触点程序,遇到flash全屏后文本框不能输入问题。flash10,用swf全屏后可以输入;用exe全屏后不能输入。air2,用exe全屏可以输入。

问题解决:Google了下:

在全屏模式下,用户无法在文本输入字段中输入文本。所有键盘输入和键盘相关的 ActionScript 在全屏模式下均会被禁用,但将应用程序返回标准模式的键盘快捷键(例如按 Esc)除外。

http://livedocs.adobe.com/flash/9.0_cn/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000352.html

Papervision3D旋转和矩阵

Filed Under (AS3) by CouldHll on 26-11-2010

Tagged Under : ,

问题描述:今天用FLARManager做AR,发现PV3D里修改矩阵后rotation不更新。

问题解决:在网上找到Kevin Cao的解决办法:调用yaw(0)一下,使其更新解决。

参考网址:
http://kevincao.com/2008/11/papervision3d-rotation-tip/

Papervision3D坐标转换

Filed Under (AS3) by CouldHll on 26-11-2010

Tagged Under : ,

3D转2D
do3d.calculateScreenCoords(camera3D);
var real2DX:Number = do3d.screen.x + viewport3D.width/2;
var real2DY:Number = do3d.screen.y + viewport3D.height/2;

2D转3D
var ray:Number3D = camera.unproject(viewport.containerSprite.mouseX, viewport.containerSprite.mouseY);
ray = Number3D.add(ray, camera.position);