question

David Seo avatar image
0 Likes"
David Seo asked Joerg Vogel commented

What's the meaning of as(Object) ?

I want to know the meaning of as(Object) attribute or command?

The example scripts are followed;

1) current.subnodes[index].as(Object).color

2) token.resource.as(Object).centerObjects[1]

What's the as(Object) meaning?

I can't find the description of as() in the manual?

FlexSim 18.1.1
as attributeasas command
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Joerg Vogel commented

The command is the explicit casting of values or classes. The command subnodes casts implicit into treenode. The class treenode does not contain color or cast implicitly into the class Object. But "color" is a property of the class Object. Then you cast into this class explicitly to Object.

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

@david.seo, it is correct, that you don't find casting explicitly in the manual like method or property of the class. But if you read the Flexscript Class Reference treenode you find the description.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel commented ·

Maybe a member of the development can write this a bit better.

0 Likes 0 ·