ActionScript, Flash, and Flex
Posts tagged flex
AIR – Spark Button Repeat – Doesn’t Work
Jul 14th
Does anyone have experience with making the Spark Button component have autoRepeat work with AIR SDK 4 – Release – 4.0.0.14159
http://bugs.adobe.com/jira/browse/SDK-26965
Popularity: 6% [?]
The Power of Separated Logic: Opening the Door
Jun 9th
I have to give the Adobe Flash team big props on the new Spark framework’s focus on separated logic. Not only does it enhance my productivity and sanity, but it has opened wide the door for and encouraged the Flex community to create vast reusable code in ways that Flex 3 had problems encouraging developers to do.
For instance, the Spark separated layout structure with a DI slant has already saved time and encouraged so many layout concepts that are no longer component based solutions (example). The community is now able to focus on solving small solutions and then combining them into greater solution for a given project!
I expect to see more focused classes coming soon.
UPDATE (June 10, ’10):
The focus on solution driven instead of component has allowed Adobe to have features like Layout Mirroring (link). This further demonstrates the power of developing a DI driven framework. I encourage more of us to architect this way. OH MAN, did I really suggest us to architect like Adobe?!
Popularity: 6% [?]
BackgroundAlpha: Why contentBackgroundAlpha?
Jun 5th
Situation: I was working with the Spark (Flex4) TextArea component. I wanted the background to no longer be visible or just simply alpha set to zero. I expected I could set a stylesheet property backgroundAlpha to zero. However, that didn’t work and there wasn’t even a property on the component called that. I dug in the source to find it and realized it is really contentBackgroundAlpha. Why? I see borderAlpha and expect to follow the same convention! I do not see contentBorderAlpha.
Why break a convention?
Why use contentBackgroundAlpha when borderAlpha is present and there is not already a backgroundAlpha?!
Popularity: 22% [?]
Rasterize a Transformed Vector without Pixelation
Nov 10th
How does one rasterize a transformed vector capturing it’s new dimensions without pixelation?
Note: This follows my previous post Matrix Not Synchronized
Challenge: To render a bitmap of a transformed vector display object without pixelation. Specifically, after a mx.controls.Text is transformed, a bitmap snapshot is needed to be taken of the new object including the dimensions. I should note that the reason I am needing to get a bitmap snapshot is do to some shaping to the text.
Problem: However, doing so results in pixelation or resamples / renders the original dimensions of the transformed Text. It appears that flash.display.BitmapData::draw cannot get the new transformed display. In other words, when a flash.display.InteractiveObject is scaled on the x axis (or any axis) using transform.matrix, flash.display.BitmapData::draw cannot capture the new dimensions of the display object.
Example: http://sources.novelastudios.com/flash/matrix_adustments/MatriciesAndDimensions.html#
When the application creation complete is fired a snapshot is made. Change the matrix width (transform.matrix.a) and then re-render a snapshot / bitmap. Notice it retains the original, non-transformed values. Therefore and considering it is a rastered snapshot, when the snapshot/bitmap is scaled it becomes pixelated. Example version was 1.1.0.0 that should this problem. Version 1.2.0.0 is a workaround for now showing the workaround.
Workaround: I give credit to Guy Stables (needs a link) and Alex Harui (http://blogs.adobe.com/aharui). Essentially, the workaround is as follows:
- The InteractiveObject (we’ll call our target) needs to be placed in a container. In this example mx.controls.Text is placed inside a mx.core.UIComponent.
- The matrix transform is then applied to the target (eg mx.controls.Text)
- The dimensions of the container (eg the UIComponent that contains the Text/target) are then set to the target’s pixelBounds dimensions.
- Finally, take the snapshot bitmap of the container (the UIComponent).
For a demonstration see the latest version 1.2.0.0 of the example.
More Information:
Also found at http://forums.adobe.com/thread/521432
Popularity: 33% [?]
Most Recent Comments