[Flashcoders] [Q] What's the relationship with the setFocus and the ComboBox component???

2006-05-12 Thread Jason

Howdy...  :)

Maybe there is something I am missing here but I've been scratching my head 
off for a couple hour, so I thought that I'd ask here and keep scraching...


Okay...  Open up a new Flash file in Flash MX 2004...
Create an input textField on the stage and give it an instance name of 
'test_txt'...

Add this simple script in another layer...

this.test_txt.onSetFocus = function ()
{
trace(onSetFocus :  + this.text);
}

this.test_txt.onKillFocus = function ()
{
trace(onKillFocus :  + this.text);
}

Test movie and you should see that both events get fired when you click 
inside/outside of the textField...


Now, wicked part...  Add a V2 ComboBox component to the stage from the 
Components panel...  Delete it from the stage so that the library can have 
the component...


Do the test movie again...  Click inside the textField and you will get 
onSetFocus...  Click outside the textField and you will see the onKillFocus 
AND onSetFocus at the same time...  So, the textField gets focused again...


Now, delete the ComboBox from the library and do the test movie again... 
It's back to normal...


What am I missing here???  Anybody???  :confused:

CyanBlue 



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] [Q] What's the relationship with the setFocus and the ComboBox component???

2006-05-12 Thread Vivek lakhanpal

Hi,

This doens't occur only if you put up a V2 component on stage. But you try
to do with any of the component. Put any component on stage and then remove
that from stage. you input text field won't leave the focus even after you
click outside. i.e. It will fire kill focus and then again set focus.

But if you create any small movie cilp and remove that from stage and then
try this it textfield will not except the focus again. i.e. if you click
outside the textfield it won't fire set focus again.

Moreover it's not occuring in case you put V1 i.e. MX component on stage and
then remove from stage.


The reason why it occurs in case of V2 components only is a bit strange to
me as well.

It can be due the classes/scripting written for V2 components?
Might be someone who has done some deeper coding with V2 components can
comment on it.

Thanks,
Vivek
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com