Viewing By Entry / Main
August 20, 2005
thou shall not....
use illegal ActionScript (AS) in flash forms. i'm posting this as it might save someone else time and frustration. in order to keep a lid on how wild you can get w/the super cool flash forms in cf7 there are certain AS keywords which you aren't allowed to use (in any way, shape or form):

  • __proto__
  • import
  • createTextField
  • loadMovie
  • attachMovie
  • Delete
  • New
  • createChild
  • duplicateMovieClip
  • registerClass

this is all documented in Creating Forms in Macromedia Flash/Using ActionScript in Flash forms section of cfdocs. but what the docs aren't saying is that you can potentially use AS in some (to me) strange places. two of the strangest places are in alert message text and tooltips. the tooltips nearly drove me mad trying to figure out why i was getting illegal AS errors in my flash form when none of my injected AS was using any of the restricted keywords. it turns out i had a couple of buttons with the seemingly innocent "delete" word in their tooltips.

so, pay attention. if you're getting seemingly insane illegal AS errors, look to your tooltips and/or your alert messages instead of head-butting your monitor (or bombarding mike nimer with emails).

update: look to your injected ActionScript comments as well.

Comments

I posted about this on my blog a while back. I havent had a chance to revisit it yet, but my problem was the word new in a tooltip. There must be some way to escape the word somehow, Im wondering if dynamically placing the word or some sort of out of the box way we could make it work. Let me know if you find a workaround.


no, there's no way that i can see to get around this. making it dynamic via a cf var, escaping it w/single quotes, double quotes, etc. all fail.


Here's a fix.

To get an alert message to say "New record added", I had to break up "New" into pieces. Like this mx.controls.Alert.show('N'+'ew'+' record added.','Alert');

Let me know if this works in tool tips. I haven't tested that yet.