Monthly Archive for May, 2009

Loading External Classes with ApplicationDomain

When you load an external ActionScript 3 SWF into a Loader instance in another ActionScript 3 SWF you can have the loaded SWFs definitions be shared with the SWF handling the loading or you can have it completely separated. The location of these definitions is known as the Application Domain.

In ActionScript 3 there is a hierarchy of application domains that describes class relations. You can have application domains separated (thereby keeping definitions separated) or you can an application domain as the child of another application domain. A child application domain will use definitions in its parents’ application domains before it uses its own if they are defined in a parent.

When loading a SWF into another SWF you have 3 options for the placement of the loaded SWFs definitions:

  • new partitioned domain: create a new separated domain for the loaded SWFs definitions to live that will separate it completely from those definitions within the loading SWF.
  • current domain: load the definitions into the current application domain of the loading SWF. This will not overwrite existing definitions but it will add new definitions to those within the current application domain of the SWF doing the loading.
  • child domain (default): load the definitions into a new application domain that is a child of the application domain of the loading SWF. This will not affect the current application domain of the loading SWF but it will force the loaded SWF to use any duplicate definitions in the parent over its own

You specify application domains for loaded content within a LoaderContext (flash.system.LoaderContext) instance. This instance is then passed to the load() method of Loader (Loader.load()). For the domain of the current SWF, you can use ApplicationDomain.currentDomain ().

// child SWF uses parent domain definitions
// if defined there, otherwise its own
var childDefinitions:LoaderContext = new LoaderContext();
childDefinitions.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);

// child SWF adds its unique definitions to
// parent SWF; both SWFs share the same domain
// child SWFs definitions do not overwrite parents
var addedDefinitions:LoaderContext = new LoaderContext();
addedDefinitions.applicationDomain = ApplicationDomain.currentDomain;

// child SWF domain is completely separate and
// each SWF uses its own definitions
var separateDefinitions:LoaderContext = new LoaderContext();
separateDefinitions.applicationDomain = new ApplicationDomain();

// set loader context in load()
myLoader.load(request, separateDefinitions);

More information:

http://livedocs.adobe.com/flex/201/h…ng_162_09.html

http://livedocs.adobe.com/flex/201/h…ent_175_4.html

Adobe CS4: Le Sens Propre

Real 3D display

How to fix stupid flash player bug with a TextField`s selection color?

I think this code can help you:
Continue reading ‘How to fix stupid flash player bug with a TextField`s selection color?’

Encode PSP video with ffmpeg from command line on mac os x

1. Install proper ffmpeg:

port install ffmpeg +gpl +lame +x264 +xvid +faac +faad

2. Create an convert.sh file:

#!/bin/sh
mkdir mp4
for file in *.avi; do
/opt/local/bin/ffmpeg -i "$file" -acodec libfaac -ab 128k -ar 48000 \
-s 368x208 -r 29.97 -vcodec libx264 -b 500kb \
-flags +loop -cmp +chroma \
-partitions +parti4x4+partp8x8+partb8x8 \
-me_method umh -subq 6 -trellis 1 \
-refs 2 -bf 1 -coder 1 -me_range 16 -g 300 -keyint_min 25 \
-sc_threshold 40 -i_qfactor 0.71 -maxrate 4M \
-bufsize 4M -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 21 \
-threads 0 "mp4/${file%%.*}.mp4"
done

3. Chmod it:

chmod 777 convert.sh

4. launch it:

./convert.sh

P.S. If you want launch conversion in foreground, just do next steps:

  1. Open terminal and launch virtual console :
    screen
  2. launch convertion
    ./convert.sh
  3. exit virtual console
    ctrl+a, d
  4. close terminal window

if you want to sneek, what happens at your virtual console open it with next command:
screen -r

What the f..k or another flex framework / flash player bug

100000 Arrows Flow Simulation

Pretty fast ですね?

source
Continue reading ’100000 Arrows Flow Simulation’

Nice 3D Face tracking

“Интеллектуально развит – значит виновен”

Просто нет слов … даже матерных

Вкратце, суть дела такова:

23 апреля 2008 года, в 8 часов утра в мою квартиру стали настойчиво звонить. Я встал с постели, открыл дверь. На лестничной площадке стоят пять человек. Двое из них показывают удостоверения и говорят: ФСБ Кемеровской области. Я спрашиваю: а что случилось? Они показывают постановление на обыск и говорят, что из моей квартиры был незаконный выход в Интернет. Я: этого не может быть. Они: у нас точные данные…

На суде не было предъявлено ни одного конкретного доказательства того, что я в чём-то виновен. Не был установлен ни мотив, ни способ совершения преступления. Нет потерпевших, нет никаких исков, заявлений. На приговоре, судья привёл в качестве доказательства, что я якобы мог воспользоваться хакерскими программами, а потом удалить их с компьютера. Экспертиза моего компьютера не обнаружила на нём наличие каких-либо чужих паролей. Государственный обвинитель приводил следующие доказательства моей вины: я интересуюсь историей интернета, я интеллектуально развит.

Все доводы защиты были признаны судьёй необоснованными.

Полный пост здесь

JigLibFlash car model test

JiglibFlash is a open source Actionscript 3D Physics Engine.
It’s ported from the c++ open source physics engine jiglib.

GET IT