Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <html lang="en">
  4. <head>
  5. <script src="http://code.createjs.com/easeljs-0.7.1.min.js"></script>
  6. </head>
  7. <body>
  8. <canvas id="gameCanvas" width="1496" height="1024"></canvas>
  9.  
  10. <script>
  11. var stage = new createjs.Stage(document.getElementById('gameCanvas'));
  12.  
  13. var svgImage = new createjs.Bitmap("SvgFile.svg");
  14. svgImage.on("click", sayHi);
  15. stage.addChild(svgImage);
  16.  
  17. createjs.Ticker.setFPS(40);
  18. createjs.Ticker.on("tick", tick);
  19.  
  20. function sayHi() {
  21. alert("Hello!"); // INTERNET EXPLORER CRASHES. CHROME DISPLAYS "Hello!".
  22. }
  23.  
  24. function tick() {
  25. stage.update();
  26. }
  27.  
  28. </script>
  29. </body>
  30. </html>
  31.  
  32. <?xml version="1.0"?>
  33. <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
  34. "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
  35.  
  36. <svg xmlns="http://www.w3.org/2000/svg"
  37. width="467" height="462">
  38. <rect x="80" y="60" width="250" height="250" rx="20"
  39. style="fill:#ff0000; stroke:#000000;stroke-width:2px;" />
  40.  
  41. <rect x="140" y="120" width="250" height="250" rx="40"
  42. style="fill:#0000ff; stroke:#000000; stroke-width:2px;
  43. fill-opacity:0.7;" />
  44. </svg>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement