Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
Adobe Flex SDK Previous
-
None
-
None
-
Affected OS(s): All OS Platforms
Language Found: English
Description
Found in 4.5.0.18298
Steps to reproduce:
1. Compile and run attached MXML file.
Actual Results:
Note that the broken image icon is in the upper/left corner of the s:Image control rather than pinned to the center. This was more difficult that I hoped due to the fact that the s:BitmapImage skin part didn't have an id, which makes it very difficult to extend the default Spark ImageSkin skin and adjust the icon's position. Basically I would have to copy/paste the entire 55 lines of Spark Image skin code just to modify the x/y position of the broken image icon. Not difficult, but it is becoming more and more error prone in the Flex SDK as users copy/paste entire skin files and make a few tweaks. Then when bug fixes are made to the default Spark skins, those fixes rarely/never make it in to the custom skins since users are not aware of what has changed in newer SDKs.
Essentially I created BetterImageSkin which simply added an ID (invalidIconDisplay) so I could extend the skin class using ActionScript and reposition the broken image icon without needing to duplicate any code.
Expected Results:
Default Spark ImageSkin adds an ID to the broken image icon skin part so I can extend the ImageSkin class in ActionScript (~15 lines of code) rather than having to copy/paste the default ImageSkin in MXML (~55 lines of code) and modify the position of said icon.
Workaround (if any):
(a) Copy the default ImageSkin and reposition the icon.
(b) Copy/paste the default ImageSkin and add an ID on the desired skin part to make it easier to extend the custom ImageSkin in ActionScript.