# Flash Sample Package screws up code?

**URL:** <https://forum.kirupa.com/t/flash-sample-package-screws-up-code/247294>\
**Category:** flash\
**Created:** [December 20, 2007, 9:08pm UTC](https://forum.kirupa.com/t/flash-sample-package-screws-up-code/247294 "2007-12-20T21:08:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iceflyin](https://avatars.discourse-cdn.com/v4/letter/i/9de053/32.png) [@iceflyin](https://forum.kirupa.com/u/iceflyin)\
**Post date:** [December 20, 2007, 9:08pm UTC](https://forum.kirupa.com/t/flash-sample-package-screws-up-code/247294/1 "2007-12-20T21:08:31Z")

</div>

Whenever I try out any of the livedoc examples, it screws up my other code somehow.

This works by itself… Buttt… Not with my other code far below.  
The error codes:

1046: Type was not found or was not a compile-time constant: Responder.  
1180: Call to a possibly undefined method Responder.

[http://livedocs.adobe.com/livecycle/es/sdkHelp/common/langref/flash/ui/ContextMenuItem.html](http://livedocs.adobe.com/livecycle/es/sdkHelp/common/langref/flash/ui/ContextMenuItem.html)

```auto

package {
    import flash.ui.ContextMenu;
    import flash.ui.ContextMenuItem;
    import flash.ui.ContextMenuBuiltInItems;
    import flash.display.MovieClip;
    import flash.text.TextField;

    public class ContextMenuItemExample extends MovieClip {
        private var myContextMenu:ContextMenu;

        public function ContextMenuItemExample() {
            myContextMenu = new ContextMenu();
            removeDefaultItems();
            addCustomMenuItems();
            this.contextMenu = myContextMenu;
            addChild(createLabel());
        }

        private function removeDefaultItems():void {
            myContextMenu.hideBuiltInItems();

            var defaultItems:ContextMenuBuiltInItems = myContextMenu.builtInItems;
            defaultItems.print = true;
        }

        private function addCustomMenuItems():void {
            var item:ContextMenuItem = new ContextMenuItem("Hello World");
            myContextMenu.customItems.push(item);
        }
        
        private function createLabel():TextField {
            var txtField:TextField = new TextField();
            txtField.text = "Right Click Here";
            return txtField;
        }
    }
}

```

It won’t work with this code on my main timeline:

```auto

import RemotingService;
//var userid = root.loaderInfo.parameters.userid;
var userid = "19717633";
useridText.appendText(userid);
var Handler:Responder = new Responder(onResult);
var rs = new RemotingService("http://www. **********.com/flashAccess/gateway.php");
rs.call("flashyrss.Load", Handler, userid);
function onResult(result:Object) {
        var titleArray = result.feedTitles.split(",");
        var urlArray = result.feedURLs.split(",");
        for (var i=0; i<=titleArray.length-1; i++) {
            var titleVar = "Title"+i;
            var urlVar = "URL"+i;
            this[titleVar].text=titleArray*;
            this[urlVar].text=urlArray*;
    }
}

```

The remoting service AS:

```auto

package {
    import flash.net.NetConnection;
    import flash.net.ObjectEncoding;
    public class RemotingService extends NetConnection {
        function RemotingService(url:String) {
            // Set AMF version for AMFPHP
            objectEncoding = ObjectEncoding.AMF0;
            // Connect to gateway
            connect(url);
        }
    }
}

```
