My favorites | Sign in
Project Home Source
Checkout   Browse   Changes    
 
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import tv.zarate.utils.Trace;
import tv.zarate.utils.MovieclipUtils;
import tv.zarate.utils.TextfieldUtils;
import tv.zarate.utils.Delegate;

class tv.zarate.projects.ZLog.test{

private var base_mc:MovieClip;

public function test(m:MovieClip){

Trace.trc("Test app up and running");

Stage.scaleMode = "noScale";
Stage.align = "TL";

base_mc = m;

doLayout();

}

public static function main(m:MovieClip):Void{

var instance:test = new test(m);

}

// private methods

private function doLayout():Void{

var margin:Number = 5;

var sendTrace_mc:MovieClip = makeButton("Send trace");

sendTrace_mc.onPress = Delegate.create(this,doTrace,1);

var sendFatal_mc:MovieClip = makeButton("Send fatal");
sendFatal_mc._x = sendTrace_mc._x + sendTrace_mc._width + margin;

sendFatal_mc.onPress = Delegate.create(this,doTrace,2);


var sendXML_mc:MovieClip = makeButton("Send xml");
sendXML_mc._x = sendFatal_mc._x + sendFatal_mc._width + margin;

sendXML_mc.onPress = Delegate.create(this,doTrace,3);

}

private function doTrace(type:Number):Void{

switch(type){

case(1):

trace("Hello world > " + random(100));
break;

case(2):

trace("Hello fatal world > " + random(100),"fatal");
break;

case(3):

var xmlString:String = '<data><oneNode reallyImportantAttribute="null">This is node value!</oneNode><otherNode><withChild></withChild></otherNode></data>';

var xml:XML = new XML(xmlString);

trace(xml);
break;


}

}

private function makeButton(txt:String):MovieClip{

var depth:Number = base_mc.getNextHighestDepth();

var mc:MovieClip = base_mc.createEmptyMovieClip("button_"+depth,depth);

var back_mc:MovieClip = mc.createEmptyMovieClip("back_mc",100);
MovieclipUtils.DrawSquare(back_mc,0x000000,100,100,30);

var title_mc:MovieClip = mc.createEmptyMovieClip("title_mc",200);
title_mc._x = 10;

var field:TextField = TextfieldUtils.createField(title_mc);
field.text = txt;
field.setTextFormat(new TextFormat(null,18,0xffffff));

return mc;

}

}

Change log

r76 by zzzarate on Feb 18, 2008   Diff
Again, reordering namespace.
Go to: 
Project members, sign in to write a code review

Older revisions

r75 by zzzarate on Feb 18, 2008   Diff
Namespace update, removed capital
letters. "Projects", "Utils" and
"Application" go to "projects",
"utils" and "application".

...
r17 by zzzarate on Jun 10, 2007   Diff
Now we check if the LocalConnection is
actually created and display error
otherwise.
Added test application.
All revisions of this file

File info

Size: 2053 bytes, 100 lines
Powered by Google Project Hosting