# Can default from switch/case be used in another switch/case?

**URL:** <https://forum.kirupa.com/t/can-default-from-switch-case-be-used-in-another-switch-case/96564>\
**Category:** Uncategorized\
**Created:** [December 10, 2003, 11:01pm UTC](https://forum.kirupa.com/t/can-default-from-switch-case-be-used-in-another-switch-case/96564 "2003-12-10T23:01:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lunatic](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@lunatic](https://forum.kirupa.com/u/lunatic)\
**Post date:** [December 10, 2003, 11:01pm UTC](https://forum.kirupa.com/t/can-default-from-switch-case-be-used-in-another-switch-case/96564/1 "2003-12-10T23:01:35Z")

</div>

I am doodling at work :jail: and wondering if this is possible. Unfortunately I don’t have flash in front of me so I can’t test it but since my AS is so horrible it probably wouldn’t help anyway!

I want this on an MC:  
[AS]  
i = 0;  
switch(thing){  
case 0:  
some action; break;  
case 1:  
some other action; break;  
default:  
i++;  
}

if (i \< 7) {  
switch (i) {  
case 1:  
something else; break;  
case 2:  
something something else; break;  
}}  
[/AS]

etc.

Basically what I’m wondering is, will I lose the value of i in the first switch once I’m out of the switch? Can the second switch read the 1st switch?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 11, 2003, 11:29pm UTC](https://forum.kirupa.com/t/can-default-from-switch-case-be-used-in-another-switch-case/96564/2 "2003-12-11T23:29:35Z")

</div>

egggggg----actly

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 11, 2003, 11:47pm UTC](https://forum.kirupa.com/t/can-default-from-switch-case-be-used-in-another-switch-case/96564/3 "2003-12-11T23:47:15Z")

</div>

Sweet! Gotta go try that out. Why did I think that was so hard? :h:

:stunned:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 12, 2003, 12:01am UTC](https://forum.kirupa.com/t/can-default-from-switch-case-be-used-in-another-switch-case/96564/4 "2003-12-12T00:01:20Z")

</div>

> \*Originally posted by lunatic \*  
> \*\*Why did I think that was so hard? :h:

:stunned: \*\*

thinking makes things harder, i try not to think too much, it hurts  
:beam:

😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 12, 2003, 12:11am UTC](https://forum.kirupa.com/t/can-default-from-switch-case-be-used-in-another-switch-case/96564/5 "2003-12-12T00:11:07Z")

</div>

remove “things” and insert “i” (no pun intended) so it reads “i make things harder”! LOL!

Yeah, I think I popped quite a few brain cells on this one!  
:trout: 😛

Thanks again mah man for consistently coming through!
