Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Referencing a script object in another script object

Avatar

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
shawnFMU
Level 1

10-07-2018

Can I reference another script object in a script object? All script objects would be under the same Variables hierarchy.

I have a dropdown field.

In the 'exit' event, the first reference:

DropExit.Exit1(this);

In the DropExit script object:

function Exit1(current)

{

if(Drop.rawValue =="1")

{Color1.presence = "visible";} else {Color1.presence = "invisible";}

if(Drop.rawValue =="2")

{Color2.presence = "visible";} else {Color2.presence = "invisible";}

}

No problems!

But, I would like to do something like this:

function Exit1(current)

{

If(Drop.rawValue == "1")

Selection.S1(this);

If(Drop.rawValue == "2")

Selection.S2(this);

}

then I would have another script object,

Selection script object:

function S1(current)

{

{Color1.presence = "visible";} else {Color1.presence = "invisible";}

{

function S2(current)

{

{Color2.presence = "visible";} else {Color2.presence = "invisible";}

}

in my little mind, this seems like it would work... is it possible?

Thank you in advance!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
MinusZero
Level 4

10-07-2018

I would think if you have multiple script objects you might need to be more specific with it's reference.

For Example:

1525502_pastedImage_1.png

If i was working in my script object vars but wanted to access my function in moreVars, it would be referenced like this:

moreVars.profileCount();

I dont know if thats what you were after.

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct Reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
MinusZero
Level 4

11-07-2018

Happy to help LCD Rules!

Avatar

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 10
Level 1
shawnFMU
Level 1

Like

1 like

Total Posts

38 posts

Correct Reply

1 solution
Top badges earned
Validate 10
Validate 1
Boost 1
Affirm 1
View profile
shawnFMU
Level 1

11-07-2018

Brilliant! This is exactly what I need!

Thank you!