0 Favourites

Accessing Object Name

This forum is currently in read-only mode.
  • Is it possible to access an object's name?

    Like in an expression Object.ObjectName.

    There doesn't seem to be a way.

    Thank You in advance.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • An object is already accessed by its name. A Sprite named "bubble" will be accessed in expressions as bubble.someparameter

    What's the purpose? It could help making better proposals :)

  • The purpose is being able to automatically write an object's name within a Family into a variable.

    Something like this:

    + If (Family) "Letters" Clicked:

    RecordLetterVar.Add: Letters.ObjectName

    Imagine Letters contains objects like A, B, C etc. .

    It would be tedious to manually write an 'On Click' Event for every letter object separately.

    Of course I know what You said Tulamide, lol; but thank You for being there. :)

  • Something like this:

    + If (Family) "Letters" Clicked:

    > RecordLetterVar.Add: Letters.ObjectName

    Imagine Letters contains objects like A, B, C etc. .

    It would be tedious to manually write an 'On Click' Event for every letter object separately.Yes, it would be tedious. Why not having a family pv and adding that to RecordLetterVar ?

    + MouseKeyboard: On Left Clicked on Blue

    -> System: Add Blue('name') to global variable 'letters'

    + System: Always (every tick)

    -> output: Set text to global('letters')

    'letters' here being a global text var and 'name' a family text var

  • > Something like this:

    >

    > + If (Family) "Letters" Clicked:

    > > RecordLetterVar.Add: Letters.ObjectName

    >

    > Imagine Letters contains objects like A, B, C etc. .

    > It would be tedious to manually write an 'On Click' Event for every letter object separately.Yes, it would be tedious. Why not having a family pv and adding that to RecordLetterVar ?

    + MouseKeyboard: On Left Clicked on Blue

    -> System: Add Blue('name') to global variable 'letters'

    + System: Always (every tick)

    -> output: Set text to global('letters')

    'letters' here being a global text var and 'name' a family text var

    Thanks for Your help Tulamide.

    Yes, I thought about that too. That seems to be the only way. Then I would however still have to set every variable by hand to the respective objects name.

    Don't You think it would be more easy to have access to the object's name? I mean it seems like it would be such a simple thing.

    Anyway, it's not that much of a big deal. Just a small annoyance, I guess. lol

    By the way, it's nice to see You're still around. <img src="smileys/smiley1.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)