I've recently decided that I should post more tips and tricks on this blog. I get a lot of emails and also answer questions on mailing lists that contain information that may be hard to track down (or in the case of email replies impossible) and would be better posted publicly on a blog. Here's one I'd like to start with.

Question: I have been trying to use your tutorial on the NetStream.send function and am getting frustrated. I have been researching this for the past couple of days and not finding any answers.

I am trying to use a button event to have the user recording the video dynamically set a cue point:

view plain
1nsOut.send("swapPage", thePage);
Then during playback of the video at a later time I am calling this:
view plain
1ns.swapPage = function(thePage)...
I can't even get this to publish as the compiler gives me the following error:
1119: Access of possibly undefined property swapPage through a reference with static type flash.net:NetStream.
If this is way beyond a simple solution just say so and I'll keep digging on the internet. I was just hoping that with your experience you might see some obvious mistake I am making and be able to help.

My reply to this was:
Your code seems to be AS3.
You can no longer add functions dynamically to NetStream in AS3, therefore this won't work:

view plain
1nsOut.swapPage = function() [...]
Instead you need to specify a client property (this can be any class/object) for NetStream and then define the function there. For example in your current code you could do:
view plain
1// whereever you create the NS instance
2nsOut = new NetStream(nc);
3ns.client = this; // point the client property at 'this' class, the one we are in
then somewhere in the same class:
view plain
1public function swapPage(params):void
3 // do your thing...
This should take care of your problem.