is it possible to print to screen objects blendmode?

hey

i am trying to change object blendmode through a function. when i do that with

e.target.blendmode = “add” or “normal” it works good. but when i am trying to turn all other

objects in a table to a blendmode = “normal”, nothing is happening. like this:

for t=1, #myTable, 1 do

   myTable[t].blendmode = “normal”;

end

i tried adding a print command to see what can it found under the blendmode of the object but i get nil:

print(myTable[t].blendmode);

why is it when i write something like:

if(e.target.blendMode == “add”) then
             e.target.blendMode = “normal”;
elseif(e.target.blendMode == “normal”) then
             e.target.blendMode = “add”;
 end

it works but when i print it out i get nil. or when using the same thing on a table and not directly on an e.target, nothing happens?

I’m not sure if you can access it directly, so I would just add my own property to the object which I change whenever I change the blendmode. 

E.g.

--create object and set blendMode myObj = display..... myObj.blendMode = "normal" myObj.bm = "normal" --change blendMode and update custom property if e.target.bm == "add" then e.target.blendMode = "normal" e.target.bm = "normal" elseif e.target.bm == "normal" then e.target.blendMode = "add" e.target.bm = "add" end

It’s not ideal but should save you time looking for a way to access the blendMode property.

thanks for the reply, i"ll try that. Hope that would do the job.

I’m not sure if you can access it directly, so I would just add my own property to the object which I change whenever I change the blendmode. 

E.g.

--create object and set blendMode myObj = display..... myObj.blendMode = "normal" myObj.bm = "normal" --change blendMode and update custom property if e.target.bm == "add" then e.target.blendMode = "normal" e.target.bm = "normal" elseif e.target.bm == "normal" then e.target.blendMode = "add" e.target.bm = "add" end

It’s not ideal but should save you time looking for a way to access the blendMode property.

thanks for the reply, i"ll try that. Hope that would do the job.