I'm new to flex, actually I'm reading a simple tutorial about Flex 4 (I'm using flash builder 4.5) this is the tutorial.
I added a RichEditableText and then I should specify the property selectionColor, but when I add it to the source code, the IDE give me an error like this property do not exist.
<s:RichEditableText x="179" y="95" text="hello" fontSize="24" fontWeight="bold" color="#E52222" selectionColor="#000000" />
The property is slightly different now. It's focusedTextSelectionColor There's also an unfocusedTextSelectionColor. The article you are reading is for a Flex Gumbo Pre-Release. That's basically a beta version of 4.0 and now we're on the 4.5 SDK so there are slight differences. Here is a good tutorial from FlexExamples: http://blog.flexexamples.com/2009/11/07/setting-the-selection-highlight-color-on-a-spark-richeditabletext-control-in-flex-4/
Related
Flex 3.5 has this bug where in IE (and some others) where if you push the backspace key in some text boxes, the browser acts like you just pushed its back button. According to the bug report this is "resolved" because it works in 4.0. But I need a workaround for 3.5. Is there one?
In my case, it seems that this has nothing to do w/the <mx:TextInput /> or whatever other people were saying it is. This was all because I was using the <mx:TabNavigator />. In any case, getting rid of that tag and replacing it w/a combination of <mx:TabBar /> and <mx:ViewStack /> eliminated the problem for me under IE.
Unfortunately, this was a very large undertaking for me, because even though I had only half a dozen <mx:TabNavigator />s to fix, the order in which events are thrown is different, so component construction resulted in a lot of components not being created when first accessing tabs and stuff. I found I had to use <mx:TabBar />'s itemClick event for some things, and then <mx:ViewStack />'s change for others.
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d9b.html#WS2db454920e96a9e51e63e3d11c0bf63b33-7fd3
Shows that mx:DateChooser control can be used in Flash Builder 4.6
I cannot find it in the codehint.
Please advise on how do I have a DateChooser control for use in Flash Builder 4.6
Update:
I really cannot find datechooser as seen in this screenshot.
http://cl.ly/EJKp
definitely I am using sdk4.6 for flex also shown here.
http://cl.ly/EJT0
make sure your script header contains things as following:
<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">
If the Flash Builder project settings have the Flex Build Path configured with a component set of "Spark only" then MX components like <mx:DateChooser> will not be available. One way to fix this is to change the component set to "MX + Spark".
However, a trade-off of this approach is that the project will be able to compile a web application but not a mobile application. Another solution is to use a spark only DatePicker (actually, DateChooser and DateField). For example, here is an open source DateChooser component.
When I attempt to add an icon to a button like this:
<s:Button icon="#Embed(source='assets/logo.jpg')"/>
I receive this error:
Multiple markers at this line:
-Button
-Cannot resolve attribute 'icon' for component type spark.components.Button.
The documentation specifies that you can add an icon like that. See Button Reference.
It is interesting because I can add other Common Styles with no trouble. For example this compiles fine:
<s:Button color="#998877" fontSize="16"/>
What am I goofing up here? Sure it is pretty simple.
Edit: There is also an example right here. The example uses version 4.6. I am on version 4.
I ran into this when I first started using the spark components. I was too was using the original Flex 4 version. They originally didn't support an icon property. You'd have to skin it to get it to work. See the following link:
http://www.flexer.info/2009/06/12/how-to-skin-a-button-with-icon-in-flex-4-sdk-spark/
However, rather than using skins to just add a image to the button, I'd also suggest moving up to flex 4.5 and up. Those include enhancements along with the addition of the icon property to the spark button.
I have a component (an s:TitleWindow) that I created and inside I have some <mx:FormItem ...> blocks.
There is supposed to be an equivalent <s:FormItem...>, but when I type <s: and press control space I get a list of spark components, but FormItem is not one. If I type it, the compiler generates an error that it does not exist.
My project settings are set to "MX+Spark".
The reason for this is I want to some some css styling to right justify the form and the examples I have seen all use the syntax of s|FormItem.
I noticed here that the spark form tag is available only with Flex 4.5. This includes tags within a Spark form (e.g. <s:FormItem />). Flex 4 doesn't seem to include the Spark Form tags. This may be the issue:
"Spark was a new component architecture introduced in Flex 4. I consider the architecture "complete" but not all MX components have been implemented as Spark components yet. The Spark Form tag is slated for Flex Hero expected early next year and is only available in pre-release builds."
in the transition to version 4.0 not all the components were ported to spark. another example is datagrid, you only have mx:datagrid for now (in 4.5 you will have s:datagrid). you just have to wait that the transition is completed...
the css you are referring to were for 4.0 or 4.5 ?
I'm having a problem where I'm not able to set up a custom reading order for text in my Flex application. I'm setting the tabIndex property on each text element, which I understand is the proper way to set the reading order for a screen reader.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx" layout="absolute">
<mx:Label x="10" y="10" text="1" tabIndex="2" />
<mx:Label x="10" y="36" text="2" tabIndex="1" />
<mx:Label x="10" y="62" text="3" tabIndex="3" />
</mx:Application>
For this small test application, the screen reader (JAWS 12) reads "1 2 3" instead of "2 1 3".
Some testing seems to indicate that this is only a problem for my particular configuration. I am compiling the application with Flex SDK 4.1, but using the MX component set only, and the Halo theme. We've got a fairly complex app which started out before Flex 4 was around, so while we have made the jump to compile with the latest SDK, we have not yet upgraded anything to use the Spark component set.
When I make a similar test app using the 4.1 SDK and the Spark components+theme, the reading order is set correctly. Same result if I make a test app and compile using the 3.5 SDK - everything works.
I know I could switch to using Spark components, but I'm trying to avoid that if I can as it would mean timelines would have to change on the current project I'm working on.
Has anyone run into any similar issues, or have any suggestions that might get this to work?
You'll want to use Text instead of Label. Documentation:
A Label control is read by a screen
reader when it is associated with
other controls, or when the Forms mode
is inactive. The Label control is not
focusable in Forms mode, or by the
keyboard.
...
A Text control is not focusable and is
read by screen readers only when Forms
mode is inactive.
I also found this which might be a better solution. The example is in Flex 4, but you can do the same with Label in Flex 3, just need to implement the IFocusManagerComponent interface.
Im working with JAWS 11 in Flex 3 at the moment, so havnt had that problem yet. But, i've read about one option of putting copies of the components offstage, its too complicated for our needs, and letting the screen reader just read these components in order:
http://www.adobe.com/accessibility/products/flash/reading.html#off_stage
Also, a trick I saw was to set the TabIndex in increments of 10. JAWs only cares about their order, and if you need to add extra components, you wont need to renumber everything. i.e. 10, 20, 30 then if you need you can add 11, rather than renumbering everything.
Brian