HTML5 Canvas - Using variables to compose code string for reusable interface elements?
I have a MovieClip that contains a Dynamic Text lable with a string value:

I want to use the value of prodID to populate a string of code, variables are set up here:
pID = this.prodID.text;
That returns CHEMLOK289290286
and next:
tID = "t_" + pID;
That creates t_CHEMLOK289290286 which is a variable and should display its value of: Chemlok® 289/290 where referenced;
This is the executed script:
this.pBTN.b_Title.text = tID;
Instead of displaying the var's value, it displays "t_CHEMLOK289290286" in the button label.
It should instead display Chemlok® 289/290 as it does with the hand coded script:
this.pBTN.b_Title.text = t_CHEMLOK289290286;
Shouldn't this.pBTN.b_Title.text = tID; be the exact equivalent of that hand coded script?
next line:
this.pBTN.addEventListener("click", pID.bind(this));
That should render as CHEMLOK289290286.bind but it does not, instead it errors: Uncaught TypeError: pID.bind is not a function...
Shouldn't that script be identical to the hand coded script that works as expected, here?
this.pBTN.addEventListener("click", CHEMLOK289290286.bind(this));
Is it not possible to compose scripts populated by values of variables? I can find no information anywhere of this being done, any insight, helpful hints or clues are welcome.
Thanks.
