# \[CS3-AS2\] Preventing stupid user tricks

**URL:** <https://forum.kirupa.com/t/cs3-as2-preventing-stupid-user-tricks/280886>\
**Category:** flash\
**Created:** [February 2, 2009, 5:48pm UTC](https://forum.kirupa.com/t/cs3-as2-preventing-stupid-user-tricks/280886 "2009-02-02T17:48:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimbaker](https://avatars.discourse-cdn.com/v4/letter/j/97f17d/32.png) [@jimbaker](https://forum.kirupa.com/u/jimbaker)\
**Post date:** [February 2, 2009, 5:48pm UTC](https://forum.kirupa.com/t/cs3-as2-preventing-stupid-user-tricks/280886/1 "2009-02-02T17:48:29Z")

</div>

Having been a stupid user myself for years I would like to prevent those using the flash video recorder I’m working on from having an opportunity to make the kind of mistake I know I would have made a year ago.

I have a tutorial video on my web site that demonstrates how to use the recorder BUT I know many won’t take the time to watch it. Probably the most important point I make in the tutorial is to instruct them to click “LogOff” to disconnect from the rtmp server when they have finished making a recording. If they don’t, the session on the server won’t terminate properly. So this is more of a design concept question.

I think I should add an “ExternalInterface.addCallback” to the SWF and a javascript function to my HTML page that will send a call to the routine in the SWF that handles connecting and disconnecting from the server. I think I can attach that function to the “Submit Button” of a form on the web page.

Questions:

1.Is this a sound approach or is there a better one?

1. Can I add the call for the javascript function to the ACTION element of the form and then have it call my php mail routine after the disconnect?

2. In the example I found on Adobe’s web Site the AS2 code sends a return to the javascript function. I don’t see a need to do that. is it required?

Any insight will help me keep from shooting myself in the foot.

Regards - Jim
