2 Replies Latest reply on Sep 6, 2007 2:28 PM by ashar2005

    coldfusion and flex intergration

      hi guys i was trying out a tutorial of coldfusion and flex intergration but i keep geting errors. here is my code please direct me on what to do.

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns="*" layout="absolute" creationComplete="InitApp()">

      public function InitApp(): void
      <mx:RemoteObject id="artSvc" destination="ArtCatalog" source="websoft.artcatalog.art" showBusyCursor="true" />
      <mx:VBox x="199" y="373" width="100%" height="100%" horizontalCenter="0" paddingLeft="0" paddingRight="0" top="0">
      <mx:FormItem label="Artist:">
      <mx:ComboBox id="artistsCB" dataProvider="{artSvc.GetArtists.result}" width="150" change="{artSvc.GetArt(artistsCB.selectedItem.data)}"/>
      <mx:HBox width="100%" height="100%">
      <mx:DataGrid width="100%" height="100%" id="artGrid" dataProvider="{artSvc.GetArt.result}">
      <mx:DataGridColumn headerText="Name" dataField="artname"/>
      <mx:DataGridColumn headerText="Description" dataField="description"/>
      <mx:DataGridColumn headerText="Sold" dataField="issold"/>
      <mx:DataGridColumn headerText="Price" dataField="price"/>
      <mx:Panel title="{artGrid.selectedItem.artname}">
      <mx:Image height="200" width="200" source="{artGrid.selectedItem.image }" />


      <!--- Get artists --->
      <cffunction name="GetArtists" access="remote" returntype="query" output="false">

      <cfset var artists="">
      <cfset var result="">

      <cfquery datasource="cfcodeexplorer" name="artists">
      SELECT lastname, firstname,
      FROM artists
      ORDER BY lastname, firstname
      <cfquery dbtype="query" name="results">
      SELECT firstname AS label, artistid AS data
      FROM artists
      ORDER BY label

      <cfreturn results>


      <!--- Get art for specified artist --->
      <cffunction name="GetArt" access="remote" returntype="query" output="false">
      <cfargument name="artistid" type="numeric" required="yes">

      <cfset var art="">
      <cfset var result="">

      <cfquery datasource="cfcodeexplorer" name="art">
      SELECT artid, artname, description, issold,
      largeimage, mediaid, price
      FROM art
      WHERE artistid=<cfqueryparam value="#ARGUMENTS.artistid#"
      ORDER BY artname
      <cfquery dbtype="query" name="results">
      SELECT artid, artname, description, issold,
      ' http://localhost:8501/cfide/gettingstarted/tutorial/images/' + largeimage AS image,
      mediaid, price
      FROM art
      ORDER BY artname

      <cfreturn results>



      <?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 -->

      <destination id="ArtCatalog">
      <channel ref="my-cfamf"/>


      <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>



        • 1. Re: coldfusion and flex intergration
          stinasius Level 1
          hey guys i hope i am not making you crazy with my problems. i am new to flex and i am trying to use coldfusion 8 with flex 2 builder to develop some applications and even to try out some of the flex samples like phone selector but i keep getting the same actionscript errors. i serious dont know what to do.can a good samaritan please look at this error and prescribe a solution that will work for me?Note: i have to coldfusion versions mx 7 and 8 running on my system and cf8 uses port 8501 and mx7 uses 8500.please guys here is the error i keep getting and i am almost giving up on flex.Help!!!!!!!!! please help!!!!!!!!!!!!!

          "actionscript error"
          VerifyError: Error #1053: Illegal override of subtopic in mx.messaging.Consumer.
          at flash.display::MovieClip/nextFrame()
          at mx.managers::SystemManager/::deferredNextFrame()
          at mx.managers::SystemManager/::preloader_initProgressHandler()
          at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
          at flash.events::EventDispatcher/dispatchEvent()
          at mx.preloaders::Preloader/::timerHandler()
          at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
          at flash.utils::Timer/flash.utils:Timer::tick()
          TypeError: Error #1009: Cannot access a property or method of a null object reference.
          at mx.managers::SystemManager/::docFrameHandler()
          • 2. Re: coldfusion and flex intergration
            If you are not actually using messaging (producer/consumer) stuff, you can get rid of that
            problem by going to your project properties and in the Library paths, remove the line referring
            to fds.swc.

            If you ARE actually using messaging, you may get another issue, "FlexClient support" similar to what I am dealing with.