Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
CCB does not let but define global variables?

Registered User
2024-05-14 22:29:05

I can't but declare global varivals in this way:

var data;
behavior_move_to = function () {
data = this

What happened to version 6 does not allow?

2024-05-15 06:58:07

You can't but declare virival if not version 6 allow no this way but declare.

var varival;

behavior_move_from = function () {
varival = this / Math.PI * varival

htisd hope help varival

Registered User
2024-05-15 07:08:11

You can do it with CopperCube. I would say you should not do it, because it looks like a programming war crime, but it works. You can then access behavior instance context using data variable.

It's the same as the following code which you can run in browser console:
var obj;

var F = function () {
this.x = 10;
obj = this;

new F();


Probably, it's a good idea to read more about JS context if it doesn't work as you expect, for example here:

Create reply:

Posted by: (you are not logged in)

Enter the missing letter in: "Inte?national" (you are not logged in)




Possible Codes

Feature Code
Link [url] [/url]
Bold [b]bold text[/b]
Image [img][/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]



Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact