Welcome, Guest. Please login or register.
Did you miss your activation email?
02/04/12, 00:48
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  General
| |-+  V2 Components (Flash MX 2004 - Flash 8) (Moderators: vesa kortelainen, Ronald Wernecke, Jorge Solis, ..:: Mazhar Hasan ::.., papachan)
| | |-+  SetFocus: Bad when using ComboBox Component
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: SetFocus: Bad when using ComboBox Component  (Read 4661 times)
sherman wellons
Jr. Programmer
**
Posts: 55



View Profile Email
« on: 06/21/04, 16:58 »

Flash db folks.

Okay...I have one that has me dazzed, confused, and aggrivated all at the same time.


If you create a combo box and a text field. And if you attempt to set the focus of the text field to a specified index.....after the combo box closes. The index position of the text field jumps automatically to (0,0), instead of specified numbers. See for yourself: Drag a combo box onto the stage and give it an instance name of "theCombobox" (give the label a few values so you can select something when the combo box selection drops down) .  Just create an input text field and give it an instance name of "mytext". Add this line of code:

form = new Object();
form.close = function(){
 Selection.setFocus(mytext);
 Selection.setSelection(5,26);
}
theCombobox.addEventListener("close", form);

Make sure that you add 26 characters or more to the  text field so that when you specify an index position, you are specifying a position that you can visually see highlited.

The cursor initially jumps to the specified focus index postion (Selection.setSelection(5,26)), which is specified above then jumps to (0,0).  Is there a work around for this? Is there some property in the combobox  component which can be changed to fix this? Any suggestions would be greatful.

Reason for correcting problem:

I am attempting to build a simple text editor using flash. Using the combo box to select font sizes and font type, and maybe font color......depends upon if the pain is worth the effort. Thanks.

--flashdumbass--
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14590


View Profile
« Reply #1 on: 06/22/04, 10:30 »

Yep, strange. Anyway, consider this: usually the user will select some text, then go to the combobox to change something. Suppose that you set to bold the Selection (that you need to capture whe the textfield lost focus)

[script]
form = new Object();
form.change = function(){
 myBold = new TextFormat()
 myBold.bold = true
 mytext.setTextFormat(5, 26, myBold)
 
}
theCombobox.addEventListener("change", form);
[/script]

Also take a look at http://www.flash-db.com/Components/?swfID=28&sComType=Text%20Editor

Jorge
Logged

sherman wellons
Jr. Programmer
**
Posts: 55



View Profile Email
« Reply #2 on: 06/22/04, 18:22 »

Jorge.

Thanks for the response. Strange indeed. I checkedout the text editor you refered me to. I reverted back to Flash MX Actionscript 1.0 and used a combo box in the same fashion. No drama.....must be a bug with Flash MX Professional components. Macromedia folks must of rushed to get the product out without hashing out the little bugs which can drive you insane. Thanks again....'



---flash dumbass--
Logged
Larryson
Server what's that
*
Posts: 1


View Profile Email
« Reply #3 on: 06/14/09, 23:35 »

              I agree i incurred this error. Thanks for the information to fix using ComboBox component.


________________
movie
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything