5 Replies Latest reply on Mar 27, 2008 5:25 AM by kdennis4

    MIssing something to add a record

      I am using Flex 3 and do not have the documentation or any references books to refer to. I am including my code below if someone could please let me know what I'm missing:

      Within the <mx:script>

      public var objUser:creativeUser;

      private function addNewUser():void{
      var i:int;
      objUser = new creativeUser;
      objUser.newLogin = newUserLogin;
      objUser.newPassword = newUserPassword;


      Within Remote Object id = creativeLogin, source=to CFC, and a method = addNewUser.

      My submit button has click="addNewUser()"

      I would greatly appreciate any feedback. My errors state:
      Type was not found or was not a compile-time constant: creativeUser
      Call to a possibly undefined method creativeUser

      Thanks so much!
        • 1. MIssing something to add a record
          kdennis4 Level 1
          I used a reference by Ray Camden and it compiles fine now .... However, I'm getting a different error outside of Flex in the browser when I hit submit I get an error:

          [MessagingError message='Destination 'ColdFusion' either does not exist or the destination has no channels defined (and the application does not define any default channels.)']


          Couldn't establish a connection to 'ColdFusion'

          Any help with this issue would be greatly appreciated! Thanks!
          • 2. MIssing something to add a record
            levancho Level 3
            new creativeUser; missing brackets, --> new creativeUser();


            you have to configure flex project to use blazeds service and then setup a web server (most likely tomcat) to host blazeds , and after that flexbuilder will bake service configuration into swf file.

            • 3. Re: MIssing something to add a record
              kdennis4 Level 1
              I noticed some other posts about have the services-config.xml, but I only have flex-config.xml. I did a complete search of my computer to make sure that it wasn't somewhere that I could copy it into the correct folder. Does anyone know if this is a Flex 3 issue or does anyone have any suggestions on what I can do. It seems as if this is my issue, but not sure. Thanks again!
              • 4. Re: MIssing something to add a record
                Garyl Woolworth Level 1
                services-config.xml is a file that you create and compile into your flex application. This doesn't necessarily mean that you use blazeds. Coldfusion has built in gateways to talk to Flex. An example of the services-config.xml file is as follows. Notice the destination id="ColdFusion"

                <?xml version="1.0" encoding="UTF-8"?>

                <service id="coldfusion-flashremoting-service"

                <adapter-definition id="cf-object" class="coldfusion.flash.messaging.ColdFusionAdapter" default="true"/>

                <destination id="ColdFusion">
                <channel ref="my-cfamf"/>
                <!-- define the resolution rules and access level of the cfc being invoked -->
                <!-- Use the ColdFusion mappings to find CFCs, by default only CFC files under your webroot can be found. -->
                <!-- allow "public and remote" or just "remote" methods to be invoked -->

                <!-- cfc property names -->
                <!-- Query column names -->
                <!-- struct keys -->


                <channel-definition id="my-cfamf" class="mx.messaging.channels.AMFChannel">
                <endpoint uri=" http://{server.name}:{server.port}{context.root}/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>

                <target class="flex.messaging.log.ConsoleTarget" level="Error">
                <prefix>[Flex] </prefix>


                • 5. Re: MIssing something to add a record
                  kdennis4 Level 1
                  I've got the -services-config.xml properly set up now within Flex, but now I'm getting these errors:

                  Send failed - then I hit "OK"

                  Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 405: url: ' http://mySite.com/flex2gateway/'

                  I read some pasts posts about setting up the correct port... localhost:8500? Not sure if it's set that way or how to reset it if this is the issue that's causing the errors. Thanks again for any comments and help.