# Is this a bug?

**URL:** <https://forum.kirupa.com/t/is-this-a-bug/188244>\
**Category:** Uncategorized\
**Created:** [May 5, 2006, 5:37pm UTC](https://forum.kirupa.com/t/is-this-a-bug/188244 "2006-05-05T17:37:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Techmaniac](https://avatars.discourse-cdn.com/v4/letter/t/dbc845/32.png) [@Techmaniac](https://forum.kirupa.com/u/Techmaniac)\
**Post date:** [May 5, 2006, 5:37pm UTC](https://forum.kirupa.com/t/is-this-a-bug/188244/1 "2006-05-05T17:37:02Z")

</div>

I’m trying to use the Yahoo maps component. The component takes the address var, and the marker var and creates a map for the address. So I have placed a SWITCH into the code for multiple locations. The location gets passed thru from the instance, and based on that is which address/marker variables to send thru. FLASH keeps telling me it’s expecting a closing ), when there clearly is one.

**CODE:**  
onClipEvent(load) {  
import com.yahoo.maps.tools.PanTool;  
import com.yahoo.maps.markers.CustomPOIMarker;  
ffx\_ym.addEventListener(com.yahoo.maps.api.flash.YahooMap.EVENT\_INITIALIZE,onInitMap);

```
function onInitMap(eventData) {     
      var panTool = new PanTool();     
      ffx_ym.addTool(panTool, true);
        switch(location){
            case "fairfax":
                var address = "9701 Main Street, Fairfax, VA";
                var myMarker = (index: 'A', title:'Fairfax Branch', description:'24 Hour ATM', markerColor:0xAF2F36, strokeColor:0xA4B09A);
                break;
            case "herndon":
                var address = "905 Alabama Avenue, Herndon, VA";
                var myMarker = (index: 'A', title:'Herndon Branch', description:'24 Hour ATM', markerColor:0xAF2F36, strokeColor:0xA4B09A);
                break;
            case "mannassas":
                var address = "8745 Mathis Avenue, Mannassas, VA";
                var myMarker = (index: 'A', title:'Mannassas Branch', description:'Business Hours ATM', markerColor:0xAF2F36, strokeColor:0xA4B09A);
                break;
            case "centreville":
                var address = "13860E Braddock Road, Centreville, VA";
                var myMarker = (index: 'A', title:'Centreville Branch', description:'24 Hour ATM', markerColor:0xAF2F36, strokeColor:0xA4B09A);
                break;
    }
      ffx_ym.setCenterByAddress(address, 0);    
      ffx_ym.addMarkerByAddress(CustomPOIMarker, address, myMarker);
}

```

}  
So why is it giving me these errors:

[COLOR=Red]\ ***Error** Scene=Scene 1, layer=Y! map, frame=2:Line 12: ‘)’ expected  
var myMarker = (index: ‘A’, title:‘Fairfax Branch’, description:‘24 Hour ATM’, markerColor:0xAF2F36, strokeColor:0xA4B09A);

**Error** Scene=Scene 1, layer=Y! map, frame=2:Line 14: ‘case’ statements can only be used inside of a ‘switch’ statement  
case “herndon”:

**Error** Scene=Scene 1, layer=Y! map, frame=2:Line 15: Statement must appear within on/onClipEvent handler  
var address = “905 Alabama Avenue, Herndon, VA”;

**Error** Scene=Scene 1, layer=Y! map, frame=2:Line 16: ‘)’ expected  
var myMarker = (index: ‘A’, title:‘Herndon Branch’, description:‘24 Hour ATM’, markerColor:0xAF2F36, strokeColor:0xA4B09A);

Total ActionScript Errors: 4 Reported Errors: 4

\*[/COLOR]
