VideoError example syntax error

Hi.

Can someone help me out with this:

I took the following exapmle from the Adobe site, but when I run it I get the following error:

1084: Syntax error: expecting identifier before assign.

It says this is the offending line:

VideoPlayer.netStreamClientClass = null;

Code is as follows:

// Place the FLVPlayback component on the Stage at 0,0 and provide the instance name myflvPlayback.
import fl.video.
VideoPlayer.netStreamClientClass = null;
try {
myflvPlayback.play(‘test.flv’);
} catch (e:VideoError) {
if (e.code =VideoError.NETSTREAM_CLIENT_CLASS_UNSET) {
trace(‘I forced this error on purpose’);
}
}

Any help would be great… i’m a total newbie.

John

these two lines are incorrect:

import fl.video.
VideoPlayer.netStreamClientClass = null;

It should be:

import fl.video.*; // <- the problem was here actually
VideoPlayer.netStreamClientClass = null;

Thanks for your reply.

I made the change, but now it’s giving me the following error for this line:

if (e.code =VideoError.NETSTREAM_CLIENT_CLASS_UNSET) {

1059: Property is read only.

Ahhhhhhh, it needed to be as follows:

if (e.code == VideoError.NETSTREAM_CLIENT_CLASS_UNSET) {

Thanks again for your help!

John

you’re welcome :wink: