You are not logged in.

1

Friday, June 1st 2012, 11:15am

pop into a non-defined variable

In the Flash viewer, you cannot use the pop() method to populate a previously undeclared variable or property, whereas in the HTML5 viewer you can. Consider the following code:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
	set(test1, "hello world!");
	push(test1);

	pop(test2);
	trace(get(test2));

		
	set(test1, "hello again!");
	push(test1);

	set(test3,);
	pop(test3);
	trace(get(test3));

In the Flash viewer, test2 remains null. Only if the variable is first declared (even as a null variable) the pop method actually populates the variable. In the HTML 5 viewer, both tests work.
http://files.fieldofview.com/temp/krpano/stack

I'm not sure if this is a bug, but at least it is an inconsistency between the Flash viewer and the HTML5 viewer. In any case I am leaving this here in case someone's trying to find out why popping a variable isn't working the way it is in the HTML5 viewer.

2

Friday, June 1st 2012, 7:55pm

Hi,

thanks for this hint!
That different behavior wasn't intended of course .

It in the final 1.0.8.15 release (and already here in pre-release 3) it will be fixed and then pop() can create variables in both versions.

Best regards,
Klaus

Similar threads