# Tab Problem with Contact Form

**URL:** https://forum.kirupa.com/t/tab-problem-with-contact-form/263152
**Category:** flash
**Created:** [June 12, 2008, 10:39pm UTC](https://forum.kirupa.com/t/tab-problem-with-contact-form/263152 "2008-06-12T22:39:59Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![dColumbus](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@dColumbus](https://forum.kirupa.com/u/dColumbus)
#### Post date: [June 12, 2008, 10:39pm UTC](https://forum.kirupa.com/t/tab-problem-with-contact-form/263152/1 "2008-06-12T22:39:59Z")

</div>

I have a contact form movie clip inside my main stage and I can’t seem to figure out why I keep getting this error when I try to tab through my contact form:

```auto

ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
	at flash.display::DisplayObjectContainer/getChildIndex()
	at fl.managers::FocusManager/getChildIndex()
	at fl.managers::FocusManager/sortByDepth()
	at fl.managers::FocusManager/sortByTabIndex()
	at Array$/_sort()
	at Array/http://adobe.com/AS3/2006/builtin::sort()
	at fl.managers::FocusManager/sortFocusableObjectsTabIndex()
	at fl.managers::FocusManager/sortFocusableObjects()
	at fl.managers::FocusManager/keyDownHandler()

```

This is yet another AS3 issue that’s leaves me running around in circles… can anyone help me out?

---

<div class="post-metadata">

### Author: ![craig\_clayton](https://avatars.discourse-cdn.com/v4/letter/c/ee59a6/32.png) [@craig\_clayton](https://forum.kirupa.com/u/craig_clayton)
#### Post date: [June 13, 2008, 4:12am UTC](https://forum.kirupa.com/t/tab-problem-with-contact-form/263152/2 "2008-06-13T04:12:54Z")

</div>

did you try tabIndex? Example my\_text.tabIndex = 1; my\_other\_text.tabIndex = 2; I am not sure if it works in AS3 but it did in AS2.

---

<div class="post-metadata">

### Author: ![dColumbus](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@dColumbus](https://forum.kirupa.com/u/dColumbus)
#### Post date: [June 13, 2008, 4:25am UTC](https://forum.kirupa.com/t/tab-problem-with-contact-form/263152/3 "2008-06-13T04:25:55Z")

</div>

[QUOTE=craig.clayton;2341960]did you try tabIndex? Example my\_text.tabIndex = 1; my\_other\_text.tabIndex = 2; I am not sure if it works in AS3 but it did in AS2.[/QUOTE]

That’s not the problem. I’ve already got my tabIndex’s written. Has nothing to do with that.

---

<div class="post-metadata">

### Author: ![dColumbus](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@dColumbus](https://forum.kirupa.com/u/dColumbus)
#### Post date: [June 13, 2008, 9:07am UTC](https://forum.kirupa.com/t/tab-problem-with-contact-form/263152/4 "2008-06-13T09:07:13Z")

</div>

There are 5 elements involved in the tab index… 4 textfields that are on the stage, and one button. this is just so ridiculous it’s not even funny.

---

<div class="post-metadata">

### Author: ![dColumbus](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@dColumbus](https://forum.kirupa.com/u/dColumbus)
#### Post date: [June 13, 2008, 5:27pm UTC](https://forum.kirupa.com/t/tab-problem-with-contact-form/263152/5 "2008-06-13T17:27:27Z")

</div>

I’m not dynamically creating anything… that’s why I think it’s so bizzare. They are literally on the stage when the SWF is published. Do I need to import something? AS3 is so frustrating.

---

<div class="post-metadata">

### Author: ![dColumbus](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@dColumbus](https://forum.kirupa.com/u/dColumbus)
#### Post date: [June 15, 2008, 5:44pm UTC](https://forum.kirupa.com/t/tab-problem-with-contact-form/263152/6 "2008-06-15T17:44:40Z")

</div>

Not using removeChild or addChild or anything dynamic, really…

---

<div class="post-metadata">

### Author: ![dColumbus](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@dColumbus](https://forum.kirupa.com/u/dColumbus)
#### Post date: [June 16, 2008, 7:51pm UTC](https://forum.kirupa.com/t/tab-problem-with-contact-form/263152/7 "2008-06-16T19:51:04Z")

</div>

There’s really not even any code… I’ve got 4 text boxes on the stage with instances and a button… I’ve given those tabIndex’s from 1-5.

I mean, here’s the code in that MovieClip:

```auto

stop();
contact_toEmail.text = MovieClip(root).szEmail;

//form handler
var variables:URLVariables = new URLVariables();
var varSend:URLRequest = new URLRequest("sendmail.php");
var varLoader:URLLoader = new URLLoader;
varSend.method = URLRequestMethod.POST;
varSend.data = variables;

submit.addEventListener(MouseEvent.CLICK, sendActions, false, 0, true);

function sendActions(event:MouseEvent):void
{
	if (contact_name.text == "" || contact_fromEmail.text == "" || contact_subject.text == "" || contact_message.text == "" )
	{
		contact_status.text = "You must fill in all of the fields to proceed";
	}
	else
	{
		variables.toEmail = contact_toEmail.text;
		variables.fullName = contact_name.text;
		variables.email = contact_fromEmail.text;
		variables.subject = contact_subject.text;
		variables.message = contact_message.text;
		varLoader.load(varSend);
		play();// playhead will move forward to the stop action on frame label "submit".
	}
}

// tabIndex

contact_name.tabIndex = 1;
contact_fromEmail.tabIndex = 2;
contact_subject.tabIndex = 3;
contact_message.tabIndex = 4;
submit.tabIndex = 5;

```

I can’t imagine that there’s anything wrong in here…
