Filed under: Uncategorized | Tags: actionScript, development, flash, tips
RSLs are great. What an ideal way to abstract and modularize functionality. And they are not too shabby for loading assets and fonts too. Now AS3 has provided some pretty nifty functions via the ApplicationDomain class in order to retreive a class defined in an external SWF, but you have to know the class name in order to get it. If you use RSLs to, well, have lots of classes loaded at run-time, this can become problematic at best.
In order to work around this you used to have to load a manifest file that basically listed all the classes to be located in an external SWF. Well I didn’t like that solution too much. After doing some poking around on Google, I found something akin to ApplicationDomain.getDefinitions():Array
An AS3 Developer by the name of Denis Kolyako has provided a great solution to this problem. Unfortunately his blog is in Russian but you get the idea:
Until a native solution is provided by the AS3 API, this is the next best thing. Thanks Denis! Spread the word!
Filed under: Uncategorized | Tags: actionScript, development, drag n' drop, flex, tips
[note to self]
The native Flex drag and drop from list-based components is pretty neato. With just a few hookups to drag events, you can easily drag objects out of a list to a receipient component. One point of annoyance with the native drag n’ drop is the lack of the draggedItem being easily accessed.
By default the draggedItem property of most drag events is null through out the entire dragging process. This is absurd in my book. The only time this gets populated is through automation hookups which I know nothing about. Even assigning the public var draggedItem does not work as it is rendered null during the dragging process. So how does one go about geting the actual dragged item?
Assuming for the moment you are trying to access a single dragged item you would simply say:
DragEvent(evt).dragSource.dataForFormat("items")[0];
Filed under: Uncategorized | Tags: actionScript, components, development, flash, flex, tips
My current client’s project is pretty much Flash only. As such I have been working on some Flash-based component development. My expertise lies in Flex-based components so this is an exploration of some sorts.
[Notes to Self]
Flash <=> Flex comparison:
creation process:
- configUI() = createChildren()
validation process:
- invalidate() = invalidateProperties(), invalidateSize(), invalidateDisplayList():The Flash UIComponent basically lumps all of the Flex invalidation methods into one
- draw():This takes place at the beginning of the validation process. It takes care of applying styles and drawing the focus rectangle. I would most likely perform both the commitProperties() and measure() method logic here. NOTE: I say validation process not validate() which takes place later.
- validate():This is called after the draw() method during the validation phase. It looks to be intended for usage much like the updateDisplayList() method.
Please feel free to correct my observations since I am rather new to Flash component development.
