Forum Moderators: open

Message Too Old, No Replies

Flash CS3 "strict" ActionScript

None of my ActionScript works in "strict"

         

rocknbil

6:05 pm on Jan 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've just stepped up to CS3 and am grappling with a problem in Flash: why doesn't my ActionScript work in strict? All of the samples in the help files are coded this way, and I feel like I'm missing something.

Here's an example. Most of the code you see on the web for importing external video is as follows:

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
my_video.attachVideo(ns);
ns.play("sample.flv");

Which I cannot get to work. However, this works fine:

var nc = new NetConnection();
nc.connect(null);
var ns = new NetStream(nc);
my_video.attachVideo(ns);
ns.play("sample.flv");

Another example, from the CS3 help files:

function pauseHandler(event:MouseEvent):void
{
ns.pause();
}

Always returns an error, I have to remove :void:
function pauseHandler(event:MouseEvent)
{
ns.pause();
}

The above is true for testing within Flash or in deployed files. I spent hours figuring out why my samples don't work, now if I could understand the why behind the why . . . . :-)

rocknbil

7:44 pm on Feb 27, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



One more try.

daperson0

10:23 pm on Feb 28, 2008 (gmt 0)

10+ Year Member



I have no idea, sorry.