You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

benji33

Intermediate

  • "benji33" started this thread

Posts: 244

Location: France

Occupation: Senior Software engineer

  • Send private message

1

Tuesday, August 8th 2017, 10:48am

Operator Flash versus HTML5

I've tried to use an undefined variable call myVar and to test it's value.
Here are my results with 1.19pr10 with no test which work on HTML5 and Flash at the same time. Before Flash player was working with myVar === null but not on the pr10.

1) === null

trace("before");
if(myVar === null,
trace("done");
);
trace("after");

Console HTML5
before
done
after

Console Flash
before
after

Note: doesn't work even with <krpano strict="true"></krpano> attribute.

2) == null

trace("before");
if(myVar == null,
trace("done");
);
trace("after");

Console HTML5
before
after

Console Flash
before
after

3) === undefined

trace("before");
if(myVar === undefined,
trace("done");
);
trace("after");

Console HTML5
before
done
after

Console Flash
before
after

4) == undefined

trace("before");
if(myVar == undefined,
trace("done");
);
trace("after");

Console HTML5
before
after

Console Flash
before
done
after

5) === "undefined"

trace("before");
if(myVar === "undefined",
trace("done");
);
trace("after");

Console HTML5
before
after

Console Flash
before
done
after

6) == "undefined"

trace("before");
if(myVar == "undefined",
trace("done");
);
trace("after");

Console HTML5
before
after

Console Flash
before
done
after

This post has been edited 1 times, last edit by "benji33" (Aug 8th 2017, 10:58am)


2

Tuesday, August 8th 2017, 12:46pm

Hi,

I can't reproduce this case:
trace("before");
if(myVar === null,
trace("done");
);
trace("after");

Console HTML5
before
done
after

Console Flash
before
after
I'm getting the same results in Flash and HTML5: before - done - after.
And there were no changes here in the recent releases...

Best regards,
Klaus

benji33

Intermediate

  • "benji33" started this thread

Posts: 244

Location: France

Occupation: Senior Software engineer

  • Send private message

3

Wednesday, September 13th 2017, 3:43pm

OK I've found the issue. My test is on a variable declared into the embed code with

Source code

1
,vars:{myVar:value}
.

In this case if the value is not defined the result of myVar is null and the operator comparison fails as said above. Not a common case :)