-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHTMLBodyElement.as
More file actions
51 lines (50 loc) · 1.69 KB
/
HTMLBodyElement.as
File metadata and controls
51 lines (50 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package com.w3canvas.ascanvas {
import com.w3canvas.ascanvas.HTMLElement;
import flash.display.Sprite;
dynamic public class HTMLHtmlElement extends HTMLElement {
private var manifest;
public function HTMLHtmlElement(ownerDoc = null) {
super('html',{},ownerDoc,this);
}
}
dynamic public class HTMLHeadElement extends HTMLElement {
public function HTMLHeadElement(ownerDoc = null) {
super('head',{},ownerDoc,this);
}
}
dynamic public class HTMLTitleElement extends HTMLElement {
private var _text;
private function get text() { return _text; }
private function set text(text) { _text = text; }
private function get textContent() { return _text; }
private function set textContent(text) { _text = text; }
public function HTMLTitleElement(ownerDoc = null) {
super('title',{},ownerDoc,this);
}
}
dynamic public class HTMLBodyElement extends HTMLElement {
private var _background;
private var document;
private var bodySprite;
public function HTMLBodyElement(ownerDoc = null) {
var width = 0, height = 0;
super('body', {width: width, height: height}, ownerDoc, this);
this.document = ownerDoc;
this.bodySprite = new Sprite();
}
override public function move() {
if(bodySprite === null) return;
bodySprite.x = style.left || 0;
bodySprite.y = style.top || 0;
}
override public function resize() {
if(bodySprite === null) return;
bodySprite.width = style.width;
bodySprite.height = style.height;
}
public function toString() { return "[object HTMLBodyElement]"; }
public function toSource() { return "<body></body>"; }
public function toJSON() { return "new HTMLBodyElement()"; };
public function toSprite() { return bodySprite; }
}
}