Integrating Flex Component Into Fusebox App: Part 1

DISCLAIMER: This post is more of me working out a solution than an informative post but I figured that someone may be able to get something out of this and the follow-up post when I finally figure this out.

Im working on a project right now that needed a photoviewer component and after looking over the requirement of the viewer, I realized right away that there were no “off-the-shelf” products that I could used so we made the decision to build the component using Flex.

The photoviewer component is working wonderfully in a standalone dev environment but when I try to call the swf into a display page of the Fusebox5 application, things start to come undone.

Basically the Flex component calls a remote method of a cfc that already exists within the application. Then uses the data returned to pull in the images and allow the users scroll through them. When the page loads, I can see the movie initialize and I can see the links that are built-into the movie for scrolling but none of the images will load. When I click on the “next” link to switch images, I get an error telling me tha the value of the object is NULL.

Now I know there are records that should be pulled by the CFC. So Im wondering, is the pathing wrong on the CFC call within the Flex component. It seems that if the component cannot be found it would throw an error but Im not sure if thats the case or not.

Is the path to the cfc relevant to the swf or the calling application?

Example:
My folder structure would look similar to this:

-com
   -cfc
-controller
   -display
-view
   -display

The Flex component lives in the view/display folder and thats where the file that calls it lives as well. Of course the circuit.xml.cfm in the controller/display folder is putting all of this together.

The code in my Flex component that calls the CFC looks like this:


Should the “source” attribute be relevant to the location of the swf instead of the calling application? How would you denote a path going backwards from the view/display folder to the com/cfc folder if that was the case?

Im also wondering, how do you go about developing Flex components that will be called from another application? There are alot more factors to consider in this case than with a standalone Flex application.

2 thoughts on “Integrating Flex Component Into Fusebox App: Part 1”

  1. No, it should not be swf relevant. it needs to be webroot relevant, as with any usage of a ColdFusion CFC. I would recommend doing a call to it and running a breakpoint (via debug) to trace into the object and see if what your looking for is actually returned.

    Perhaps, test the remote method as a webservice call as well to see if it works as expected.

  2. Thanks Derek.

    I found that the component is actually being found. So Im going to call the method as a webservice to see ‘exactly’ what Im getting back. The saga continues…

Leave a Reply

Your email address will not be published. Required fields are marked *


*