38

I'm having a problem with Flash Forms on ColdFusion 9 that worked perfectly under ColdFusion 8. When viewing the flash form in the browser, the form elements themselves display correctly, but the data for each field is not rendered in the input elements, and not present when submitting the form. When the page loads, I get an error:

964024021.mxml.cfswf:1 ReferenceError: Can't find variable: updateHiddenValue

The function updateHiddenValue is a function that's defined in /CFIDE/scripts/cfform.js, which is getting loaded into the page. If I use the Console and run the function directly, it runs without a problem:

enter image description here

To try and figure out why this might be happening, I fired up Charles and watched the requests to the server. As you can see in the screenshot below, the .js files receive 200 responses showing that they're good to go, but the cfswf requests are getting "connection closed" errors, and then 200 requests. The cfswf requests are obviously finishing correctly, or I wouldn't see the flash form at all.

enter image description here

So I need to figure out why I'm getting these .js errors so I can get this flash form workng. I can only assume that the error is originating from the flash side of things or via Flash Remoting (?), I just have no idea how to debug this issue and get things moving forward.

Dan Short
  • 9,598
  • 2
  • 28
  • 53
  • 1
    Looks like it is called once unsuccessfully then called successfully. .cfswf files would be the actual compiled Flash file right? Not a call to a CFC. Where's the js file that includes the updateHiddenContent() function? – Mark A Kruger Aug 28 '12 at 12:43
  • `cfform.js` is the one that contains that function, which is third in the list of requested files. – Dan Short Aug 28 '12 at 12:55
  • seems like a sync problem. have you tried adjusting the cache for the cfswf files? Maybe they need to recompile each time. There's an attribute setting I think. – Mark A Kruger Aug 28 '12 at 13:07
  • I've not seen a flip to switch for that one, but I'll do some digging. As it stands, I always get a 200 for the cfswf files, and not a 304. So it's doing a new request. I just need to verify that it's generating a new swf file I guess. – Dan Short Aug 28 '12 at 14:01
  • I'm trying to remember. We did a flash form app about 5 years ago (cf7 or 8) and we were not happy with the results so we have avoided using them. – Mark A Kruger Aug 28 '12 at 14:06
  • Yeah, I may end up rewriting this with jQuery. This app was build more than 5 years ago, and has survived transitions from CFMX up to 8. It's gotten a little long in the tooth, and probably needs to be reworked anyway. Just trying not to rewrite any more than necessary. Was hoping I was missing something easy. – Dan Short Aug 28 '12 at 15:03
  • 3
    Dan are you getting this with ANY Flash Form, or just this specific one? If it's "any form", can you post a self-contained repro case for us to look @ and dissect. – Adam Cameron Nov 03 '12 at 08:47
  • I'm not getting any flash forms from the server at all. – Dan Short Nov 26 '12 at 15:01
  • What version of Flash are you using? What browsers are you using on the working and non working versions? – James A Mohler Dec 04 '12 at 23:36
  • Can you show the javascript where you call the function? It looks from the error like you are accessing it as a variable instead of a function. – Kevin Dec 10 '12 at 19:15
  • That's just it. I'm not calling it. This is something built in to ColdFusion's flash forms, and it's failing on load. The function will execute in the console, but no via the default CF code execution. – Dan Short Dec 11 '12 at 20:27
  • 4
    I know this is completely non-constructive but please... for the love of Pete. Please stop using flash forms people. They cause more havoc then they solve. – Dave Ferguson Jul 10 '13 at 17:07
  • @DaveFerguson I already did :). That's what I get for having 8 year old apps on my server :) – Dan Short Jul 11 '13 at 13:37

2 Answers2

2

I occurred with the same error while i was developing one application . You might be declaring some other script before this which will bring conflict . Comment all others and try again . Mine was resolved by doing this hit an trial method . I commented all scripts run my application , it worked out .

0

The script tag which references cfform.js is probably loading after the object tag that references the swf. Check the order by viewing source the browser to verify. Use mm.cfg with Vizzy and a debug player to see what events are happening on the Flash side. Here's some other resources which may help troubleshoot:

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265