david77
-
Posts
31 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by david77
-
-
Thanks for pointing me to the error console. I've never found it before and I wrote my first web pages over 15 years ago. My traffic lights work http://homepage.ntlworld.com/stonebanks/traffic9.svg so now I will try to get the on-screen microprocessor working.
-
It looks as tho http://www.w3.org/Graphics/SVG/IG/resources/svgprimer.html#interactivity provides the answer to my query.<script><![CDATA[function changeFill(){C=document.getElementById("C")C.setAttributeNS(null,"fill","black")}]]></script><circle id="C" cx="80" cy="100" r="22"fill="grey" onclick="changeFill()"/></svg> Thanks for advice.
-
Thanks - when I have had trouble in the past, I have enabled error reporting in IE and then used the Microsoft debugger - but IE doesn't work with SVG. I have now found the error console in Opera that I have been using - but there is masses if info from pages that have been run. I must find out how to clear it so that I can see new info for my page. Thanks again
-
Thanks but - where is a link to "my signature" and what's an "error console"? I don't know what I am doing. All I want to do is change the fill color of a circle, initially just to get me going, from a button click. I don't care whether I use SVG or Canvas for the graphics. I looked at Raphael - that shows me how to draw a circle but I couldn't see how to define the fill color. I have done a fair amount of javascript programming - my CGT calculator runs to over 1,000 lines of code, but this is my first attempt at graphics. I would put up with it running on only one browser - I'll worry about other browsers once I get something working.Check your error console, there are syntax errors in the turn_on and turn_off functions. You have the parameters quoted so that they're strings instead of identifiers. There are some links in my signature about the various error consoles in browsers. -
When I was teaching 25 years ago, I wrote a program in Turbo Pascal to represent an on-screen microprocessor so that students could see their programs working. I also wrote progs for models for student exercises. Now that I am retired, I would like to get these working on the web. So far I have traffic3.htm at http://homepage.ntlworld.com/stonebanks/traffic3.htm using svg graphics and traffic5.htm at http://homepage.ntlworld.com/stonebanks/traffic5.htm using canvas -see http://homepage.ntlworld.com/stonebanks/modelinfo.htm I have added a button to control the lights - but it doesn't work. I would appreciate any advice persuading javascript to control these lights. Thanks
Getting javascript to control traffic lights
in JavaScript
Posted
If I get my on-screen processor working, can I then get it to access the traffic lights page? I had 2 processors, and 8-bit one based on the Z80 and a 16-bit RSIC processor running ARM's Thumb code. I also had a BASIC interpreter. Any of those could drive any one of half-a-dozen models, so I'd like to keep the pages separate and have an include or uses line somewhere. Can you please tell me how to do it? Thanks