Skip to main content
Known Participant
April 15, 2010
Question

Application Migration Error

  • April 15, 2010
  • 1 reply
  • 3724 views

Hi All

  I am going to migrate my code form flex 3 to flex 4. I uses mx.core.ITextInput in my code i am getting follwing errors:

  1.   1061: Call to a possibly undefined method setSelection through a reference with static type mx.core:ITextInput.
  2. 1119: Access of possibly undefined property selectionBeginIndex through a reference with static type mx.core:ITextInput.

my code sinplet is

 

textInput.setSelection(textInput.text.length, textInput.text.length);

textInput.selectionBeginIndex;

sorry i forgeeten imp thing my class is AutoCompleteModified that extends ComboBox

and get from

// Copyright (C) 2003-2006 Adobe Macromedia Software LLC and its licensors.

// All Rights Reserved. The following is Source Code and is subject to all

// restrictions on such code as contained in the End User License Agreement

// accompanying this product.

//

// Modified by Jens Krause [www.websector.de] to avoid issues using Flex 3

// @SEE: http://www.websector.de/blog/2008/04/30/quick-tip-avoid-issues-using-adobes-autocomplete-input-component-using-flex-3/

//

// This class is for demonstration purposes only.

// To use this solution extend the original Autocomplete.as described at the blog entry mentioned above, please.

//

Any help would be hieghly appriceated .

regards

gaurav kumar pandey

This topic has been closed for replies.

1 reply

Adobe Employee
April 16, 2010

Try "selectRange" to set the selection, and  selectionAnchorPosition and selectionActivePosition, to get the current selection range.

- robin

Known Participant
April 16, 2010

Thanks Robbin,

I have solved the setSelection() by changing to selectRange(). However I am unable to find  the solution for ITextInput.selectionBeginIndex property. Actually we are migrating our application from Flex 3.2 to Flex 4.0 (using sdk version 4.0.0.10485) where we have not found the similar property to replace with "ITextInput.selectionBeginIndex".

Could any one help out to come over this problem?

Regards,

Gaurav

Adobe Employee
April 16, 2010

In the new code there is selectionAnchorPosition and selectionActivePosition. Did you try that?

- robin