Tom Powers
asked on
I need to create a if certain attrib = a string then go to canvas and write
I have this Flash code and I need to turn it into javascript it's a few simple keywords or syntax is missing cause What I want is
END OF 1st QUARTER
END OF 2nd QUARTER
END OF 3rd QUARTER
END OF 4th QUARTER
then if $(Play).attr('PlayType') == "PERIODSTART" This is not a problem as long as I get first
example Halftime then I can just use some code for the rest of displaying static text string based on xml data
if $(Play).attr('PlayType') == "PERIODEND" {
if $(Play).attr('Status') == "HT" {
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
var grd=ctx.createLinearGradient(0,0,200,0);
grd.addColorStop(0,"Yellow");
grd.addColorStop(1,"Orange");
// Fill with gradient
ctx.fillStyle=grd;
ctx.font="30px Arial";
ctx.fillText("Hafetime",10,50);
}
}
but of course there is alot more like END OF 1st QUARTER
END OF 2nd QUARTER
END OF 3rd QUARTER
END OF 4th QUARTER
then if $(Play).attr('PlayType') == "PERIODSTART" This is not a problem as long as I get first
example Halftime then I can just use some code for the rest of displaying static text string based on xml data
ASKER
Yo I don't understand I have if (...) {...} Please just show me in the IF Statement I'm not brillant
if $(Play).attr('PlayType') == {"PERIODEND"}{
if $(Play).attr('Status') == {"HT"}{
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
var grd=ctx.createLinearGradient(0,0,200,0);
grd.addColorStop(0,"Yellow");
grd.addColorStop(1,"Orange");
// Fill with gradient
ctx.fillStyle=grd;
ctx.font="30px Arial";
ctx.fillText("Hafetime",10,50);
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks Dude
Please read:
http://support.experts-exchange.com/customer/portal/articles/481419
>>A should be the default grade awarded unless the answer is deficient...
http://support.experts-exchange.com/customer/portal/articles/481419
>>A should be the default grade awarded unless the answer is deficient...
ASKER
Sorry Heilo I wasn't paying attention. I'll get you next time. My MISTAKE i WASN'T THINKING
if ... {...}
You are missing the enclosing parentheses:
if (...) {...}