Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
Adobe Flex SDK 3.2 (Release)
-
None
-
None
-
Affected OS(s): All OS Platforms
Language Found: English
Description
Steps to reproduce:
1. I've created a new custom component that extends from UIComponent called ExtendedText (see simplified code in the attached file)
2. I'd like to allow the users of my ExtendedText component to allow modify its selected text via following API
------------
public function get selection() : TextRange {
return new TextRange(this, true);
}
------------
3. I try to access selection property of ExtendedText, by calling
var selection : TextRange = myExtendedText.selection;
Actual Results:
RTE is raised
ReferenceError: Error #1069: Property http://www.adobe.com/2006/flex/mx/internal::getTextField not found on com.myCompany.controls.ExtendedText and there is no default value.
Expected Results:
TextRange component must impose at the compile time at "owner " component to have getTextField() method implemented as PUBLIC , this can be done by creating a new interface class called ITextElement with single method getTextField()
Now TextRange constructor is
public function TextRange(owner:UIComponent,
modifiesSelection:Boolean = false,
beginIndex:int = -1, endIndex:int = -1)
and I propose to change it to
public function TextRange(owner:ITextElement,
modifiesSelection:Boolean = false,
beginIndex:int = -1, endIndex:int = -1)
Workaround (if any):