# Object property from XML behaves erratically in switch statement

**URL:** https://forum.kirupa.com/t/object-property-from-xml-behaves-erratically-in-switch-statement/318374
**Category:** flash
**Created:** [January 18, 2011, 1:07pm UTC](https://forum.kirupa.com/t/object-property-from-xml-behaves-erratically-in-switch-statement/318374 "2011-01-18T13:07:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Shaedo](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Shaedo](https://forum.kirupa.com/u/Shaedo)
#### Post date: [January 18, 2011, 1:07pm UTC](https://forum.kirupa.com/t/object-property-from-xml-behaves-erratically-in-switch-statement/318374/1 "2011-01-18T13:07:51Z")

</div>

Hi,

I’ll start by saying I don’t expect and answer to this but I am **really** curious if someone else has encountered it or knows what the friggle is going on or just has some thoughts on the matter:

Sequence of events:  
2 SWFs running entirely seperately  
load the same library class then load the same XML and save an attribute as a property (PS) of an Object (ob)

It’s then parsed through a switch statement like this:

```php
switch(String(ob.PS))
{
	case 'TW':
	d='ThumbsW/';
	break;
	case 'TH':
	d='ThumbsH/';
	break;
//...... etc

```

So the classes are idential in both situations, only the loading swf changes.

In one case it needs ob.PS to be typed as a string (as shown - else it drops to the default).  
In the other case it does NOT need ob.PS to be typed as a string!!  
Same class, same switch statement, parsing same data (loaded from XML) yet behaving very differently!

Any ideas?  
Thanks for your consideration,

S.
