ITeye博客

ActionScript3/Flex4

共 13 篇文章

Flash应用的本地缓存以及AS3单例模式

package { import flash.net.SharedObject; public class LocalCache { private var cache:SharedObject; private static var _instance:LocalCache; public function LocalCache(singletonEnforcer:SingletonEnforcer) { if(singletonEnforcer==null){ throw new Error("singletonEnforcer"); }else{ cache = SharedObjec…

2011-03-01 14:47 · ActionScript3/Flex4 · Cache · Flash · XP · AIR · Linux

Flash Socket通信的安全策略问题

今天测试flash socket连接java socket,遇到安全策略问题,折腾了半天才弄好。做下关键点记录: flash发起socket通信的过程: 当封装在页面的flash发起socket通信请求的时候会先寻找服务器端的843端口,获取crossdomain.xml文件,当服务器没有开启843的时候,flashPlayer会检查发起请求的swf文件中中有没有使用Security.loadPolicyFile来加载策略文件crossdomain.xml,如果还是没有就会看这个发起请求的swf要连接的目标端口有没有策略文件。如果都没有那么连接失败,返回SecurityErrorEvent …

2011-02-22 16:45 · ActionScript3/Flex4 · Socket · Flash · XML · Security

Flex4中[Bindable]做了什么?

Flex里面[Bindable]相信大家都用过,其实这个是给编译器看的,那编译器到底做了什么呢?今天特地去研究了下: 首先在fb的Flex编译器里面加上编译参数-keep-generated-actionscript=true,然后会生成一个generated目录,里面就是从mxml生成的as文件。 比如你在mxml文件里定义了[Bindable]public var foo:String;则会生成如下的as3代码: [Bindable(event="propertyChange")] private function get foo():String { return this._3712…

2011-02-17 22:49 · ActionScript3/Flex4 · ActionScript · Flex

使用 Flex Ant Tasks 构建 Flex 项目

1. 安装ant,然后复制FLEX_HOME/sdks/4.0.0/ant/lib下面的flexTasks.jar到ANT_HOME/lib 2. build.properties # change this to your Flex SDK directory path FLEX_HOME=D:/Adobe/Adobe Flash Builder 4 Plug-in/sdks/4.0.0 # this points to your project's src directory # {$basedir} is a default variable that can be used in a…

2011-02-11 18:08 · ActionScript3/Flex4 · Flex · Flash · XML · Adobe · Ant

AlertBox With No Buttons! (HACK)

Browsing around EE today, I found an interesting question. This person wanted an AlertBox that had no buttons at all. The goal was to have the identical functionality / look as an alert, but to only display a message such as “Saving Changes…”. This is something that I do all over the place, and hav…

2011-01-21 17:06 · ActionScript3/Flex4 · UI

HTML Text in a Flex Alert box

A quick and easy way to render HTML text with the body of a Flex Alert box. There is no API to set the htmlText property of the Alert text field, but you can access it using the mx_internal namespace. import mx.controls.Alert; import mx.core.IUITextField; var title:String ="HTML Alert!"; var htmlBo…

2011-01-21 14:26 · ActionScript3/Flex4 · HTML · Flex · Access

Flex 国际化参考

做一个记录和mx.utils.StringUtil.substitute()包做个记录: Using this class, the example above would look more like this: receivedMessage=At %time%, you received a message from %userName%. // then in your code trace(ResourceStringUtil.getResoureceStringWithTokens("receivedMessage", {time: "11:49", userName: "Mim…

2010-11-29 16:59 · ActionScript3/Flex4 · Flex · UP

Learn how to create a simple virtual layout in Flex 4

This post goes over the basics of writing a very simple custom layout that supports virtualization in spark. It assumes that you have already built a custom layout that handles the real (non-virtual) case and are comfortable doing so. The main difference between a virtual and non-virtual layout is …

2010-11-13 14:30 · ActionScript3/Flex4 · REST · Flex · Flash · performance

深入理解Flash Player重绘

Flash Player 会以SWF内容的帧频速度来刷新需要变化的内容,而这个刷新的过程,我们通常称为“重绘(redraw)”,相信即便是初级的菜鸟也知道,只要使用的是Debug版本的Flash Player, 右键菜单里就会有“Show Redraw Regions (显示重绘区域)” 这个选项,当此选项打开的时候,我们就能清楚地看到此刻场景内被重绘的区域。 那么什么情况下会发生重绘呢? 1、最常见的是情况就是舞台上的可视组件在形状、位置、状态(alpha, scale...)发生改变的时候会触发Flash Player 的重绘。 2、当一个DisplayObject的层级(ChildIn…

2010-10-12 22:00 · ActionScript3/Flex4 · 浏览器 · Flash · 活动 · QQ

AlivePDF本地生成PDF

直接上例子吧 ,本来想用html布局生成pdf的,没成功。。。 <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:groe_org="org.groe.html.*" minWidth="955" minHeight="600"> <fx:Declarations> </f…

2010-09-29 10:07 · ActionScript3/Flex4 · HTML · Flex · Flash · Adobe · F#

Flex 备忘

1. 读取从swf传进来的参数 var first_name : String = FlexGlobals.topLevelApplication.parameters.firstname; 2. FXG使用fill对图形本体进行上色,使用stroke对图形边框进行上色,而fill(填充)和stroke(画笔)有三种上色方法: fill — SolidColor(色块),RadialGradient(径向渐变),LinearGradient(线性渐变)。 stroke — SolidColorStroke(实线),RadialGradientStroke(径向渐变),LinearGradie…

2010-09-10 11:15 · ActionScript3/Flex4 · ActionScript · Flex · Flash · 360 · JavaScript

Understanding Custom Flex Component Development

I’ve been refining my custom Flex component development for a while but I still smile when I come across someone’s definition of the basics that makes what I’ve already learned even more understandable. I came across Mike Nimer’s post about slides from the Flex Camp in Chicago and after reading thr…

2010-09-02 22:57 · ActionScript3/Flex4 · Flex · UP · Adobe · WordPress · IE

Flex Component Life Cycle

The lifecycle of component in flex is certainly somewhat similar to the old V2 framework where you create a component holder, craetechildren, set-sizes and dispatch events. Following four methods plays a role for component rendering commitProperties() measure() layoutChrome() updateDisplayList() He…

2010-09-02 22:39 · ActionScript3/Flex4 · Flex · UP · Adobe · WordPress