HTMLcopy
1
<div id="container"></div>
CSScopy
6
1
html, body, #container {
2
width: 100%;
3
height: 100%;
4
margin: 0;
5
padding: 0;
6
}
JavaScriptcopy
x
1
var stage = acgraph.create("container");
2
3
var simpleText = stage.text(50, 50);
4
simpleText.style({fontStyle: "italic", fontSize: "15px"});
5
simpleText.text("Mouse over the text and click.");
6
simpleText.listen("mouseOut", function (e) {
7
simpleText.color("#1B5E20")
8
});
9
simpleText.listen("mouseOver", function (e) {
10
simpleText.color("#D50000");
11
});
12
simpleText.listen("click", function (e) {
13
simpleText.text("You can\'t click here anymore.");
14
simpleText.color("#212121");
15
16
// Removes all listeners.
17
simpleText.removeAllListeners();
18
});