Book a Demo

Author Topic: Accessing attributes of a tagged value  (Read 3725 times)

Garret N

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Accessing attributes of a tagged value
« on: July 27, 2012, 07:23:23 am »
I am needing to access the attributes of a tagged value of an element with ShapeScript. The reason I am wanting to do this is because I am wanting to change the image displayed based on the value of this attribute. I have tried using the HasTag and HasProperty functions, but neither of them find the attribute. Any ideas?

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Accessing attributes of a tagged value
« Reply #1 on: July 27, 2012, 09:05:29 am »
Shape scripts cannot access attributes, just tagged values, e.g.
Code: [Select]
shape main
{
      if(hastag("foo"))
      {
            rectangle(0,0,100,100);
            print("#tag:foo#");
      }
      else
      {
            drawnativeshape();
      }
}
The Sparx Team
[email protected]