通用于Mac/Linux/Window的.emacs文件.

算是通用吧。。部分地方需要一点小修改。盘符,路径,启动屏目等。



;;;先设好启动大小的宽高,要不然,其它的我都受不了.
(setq default-frame-alist '((height . 57) (width . 234) (top . 40) (left . 10)))

;;;工作目录
(setq default-directory "/Volumes/VAR/Workspace/")

;;;缺省为text-mode
(setq default-major-mode 'text-mode)

;;;开机画面
(setq inhibit-startup-message t)

;;;php模式(Mac)
(add-to-list 'load-path "~/elisp")
(autoload 'php-mode "php-mode" "Major mode for editing php code." t)
(add-to-list 'auto-mode-alist '("\\.php$" . php-mode))

;;;actionscript 3.0 mode
(require 'actionscript-mode)
(autoload 'actionscript-mode "actionscript-mode" "Major mode for editing actionscript code." t)
(add-to-list 'auto-mode-alist '("\\.as$" . actionscript-mode))

;;;显示列号
(setq column-number-mode t)

;;;功能键设定
(global-set-key [f5] 'revert-buffer)
(global-set-key [f4] 'ibuffer)
(global-set-key (kbd "") (lambda () (interactive) (kill-buffer (current-buffer))))
(global-set-key (kbd "M-g g") 'goto-line)

;;;关闭设配提示声(bell)
(setq visible-bell t)

;;;重定Emacs标题
(setq frame-title-format
'(" GNU Emacs - [ " (buffer-file-name "%f \]"
(dired-directory dired-directory "%b \]"))))
;;;鼠标自动"让位"
(mouse-avoidance-mode 'animate)

;;;括号的匹配显示
(show-paren-mode t)
(setq show-paren-style 'parentheses)

;;;全局语法加亮
(global-font-lock-mode t)

;;;编辑时不建立备份文件
(setq make-backup-files nil)

;;;没有滚动条和工具栏
(scroll-bar-mode nil)
(tool-bar-mode nil)

;;;光标闪烁
(blink-cursor-mode nil)

;;;配色方案
(require 'color-theme)
(color-theme-charcoal-black)

;;;超级好用的M-/自动扩展功能(hippie-expand)
(global-set-key [(meta ?/)] 'hippie-expand)
(setq hippie-expand-try-functions-list
'(try-expand-dabbrev
try-expand-dabbrev-visible
try-expand-dabbrev-all-buffers
try-expand-dabbrev-from-kill
try-complete-file-name-partially
try-complete-file-name
try-expand-all-abbrevs
try-expand-list
try-expand-line
try-complete-lisp-symbol-partially
try-complete-lisp-symbol))

;;;kill ring 设置
(setq kill-ring-max 200)

;;;会话定位
(require 'session)
(setq session-save-file "~/.emacs.d/_session")
(add-hook 'after-init-hook 'session-initialize)
;;;(setq session-save-file-coding-system 'chinese-gbk) ;;;中文出现乱码,可是会提示utf-8存储,所以先屏闭掉
(add-to-list 'session-globals-exclude 'org-mark-ring)

;;;buffer记录
(desktop-save-mode)
(desktop-load-default)

;;;高亮当前所在行
(global-hl-line-mode)

;;;(ido)小型buffer快速查找
(require 'ido)
(ido-mode t)

;;;(kill ring)无法形容的华丽剪贴板查看..
(require 'browse-kill-ring)
(global-set-key (kbd "C-c k") 'browse-kill-ring)
(browse-kill-ring-default-keybindings)

;;;doxymacs很牛逼的注释块
(require 'doxymacs)
(global-set-key [f7] 'doxymacs-insert-function-comment)
(global-set-key [f6] 'doxymacs-insert-file-comment)

;;;类似的快速bookmarks
(global-set-key [(control ?\.)] 'ska-point-to-register)
(global-set-key [(control ?\,)] 'ska-jump-to-register)
(defun ska-point-to-register()
"Store cursorposition _fast_ in a register.
Use ska-jump-to-register to jump back to the stored
position."
(interactive)
(setq zmacs-region-stays t)
(point-to-register 8))

(defun ska-jump-to-register()
"Switches between current cursorposition and position
that was stored with ska-point-to-register."
(interactive)
(setq zmacs-region-stays t)
(let ((tmp (point-marker)))
(jump-to-register 8)
(set-register 8 tmp)))

;; hides and shows blocks
(add-hook 'c-mode-hook 'hs-minor-mode)
(defun my-hs-hook ()
(define-key hs-minor-mode-map [(control c)(h)] 'hs-hide-block)
(define-key hs-minor-mode-map [(control c)(s)] 'hs-show-block)
(define-key hs-minor-mode-map [(control c)(control h)] 'hs-hide-all)
(define-key hs-minor-mode-map [(control c)(control s)] 'hs-show-all)
)
(add-hook 'hs-minor-mode-hook 'my-hs-hook)

万恶的TypeError: Error #1009错误.

前因

当子SWF中使用了fl.controls.List控件,而LoaderSWF中,没有加载fl.controls.List控件的话。就会出现万恶的1009错误了。

后果

在主LoaderSWF中,加入import fl.controls.List就可以解决了。

PS,在老外论坛上也发现了解决办法。

I'm having this problem as well, but only when I load the SWF containing the TileList with a Loader. I fixed it by adding the TileList component to the library of the Loader's FLA.

absolutezero's solution of adding the class path to the fl.controls folder did not work at all for me.

The guys at Adobe should really be looking at this if they want AS 3 to be a true OO scripting language, but maybe that's what FLEX is for!

crew: Jabba WockeeZ / MJ song: P.Y.T.


这个我很喜欢。。

和那种我常识中在地上滚来滚去的街舞不同。。感觉很酷啊。。

主要是杰克逊的歌棒!~

我的.emacs的配制文件。

color-theme文件。已经弄好的。哈,我比较懒。color-theme-dark-laptop的风格看着比较爽。
color-theme.el

.emacs 只是一些最小化的应用

AS3.0 原理(主SWF与子SWF双向交互)

假设:
A.swf 载入 B.swf 同域!

目标:
a) 从A中调用B的方法和属性。
b) 从B中调用A的方法和属性。

a) ----------- 解法 -------------
A加载B的同时,监听Event.INIT事件,当B可完成初始化时。可以获得(Event).target.content,既是B对象。可使用B的方法和属性了。

b) ----------- 解法 -------------
A加载B的同时,监听Event.INIT事件,当B可完成初始化时。可以获得(Event).target.content,既是B对象。在B对象中组织一个setParent函数,传参类型为Object,在A的INIT处理函数中调用B.setParent(this),将自身引用传入。B对象中应当有一个全局变量进行存储。在B对象中即可操作。

PS:在使用监听过程中,本人非常喜欢用function()匿名函数。这里有一个小错误会发生,因为在匿名函数中的this可能不能准确指出A对象本身。所以INIT处理函数,还是用函数指针吧。。

 1 2 Next →

About

User