Copy link to clipboard
Copied
Hi, I've recently taken to flashbuilder, and have come across apparently a very simple error but for the life of me I can't persuade it to work.
Basically i have two instances of a component I've made (PhotoFrameThumb.mxml) with a string variable for a colour property. However when I set the string as a valid colour, they always get rendered black. Any thoughts would be much appreciated:
Main application:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
xmlns:components="components.*" height="768">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<components:PhotoFrameThumb x="121.2" y="125.8"
imageComment="Honalulu!"
imageThumbFile="Honalulu/Hon_thmbs/Thmb_Hon_01.jpg"
thumbColour="#ff00c6">
</components:PhotoFrameThumb>
</s:Application>
Photo thumbframe:
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
[Bindable]
public var imageThumbFile:String;
[Bindable]
public var imageComment:String;
[Bindable]
public var thumbColour:String;
]]>
</fx:Script>
<s:SkinnableContainer width="120" height="100">
<s:Rect width="100%" height="100%">
<s:fill>
<s:SolidColor color="{thumbColour}"/>
</s:fill>
</s:Rect>
<mx:Image width="100" height="60"
source="images/JMImages/{imageThumbFile}"
scaleContent="false"
horizontalCenter="0" top="10"/>
<s:RichText text="{imageComment}"
verticalAlign="middle"
width="100" height="17" bottom="10" left="10"
fontFamily="Arial" fontWeight="bold" fontSize="12"/>
</s:SkinnableContainer>
</s:Group>
Thanks! This has been driving me a bit nuts as it seems to simple...
Copy link to clipboard
Copied
Yea actually solved this myself;
if anyone has any similar problems the var thumbColour just needs to be of uint format rather than a string.