home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 July
/
CMCD0704.ISO
/
Software
/
Demo
/
elearn
/
Fizica
/
lib
/
lib_interf.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2004-05-12
|
119KB
|
4,658 lines
MovieClip.prototype.dashTo = function(startx, starty, endx, endy, len, gap)
{
if(arguments.length < 6)
{
return false;
}
var seglength;
var deltax;
var deltay;
var segs;
var cx;
var cy;
seglength = len + gap;
deltax = endx - startx;
deltay = endy - starty;
delta = Math.sqrt(deltax * deltax + deltay * deltay);
segs = Math.floor(Math.abs(delta / seglength));
radians = Math.atan2(deltay,deltax);
cx = startx;
cy = starty;
deltax = Math.cos(radians) * seglength;
deltay = Math.sin(radians) * seglength;
var n = 0;
while(n < segs)
{
this.moveTo(cx,cy);
this.lineTo(cx + Math.cos(radians) * len,cy + Math.sin(radians) * len);
cx += deltax;
cy += deltay;
n++;
}
this.moveTo(cx,cy);
delta = Math.sqrt((endx - cx) * (endx - cx) + (endy - cy) * (endy - cy));
if(delta > len)
{
this.lineTo(cx + Math.cos(radians) * len,cy + Math.sin(radians) * len);
}
else if(delta > 0)
{
this.lineTo(cx + Math.cos(radians) * delta,cy + Math.sin(radians) * delta);
}
this.moveTo(endx,endy);
};
MovieClip.prototype.drawArc = function(x, y, radius, arc, startAngle, yRadius)
{
if(arguments.length < 5)
{
return undefined;
}
if(yRadius == undefined)
{
yRadius = radius;
}
var segAngle;
var theta;
var angle;
var angleMid;
var segs;
var ax;
var ay;
var bx;
var by;
var cx;
var cy;
arc = 360;
segs = Math.ceil(Math.abs(arc) / 45);
segAngle = arc / segs;
theta = (- segAngle / 180) * 3.141592653589793;
angle = 90;
ax = x - Math.cos(angle) * radius;
ay = y - Math.sin(angle) * yRadius;
if(segs > 0)
{
var i = 0;
while(i < segs)
{
angle += theta;
angleMid = angle - theta / 2;
bx = ax + Math.cos(angle) * radius;
by = ay + Math.sin(angle) * yRadius;
cx = ax + Math.cos(angleMid) * (radius / Math.cos(theta / 2));
cy = ay + Math.sin(angleMid) * (yRadius / Math.cos(theta / 2));
this.curveTo(cx,cy,bx,by);
i++;
}
}
return {x:bx,y:by};
};
MovieClip.prototype.drawBurst = function(x, y, sides, innerRadius, outerRadius, angle)
{
if(arguments < 5)
{
return undefined;
}
if(sides > 2)
{
var step;
var halfStep;
var qtrStep;
var start;
var n;
var dx;
var dy;
var cx;
var cy;
step = 6.283185307179586 / sides;
halfStep = step / 2;
qtrStep = step / 4;
start = angle / 180 * 3.141592653589793;
this.moveTo(x + Math.cos(start) * outerRadius,y - Math.sin(start) * outerRadius);
n = 1;
while(n <= sides)
{
cx = x + Math.cos(start + step * n - qtrStep * 3) * (innerRadius / Math.cos(qtrStep));
cy = y - Math.sin(start + step * n - qtrStep * 3) * (innerRadius / Math.cos(qtrStep));
dx = x + Math.cos(start + step * n - halfStep) * innerRadius;
dy = y - Math.sin(start + step * n - halfStep) * innerRadius;
this.curveTo(cx,cy,dx,dy);
cx = x + Math.cos(start + step * n - qtrStep) * (innerRadius / Math.cos(qtrStep));
cy = y - Math.sin(start + step * n - qtrStep) * (innerRadius / Math.cos(qtrStep));
dx = x + Math.cos(start + step * n) * outerRadius;
dy = y - Math.sin(start + step * n) * outerRadius;
this.curveTo(cx,cy,dx,dy);
n++;
}
}
};
MovieClip.prototype.drawGear = function(x, y, sides, innerRadius, outerRadius, angle, holeSides, holeRadius)
{
if(arguments < 5)
{
return undefined;
}
if(sides > 2)
{
var step;
var qtrStep;
var start;
var n;
var dx;
var dy;
step = 6.283185307179586 / sides;
qtrStep = step / 4;
start = angle / 180 * 3.141592653589793;
this.moveTo(x + Math.cos(start) * outerRadius,y - Math.sin(start) * outerRadius);
n = 1;
while(n <= sides)
{
dx = x + Math.cos(start + step * n - qtrStep * 3) * innerRadius;
dy = y - Math.sin(start + step * n - qtrStep * 3) * innerRadius;
this.lineTo(dx,dy);
dx = x + Math.cos(start + step * n - qtrStep * 2) * innerRadius;
dy = y - Math.sin(start + step * n - qtrStep * 2) * innerRadius;
this.lineTo(dx,dy);
dx = x + Math.cos(start + step * n - qtrStep) * outerRadius;
dy = y - Math.sin(start + step * n - qtrStep) * outerRadius;
this.lineTo(dx,dy);
dx = x + Math.cos(start + step * n) * outerRadius;
dy = y - Math.sin(start + step * n) * outerRadius;
this.lineTo(dx,dy);
n++;
}
if(holeSides > 2)
{
if(holeRadius == undefined)
{
holeRadius = innerRadius / 3;
}
step = 6.283185307179586 / holeSides;
this.moveTo(x + Math.cos(start) * holeRadius,y - Math.sin(start) * holeRadius);
n = 1;
while(n <= holeSides)
{
dx = x + Math.cos(start + step * n) * holeRadius;
dy = y - Math.sin(start + step * n) * holeRadius;
this.lineTo(dx,dy);
n++;
}
}
}
};
MovieClip.prototype.drawOval = function(x, y, radius, yRadius)
{
if(arguments.length < 3)
{
return undefined;
}
var theta;
var xrCtrl;
var yrCtrl;
var angle;
var angleMid;
var px;
var py;
var cx;
var cy;
if(yRadius == undefined)
{
yRadius = radius;
}
theta = 0.7853981633974483;
xrCtrl = radius / Math.cos(theta / 2);
yrCtrl = yRadius / Math.cos(theta / 2);
angle = 0;
this.moveTo(x + radius,y);
var i = 0;
while(i < 8)
{
angle += theta;
angleMid = angle - theta / 2;
cx = x + Math.cos(angleMid) * xrCtrl;
cy = y + Math.sin(angleMid) * yrCtrl;
px = x + Math.cos(angle) * radius;
py = y + Math.sin(angle) * yRadius;
this.curveTo(cx,cy,px,py);
i++;
}
};
MovieClip.prototype.drawPoly = function(x, y, sides, radius, angle)
{
if(arguments.length < 4)
{
return undefined;
}
var count = Math.abs(sides);
if(count > 2)
{
var step;
var start;
var n;
var dx;
var dy;
step = 6.283185307179586 / sides;
start = angle / 180 * 3.141592653589793;
this.moveTo(x + Math.cos(start) * radius,y - Math.sin(start) * radius);
n = 1;
while(n <= count)
{
dx = x + Math.cos(start + step * n) * radius;
dy = y - Math.sin(start + step * n) * radius;
this.lineTo(dx,dy);
n++;
}
}
};
MovieClip.prototype.drawRect = function(x, y, w, h, cornerRadius)
{
if(arguments.length < 4)
{
return undefined;
}
if(cornerRadius > 0)
{
var theta;
var angle;
var cx;
var cy;
var px;
var py;
if(cornerRadius > Math.min(w,h) / 2)
{
cornerRadius = Math.min(w,h) / 2;
}
theta = 0.7853981633974483;
this.moveTo(x + cornerRadius,y);
this.lineTo(x + w - cornerRadius,y);
angle = -1.5707963267948966;
cx = x + w - cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
cy = y + cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
px = x + w - cornerRadius + Math.cos(angle + theta) * cornerRadius;
py = y + cornerRadius + Math.sin(angle + theta) * cornerRadius;
this.curveTo(cx,cy,px,py);
angle += theta;
cx = x + w - cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
cy = y + cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
px = x + w - cornerRadius + Math.cos(angle + theta) * cornerRadius;
py = y + cornerRadius + Math.sin(angle + theta) * cornerRadius;
this.curveTo(cx,cy,px,py);
this.lineTo(x + w,y + h - cornerRadius);
angle += theta;
cx = x + w - cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
cy = y + h - cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
px = x + w - cornerRadius + Math.cos(angle + theta) * cornerRadius;
py = y + h - cornerRadius + Math.sin(angle + theta) * cornerRadius;
this.curveTo(cx,cy,px,py);
angle += theta;
cx = x + w - cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
cy = y + h - cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
px = x + w - cornerRadius + Math.cos(angle + theta) * cornerRadius;
py = y + h - cornerRadius + Math.sin(angle + theta) * cornerRadius;
this.curveTo(cx,cy,px,py);
this.lineTo(x + cornerRadius,y + h);
angle += theta;
cx = x + cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
cy = y + h - cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
px = x + cornerRadius + Math.cos(angle + theta) * cornerRadius;
py = y + h - cornerRadius + Math.sin(angle + theta) * cornerRadius;
this.curveTo(cx,cy,px,py);
angle += theta;
cx = x + cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
cy = y + h - cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
px = x + cornerRadius + Math.cos(angle + theta) * cornerRadius;
py = y + h - cornerRadius + Math.sin(angle + theta) * cornerRadius;
this.curveTo(cx,cy,px,py);
this.lineTo(x,y + cornerRadius);
angle += theta;
cx = x + cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
cy = y + cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
px = x + cornerRadius + Math.cos(angle + theta) * cornerRadius;
py = y + cornerRadius + Math.sin(angle + theta) * cornerRadius;
this.curveTo(cx,cy,px,py);
angle += theta;
cx = x + cornerRadius + Math.cos(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
cy = y + cornerRadius + Math.sin(angle + theta / 2) * cornerRadius / Math.cos(theta / 2);
px = x + cornerRadius + Math.cos(angle + theta) * cornerRadius;
py = y + cornerRadius + Math.sin(angle + theta) * cornerRadius;
this.curveTo(cx,cy,px,py);
}
else
{
this.moveTo(x,y);
this.lineTo(x + w,y);
this.lineTo(x + w,y + h);
this.lineTo(x,y + h);
this.lineTo(x,y);
}
};
MovieClip.prototype.drawStar = function(x, y, points, innerRadius, outerRadius, angle)
{
if(arguments.length < 5)
{
return undefined;
}
var count = Math.abs(points);
if(count > 2)
{
var step;
var halfStep;
var start;
var n;
var dx;
var dy;
step = 6.283185307179586 / points;
halfStep = step / 2;
start = angle / 180 * 3.141592653589793;
this.moveTo(x + Math.cos(start) * outerRadius,y - Math.sin(start) * outerRadius);
n = 1;
while(n <= count)
{
dx = x + Math.cos(start + step * n - halfStep) * innerRadius;
dy = y - Math.sin(start + step * n - halfStep) * innerRadius;
this.lineTo(dx,dy);
dx = x + Math.cos(start + step * n) * outerRadius;
dy = y - Math.sin(start + step * n) * outerRadius;
this.lineTo(dx,dy);
n++;
}
}
};
MovieClip.prototype.drawWedge = function(x, y, startAngle, arc, radius, yRadius)
{
if(arguments.length < 5)
{
return undefined;
}
this.moveTo(x,y);
if(yRadius == undefined)
{
yRadius = radius;
}
var segAngle;
var theta;
var angle;
var angleMid;
var segs;
var ax;
var ay;
var bx;
var by;
var cx;
var cy;
if(Math.abs(arc) > 360)
{
arc = 360;
}
segs = Math.ceil(Math.abs(arc) / 45);
segAngle = arc / segs;
theta = (- segAngle / 180) * 3.141592653589793;
angle = (- startAngle / 180) * 3.141592653589793;
if(segs > 0)
{
ax = x + Math.cos(startAngle / 180 * 3.141592653589793) * radius;
ay = y + Math.sin((- startAngle) / 180 * 3.141592653589793) * yRadius;
this.lineTo(ax,ay);
var i = 0;
while(i < segs)
{
angle += theta;
angleMid = angle - theta / 2;
bx = x + Math.cos(angle) * radius;
by = y + Math.sin(angle) * yRadius;
cx = x + Math.cos(angleMid) * (radius / Math.cos(theta / 2));
cy = y + Math.sin(angleMid) * (yRadius / Math.cos(theta / 2));
this.curveTo(cx,cy,bx,by);
i++;
}
this.lineTo(x,y);
}
};
MovieClip.prototype.arc = function(centerX, centerY, radius, startAngle, endAngle, radiusY, connectToLastPoint)
{
if(arguments.length < 5 || startAngle == endAngle)
{
return undefined;
}
if(null == radiusY)
{
radiusY = radius;
}
if(null == connectToCenter)
{
connectToCenter = false;
}
var yRatio = radiusY / radius;
var counterClockwise = startAngle > endAngle || endAngle == 360;
startAngle -= 360 * Math.floor(startAngle / 360);
if(startAngle < 0)
{
startAngle = 360 - startAngle;
}
endAngle -= 360 * Math.floor(endAngle / 360);
if(endAngle < 0)
{
endAngle = 360 - endAngle;
}
if(counterclockWise && startAngle >= endAngle || startAngle == endAngle)
{
endAngle += 360;
}
startAngle = 3.141592653589793 * startAngle / 180;
endAngle = 3.141592653589793 * endAngle / 180;
var deltaPhi = (endAngle - startAngle) / 8;
var nax = Math.cos(startAngle);
var nay = Math.sin(startAngle);
var xa = nax * radius;
var ya = nay * radius;
if(connectToLastPoint)
{
this.lineTo(centerX + xa,centerY + yRatio * ya);
}
else
{
this.moveTo(centerX + xa,centerY + yRatio * ya);
}
var i = 1;
while(i <= 8)
{
var nextAngle = startAngle + i * deltaPhi;
var nbx = Math.cos(nextAngle);
var nby = Math.sin(nextAngle);
var xb = radius * nbx;
var yb = radius * nby;
var det = nay * nbx - nax * nby;
var tau1 = ((xa - xb) * nbx + (ya - yb) * nby) / det;
var tau2 = ((xb - xa) * nax - (ya - yb) * nay) / det;
var xc = ((- nay) * tau1 + xa + nby * tau2 + xb) / 2;
var yc = (nax * tau1 + ya - nbx * tau2 + yb) / 2;
this.curveTo(centerX + xc,centerY + yRatio * yc,centerX + xb,centerY + yRatio * yb);
xa = xb;
ya = yb;
nax = nbx;
nay = nby;
i++;
}
xa += centerX;
ya += centerY;
};
if(typeof Object.debug == "undefined")
{
Object.debug = function(m)
{
trace(m + " [time:" + getTimer() + "]");
};
}
if(typeof Object.lista == "undefined")
{
Object.lista = function(m)
{
if(m == undefined)
{
trace("Your object is undefined");
}
else
{
trace("*************LISTA*******************\n" + m + " [time:" + getTimer() + "] \n--------------------------------------");
trace("object " + typeof m + " contains:");
for(var j in m)
{
trace(j + "= " + m[j]);
}
}
trace("***************END*****************");
};
}
Function.prototype["extends"] = function(superCls)
{
this.prototype.__proto__ = superCls.prototype;
this.prototype.__constructor__ = superCls;
ASSetPropFlags(this.prototype,["__constructor__"],1);
};
Function.prototype["implements"] = function(superCls)
{
Object.debug(">> Object.implements() called; sub, super: " + [this,superCls]);
var sb = this.prototype;
var sp = superCls.prototype;
for(var i in sp)
{
sb[i] = sp[i];
}
};
Object.Exe = function(funct, interval, cine, p2, p3, p4)
{
this.proces = setInterval(funct,interval,cine,p2,p3,p4);
};
Object.Exe.prototype.kill = function(cine)
{
var cine = cine || this.proces;
clearInterval(cine);
delete this;
};
MovieClip.prototype.createMc = function(n, x, y)
{
var depth = this.nextDepth();
this.createEmptyMovieclip(n,depth);
var nc = this[n];
x == undefined ? 0 : (nc._x = x);
y == undefined ? 0 : (nc._y = y);
return nc;
};
MovieClip.prototype.isPlaying = function()
{
if(this._previousframe == undefined)
{
this._previousframe = this._currentframe;
}
if(this._previousframe == this._currentframe)
{
var playing = false;
}
else
{
playing = true;
}
this._previousframe = this._currentframe;
return playing;
};
MovieClip.prototype.attachMc = function(id, n, x, y)
{
var depth = this.nextDepth();
this.attachMovie(id,n,depth);
var nc = this[n];
if(x != undefined)
{
nc._x = x;
}
if(y != undefined)
{
nc._y = y;
}
return nc;
};
MovieClip.prototype.attachCmp = function(symbolID, name, §class§, x, y, args)
{
var nc = this.attachMc(symbolID,name,x,y);
nc.transform(eval("class"),args);
return nc;
};
MovieClip.prototype.transform = function(cls, args)
{
if(typeof cls == "function")
{
this.__proto__ = cls.prototype;
this.tmp = cls;
this.tmp(args);
delete this.tmp;
}
else
{
trace("tansform: Incorrect superClass type or path - " + typeof cls);
}
};
MovieClip.prototype.mcImplements = function(superCls)
{
var sb = this;
var sp = superCls.prototype;
for(var i in sp)
{
sb[i] = sp[i];
}
};
MovieClip.prototype.copyMc = function(n)
{
var depth = this.nextDepth();
var str = String(this);
var newName = "copy_of_" + str.substring(str.lastIndexOf(".") + 1,str.length) + depth;
delete str;
return this.duplicateMovieClip(newName,depth);
};
MovieClip.prototype.attachEvent = function(eventName, myFunction)
{
this[eventName] = function()
{
myFunction(this);
};
};
MovieClip.prototype.clearMc = function()
{
for(var i in this)
{
if(typeof this[i] == "movieclip")
{
this[i].removeMovieClip();
}
}
};
MovieClip.prototype.write = function(tx, x, y)
{
this.createTextField("mytext",this.nextDepth(),x,y,this._width,30);
with(this)
{
mytext.autoSize = "left";
mytext.type = "dynamic";
mytext.html = true;
mytext.wordWrap = true;
mytext.selectable = false;
mytext.htmlText = tx;
mytext.embedFonts = true;
}
return this.mytext;
};
MovieClip.prototype.nextDepth = function()
{
MovieClip.nextDepthCounter = MovieClip.nextDepthCounter + 1;
return MovieClip.nextDepthCounter;
};
ASSetPropFlags(MovieClip.prototype,null,1,1);
var BO = Object.BaseObject = function(arg)
{
this.nuanta = arg;
Object.__MainPlayControler__.registerBO(this);
this.addProperty("_bright",this.getBright,this.setBright);
};
BO.tip = "BaseObject";
BO["extends"](MovieClip);
var BOp = BO.prototype;
BOp.setCursor = function(crs)
{
this.$hasCursor = true;
this.$cursor = crs;
};
BOp.removeCursor = function()
{
this.$hasCursor = false;
this.$cursor = null;
};
BOp.setLocation = function(x, y)
{
var tx = this._x;
var ty = this._y;
if(x == undefined)
{
x = tx;
}
else
{
this._x = x;
}
if(y == undefined)
{
y = ty;
}
else
{
this._y = y;
}
};
BOp.setScale = function(x, y)
{
var tx = _xscale;
var ty = _yscale;
if(x == undefined)
{
x = tx;
}
else
{
_xscale = x;
}
if(y == undefined)
{
y = ty;
}
else
{
_yscale = y;
}
if(tx != x || ty != y)
{
trace("modificat scala");
}
};
BOp.setDimensions = function(w, h)
{
var tw = _width;
var th = _height;
if(w == undefined)
{
w = tw;
}
else
{
_width = w;
}
if(h == undefined)
{
h = th;
}
else
{
_height = h;
}
if(tw != w || th != h)
{
trace("modificat widt si/sau height");
}
};
BOp.setRotation = function(r)
{
var tr = _rotation;
if(r == undefined)
{
r = tr;
}
else
{
_rotation = r;
}
if(tr != r)
{
trace("modificat rotatie");
}
};
BOp.setAlpha = function(a)
{
var ta = _alpha;
if(a == undefined)
{
a = ta;
}
else
{
_alpha = a;
}
if(ta != a)
{
trace("modificat alpha");
}
};
BOp.msetRGB = function(c)
{
var tc = this.getRGB();
if(c == undefined)
{
c = tc;
}
else
{
new Color(this).setRGB(c);
}
if(tc != c)
{
}
};
BOp.mgetRGB = function()
{
return new Color(this).getRGB();
};
BOp.$remove = function()
{
this.removeMovieClip();
};
BOp.setColor = function(r, g, b)
{
if(this.mycolor == undefined)
{
this.mycolor = new Color(this);
this.clr = new Object();
this.clr.ra = 100;
this.clr.rb = 0;
this.clr.ga = 100;
this.clr.gb = 0;
this.clr.ba = 100;
this.clr.bb = 0;
this.clr.aa = this._alpha;
this.clr.ab = 100;
}
this.clr.rb = r;
this.clr.gb = g;
this.clr.bb = b;
this.mycolor.setTransform(this.clr);
};
BOp.getColor = function()
{
return {r:this.clr.rb,g:this.clr.gb,b:this.clr.bb};
};
BOp.setBright = function(cat)
{
if(this._bright == undefined)
{
this.actclr = this.getColor();
}
this._brightness = cat;
var br = this._brightness;
this.setColor(this.actclr.r + br,this.actclr.g + br,this.actclr.b + br);
};
BOp.getBright = function()
{
return this._brightness;
};
BOp.Rectangle = function(n, x, y, wide, high, fillColor)
{
this.createMc(n,x,y);
var u = this[n];
u.beginFill(fillColor || 6710886,100);
var x2 = 0 + wide;
var y2 = 0 + high;
u.moveTo(0,0);
u.lineTo(x2,0);
u.lineTo(x2,y2);
u.lineTo(0,y2);
u.lineTo(0,0);
u.endFill();
return u;
};
BOp.rec_outline = function(n, x, y, wide, high, lineColor, g)
{
this.createMc(n,x,y);
var u = this[n];
var g = g || 1;
u.lineStyle(g,lineColor,50);
var x2 = 0 + wide;
var y2 = 0 + high;
u.moveTo(0,0);
u.lineTo(x2,0);
u.lineTo(x2,y2);
u.lineTo(0,y2);
u.lineTo(0,0);
u.endFill();
return u;
};
BOp.line = function(n, x1, y1, x2, y2, lineColor, gros)
{
this.createMc(n,x1,y1);
var u = this[n];
var gros = gros || 1;
var lineColor = lineColor;
u.lineStyle(gros,lineColor,80);
u.moveTo(0,0);
u.lineTo(x2 - x1,y2 - y1);
return u;
};
BOp.loadImg = function(src, n, x, y, wide, high)
{
this.createMc(n,x,y);
this[n]._alpha = 0;
this[n].loadMovie(src);
this.dfer = function()
{
if(this[n]._width != 0)
{
var wi = this[n]._width;
var hi = this[n]._height;
this[n]._width = wide || wi;
this[n]._height = high || hi;
this.inte.kill();
delete this.inte;
delete this.dfer;
this[n]._alpha = 100;
this.ev_LImg();
}
};
this.inte = new Object.Exe(this,"dfer",50);
return this[n];
};
BOp.interval = function(interval, actiune)
{
var a;
var actiune = actiune;
var count = function(cine, interval, actiune)
{
a++;
if(a >= interval)
{
cine.interv.kill();
actiune();
}
};
this.count = count;
this.interv = new Object.Exe(this.count,1000,this,interval,actiune);
this.onUnload = function()
{
this.interv.kill();
};
};
BOp.fade = function(pas, strt, stp, inc)
{
var pas = pas || 1;
var strt = strt || 0;
var remove = false;
if(stp == 0)
{
var remove = true;
}
else if(Number(stp) == undefined)
{
stp = 100;
}
var inc = inc;
var anim;
var eu = this;
if(strt < stp)
{
anim = function(eu)
{
if(eu._alpha <= stp)
{
eu._alpha += pas;
updateAfterEvent();
}
else
{
eu.fadez.kill();
delete eu.fadez;
}
if(inc)
{
pas++;
}
};
}
else
{
if(strt <= stp)
{
this._alpha = strt;
this.fadez.kill();
return undefined;
}
anim = function(eu)
{
if(eu._alpha >= stp)
{
eu._alpha -= pas;
updateAfterEvent();
}
else
{
eu.fadez.kill();
delete eu.fadez;
if(remove)
{
eu.removeMovieClip();
}
}
if(inc)
{
pas++;
}
};
}
this._alpha = strt;
this.anim = anim;
if(this.fadez != undefined)
{
this.fadez.kill();
delete this.fadez;
}
this.fadez = new Object.Exe(this.anim,50,this);
this.onUnload = function()
{
this.fadez.kill();
};
};
BOp.bright = function(pas, strt, stp, inc)
{
var pas = pas || 1;
var strt = strt || 0;
var remove = false;
if(stp == 0)
{
var remove = true;
}
else if(Number(stp) == undefined)
{
stp = 100;
}
var inc = inc;
var anim;
var eu = this;
if(strt < stp)
{
anim = function(eu)
{
if(eu._bright <= stp)
{
eu._bright += pas;
updateAfterEvent();
}
else
{
eu.brightez.kill();
delete eu.brightez;
}
if(inc)
{
pas++;
}
trace("bright in");
};
}
else
{
if(strt <= stp)
{
this._bright = strt;
this.brightez.kill();
return undefined;
}
anim = function(eu)
{
if(eu._bright >= stp)
{
eu._bright -= pas;
updateAfterEvent();
}
else
{
eu.brightez.kill();
delete eu.brightez;
if(remove)
{
eu.removeMovieClip();
}
}
if(inc)
{
pas++;
}
trace("bright out");
};
}
this._bright = strt;
Object.lista(eu);
this.bnim = anim;
if(this.brightez != undefined)
{
this.brightez.kill();
delete this.brightez;
}
this.brightez = new Object.Exe(this.bnim,50,this);
this.onUnload = function()
{
this.brightez.kill();
};
};
BOp.ev_LImg = function()
{
ASBroadcaster.initialize(this);
this.addListener(this);
this.broadcastMessage("onLoadImg",this);
};
BOp.xmlLoaded = function(obj)
{
this.__proto__.obj = obj;
!this.nuanta ? this.msetRGB(obj.getAttribute("cl2") || "0x466099") : this.msetRGB(obj.getAttribute("cl1") || "0x466099");
globalStyleFormat.darkshadow = obj.getAttribute("cl1");
globalStyleFormat.shadow = obj.getAttribute("cl1");
globalStyleFormat.highlight3D = obj.getAttribute("cl2");
globalStyleFormat.highlight = 13421772;
globalStyleFormat.face = obj.getAttribute("cl2");
globalStyleFormat.background = 16777215;
globalStyleFormat.arrow = obj.getAttribute("cl1");
globalStyleFormat.backgroundDisabled = 16777215;
};
delete BO;
delete BOp;
Object.ferestreXml = function(xmlSA)
{
this.xmlSA = xmlSA;
};
Object.ferestreXml.prototype.getVarsById = function(id)
{
var i = 0;
while(i < this.xmlSA.fereastra.length)
{
if(id == this.xmlSA.fereastra[i].attributes.id)
{
var retArr = new Array();
var myNode = this.xmlSA.fereastra[i];
retArr.push(myNode.attributes.x);
retArr.push(myNode.attributes.y);
retArr.push(myNode.attributes.width);
retArr.push(myNode.attributes.height);
retArr.push(myNode.attributes.title);
retArr.push(myNode.text[0].getValue());
if(undefined != myNode.img[0])
{
var iArr = new Array();
var myNodec = myNode.img[0];
iArr.push(myNodec.attributes.src);
iArr.push(myNodec.attributes.vspace);
retArr.push(iArr);
}
return retArr;
}
i++;
}
trace("id not found: " + id);
return null;
};
Object.ferestreXML.prototype.getTooltipById = function(id)
{
var i = 0;
while(i < this.xmlSA.tooltip.length)
{
if(id == this.xmlSA.tooltip[i].attributes.id)
{
var retArr = new Array();
var myNode = this.xmlSA.tooltip[i];
retArr.push(myNode.getValue());
return retArr;
}
i++;
}
trace("id not found " + id);
return null;
};
Object.ferestreXML.prototype.getLabelById = function(id)
{
var i = 0;
while(i < this.xmlSA.label.length)
{
if(id == this.xmlSA.label[i].attributes.id)
{
var retArr = new Array();
var myNode = this.xmlSA.label[i];
retArr.push(myNode.getValue());
return retArr;
}
i++;
}
trace("id not found " + id);
return null;
};
Object.Glyph = function()
{
};
Object.Glyph["extends"](Object.BaseObject);
var fp = Object.Glyph.prototype;
fp.construct = function(cz, tip, sy, x, y, w, h)
{
var tp;
var m = this.__proto__;
m.cnt = this.cnt = Object.film;
var cont = this.cnt;
m.cz = cz;
m.wid = Number(w) || 250;
m.hig = Number(h) || 200;
m.sy = sy;
switch(tip)
{
case Object.POP:
tp = "fr";
break;
case Object.TLT:
tp = "tlt";
break;
case Object.Ara:
tp = "ara";
break;
case Object.Msg:
tp = "msg";
break;
case Object.Lbl:
tp = "lb";
break;
default:
tp = "gly";
}
if(cont[tp] == undefined)
{
if(tp == "fr")
{
if(cont.tlt)
{
removeMovieClip(cont.tlt);
}
}
m.fre = this.fre = cont.createMc(tp,x,y);
var tip = tip || Object.Glyph;
this.fre.transform(tip);
this.fre.cntconstruct();
this.fre.bgconstruct();
this.poz(this.fre,x,y);
return true;
}
return false;
};
fp.bgconstruct = function()
{
var cine = this.fre;
w = this.wid;
h = this.hig;
var fundal = cine.createMc("fundal",0,0);
mfundal.transform(Object.BaseObject);
fundal.swapDepths(this.cont);
fundal.transform(Object.BaseObject);
fundal.msetRGB(this.obj.getAttribute("cl2") || "0x466099");
var c1 = fundal.attachCmp("c1","colt1",Object.BaseObject,0,0,args);
if(c1 == undefined)
{
c1 = fundal.rectangle("colt1",0,0,15,15);
}
var c3 = fundal.attachCmp("c3","colt3",Object.BaseObject,w,h,args);
if(c3 == undefined)
{
c3 = fundal.rectangle("colt3",w,h,15,15);
}
var c4 = fundal.attachCmp("c4","colt4",Object.BaseObject,0,h,args);
if(c4 == undefined)
{
c4 = fundal.rectangle("colt4",0,h,15,15);
}
var c2 = fundal.attachCmp("c2","colt2",Object.BaseObject,w,0,args);
if(c2 == undefined)
{
c2 = fundal.rectangle("colt2",w,0,15,15);
}
var d1 = fundal.rectangle("dr1",c1._width,c1._y,c2._x - c1._x - c1._width,c1._height,16777215);
var d2 = fundal.rectangle("dr2",c2._x,c2._y + c2._height,c2._width,c3._y - c2._y - c2._height);
var d3 = fundal.rectangle("dr3",c4._width,c4._y,c3._x - c4._x - c4._width,c4._height,16777215);
var d4 = fundal.rectangle("dr4",0,c1._height,c1._width,c4._y - c1._y - c4._height,16777215);
var centru = fundal.rectangle("centru",c1._width - 1,c1._height - 1,c2._x - c1._x - c1._width + 2,c4._y - c1._y - c1._height + 2,16777215);
fundal.onPress = null;
fundal.enabled = false;
return fundal;
};
fp.poz = function(cine, x, y)
{
var stw = 1024;
var sth = 718;
if(x + cine._width > stw)
{
x -= cine._x + cine._width - stw;
}
if(y + cine._height > sth)
{
y -= cine._y + cine._height - sth + 40;
}
cine.setLocation(x,y);
};
fp.vis_link = function()
{
this.vlink = this.fre.vlink = new Object.VL(this.fre);
};
fp.kill = function(cine)
{
this.bara.fadez.kill();
removeMovieClip(this.vlink.layer);
removeMovieClip(this);
fscommand("show");
getURL("FSCommand:appletDo",1);
};
delete fp;
Object.PlayCtrlX = function(xFile)
{
ASBroadcaster.initialize(this);
var xi = new Object.XMLloader(xFile,this);
};
Object.PlayCtrlX.prototype.swXmlLoaded = function(xmlSA)
{
this.xmlSA = xmlSA;
this.movies = this.xmlSA.movie;
this.mcMomArr = new Array();
this.mcMovMomArr = new Array();
this.mcMomTitArr = new Array();
this.mcMovArr = new Array();
this.cStopMoments = new Array();
this.type = parseInt(this.xmlSA.attributes.type);
this.broadcastMessage("xmlLoaded",this);
this.parent = eval(this.xmlSA.attributes.parent);
this.mainCnt = this.parent._container_;
this.__miniTile__ = this.parent.minititle;
this.parent.title__.text = this.xmlSA.attributes.title;
this.evCntrl = null;
if(this.type <= 2)
{
var pCont = eval(this.parent + "." + this.xmlSA.attributes.play);
var pCr = pCont.attachMc("play_ctrl","_play_cntrl_",0,0);
this.playMcCntrl = new Object.PlayButton(pCr.playMc,this);
this.evCntrl = new Object.EvCntrl(pCont,this);
if(this.type == 1)
{
pCr.rollover.onRollOver = function()
{
_root.menu.gotoAndPlay("start");
this.enabled = false;
};
}
else if(this.type == 2)
{
pCr.rollover.master = this;
pCr.rollover.onRelease = function()
{
this.master.playMv(0);
};
}
}
else
{
this.parent.bottom.bg._visible = false;
this.parent.bottom.bar_h._visible = false;
this.parent.bottom.bar_over_h._visible = false;
}
if(this.type == 1)
{
this.movingMc = new Object.MomentsBar(eval(this.parent + "." + this.xmlSA.attributes.moving),this);
}
var x = 0;
while(x < this.movies.length)
{
var y = 0;
while(y < this.movies[x].moment.length)
{
if(this.movies[x].moment[y].attributes.type == 1)
{
this.mcMomTitArr.push(this.movies[x].moment[y].attributes.title);
this.mcMovArr.push(x);
this.mcMovMomArr.push(y);
}
y++;
}
x++;
}
this.parent.playCntrlLoaded();
this.mcMovThr = setInterval(this,"initMov",100,0);
};
Object.PlayCtrlX.prototype.initMov = function(plMv, type)
{
if(this.cLoadedMovie !== this.movies[this.mcMovArr[plMv]].attributes.src)
{
if(this.cLevel != null)
{
var lev = this.cLevel;
this.oldLevel = this.cLevel;
}
var newLevel = this.mainCnt.createMc("_loaded_" + plMv,0,0);
loadMovie(this.movies[this.mcMovArr[plMv]].attributes.src,newLevel);
this.cLoadedMovie = this.movies[this.mcMovArr[plMv]].attributes.src;
this.onStopMoment = false;
this.cStopMoments = new Array();
var myCMoment = this.movies[this.mcMovArr[plMv]].moment[this.mcMovMomArr[plMv]].getValue();
var m = 0;
while(m < this.movies[this.mcMovArr[plMv]].moment.length)
{
var myM = this.movies[this.mcMovArr[plMv]].moment[m].getValue();
this.cStopMoments.push(myM);
m++;
}
this.cLevel = newLevel;
this.nLevel = plMv;
}
var lev = this.cLevel;
lev.gotoAndStop(1);
var part = lev.getBytesLoaded();
var total = lev.getBytesTotal();
if(part > 0 && total / part == 1)
{
if(undefined != this.oldLevel)
{
trace("unload: " + this.oldLevel);
unloadMovie(this.oldLevel);
this.oldLevel = null;
}
clearInterval(this.mcMovThr);
this.mcMovThr = null;
this.change(lev);
if(this.cStopMoments[0] != 1 && this.movies[this.mcMovArr[plMv]].attributes.src != this.movies[this.mcMovArr[plMv - 1]].attributes.src && type != 1)
{
trace("play intro");
lev.gotoAndPlay(1,this);
}
else
{
this.playMv(plMv);
}
}
};
Object.PlayCtrlX.prototype.change = function(lev)
{
lev.__playing__ = new Boolean();
ASBroadcaster.initialize(lev);
lev.addListener(this);
lev.master = this;
lev.__plCntrl__ = this;
Object.film = lev;
lev.old_stop = lev.stop;
ASSetPropFlags(lev,stop,0,4);
lev.stop = function()
{
if(arguments[0] != this.__plCntrl__ && this.__plCntrl__.type < 3)
{
trace("Bad Stop!");
return undefined;
}
this.old_stop();
this.__playing__ = false;
this.broadcastMessage("mcstop");
};
lev.old_play = lev.play;
ASSetPropFlags(lev,stop,0,4);
lev.play = function()
{
if(arguments[0] != this.__plCntrl__ && this.__plCntrl__.type < 3)
{
trace("Bad Play!");
return undefined;
}
this.old_play();
this.__playing__ = true;
this.broadcastMessage("mcplay");
};
lev.old_gotoAndPlay = lev.gotoAndPlay;
ASSetPropFlags(lev,gotoAndPlay,0,4);
lev.gotoAndPlay = function()
{
if(arguments[1] != this.__plCntrl__ && this.__plCntrl__.type < 3)
{
trace("Bad gotoAndPlay! " + arguments[0]);
return undefined;
}
this.old_gotoAndPlay(arguments[0]);
this.__playing__ = true;
this.broadcastMessage("mcgotoAndPlay",arguments[0]);
};
lev.old_gotoAndStop = lev.gotoAndStop;
ASSetPropFlags(lev,gotoAndStop,0,4);
lev.gotoAndStop = function()
{
if(arguments[1] != this.__plCntrl__ && this.__plCntrl__.type < 3)
{
trace("Bad gotoAndStop! " + arguments[0]);
return undefined;
}
this.old_gotoAndStop(arguments[0]);
this.__playing__ = false;
this.broadcastMessage("mcgotoAndStop",arguments[0]);
};
lev.transform(Object.BaseObject);
lev.oldEnterFrame = lev.onEnterFrame;
lev.onEnterFrame = function()
{
lev.oldEnterFrame();
this.__plCntrl__.loadedMovieIsAtFrame(this.__plCntrl__.cLevel._currentframe);
};
lev.isPlaying = function()
{
return this.__playing__;
};
Object.film = lev;
if(Object.component.behaviour == 0)
{
var xi = new Object.XMLloader(this.movies[this.mcMovArr[this.nLevel]].attributes.csrc,lev);
lev.swXmlLoaded = function(xmlSA)
{
Object.contentFerXml = new Object.ferestreXml(xmlSA);
lev.broadcastMessage("update",lev);
Object.__MainPlayControler__.broadcastMessage("update",lev);
};
}
this.parent.newMovieLoaded(lev);
};
Object.PlayCtrlX.prototype.mcstop = function()
{
trace("stoped " + this.cLevel._currentframe);
this.playMcCntrl.setState("Stop");
};
Object.PlayCtrlX.prototype.mcplay = function()
{
trace("play " + this.cLevel._currentframe);
this.playMcCntrl.setState("Play");
};
Object.PlayCtrlX.prototype.mcgotoAndStop = function()
{
trace("gotoAndStop " + arguments[0] + " " + this.cLevel._currentframe);
this.checkM(arguments[0]);
this.playMcCntrl.setState("Stop");
};
Object.PlayCtrlX.prototype.mcgotoAndPlay = function()
{
trace("gotoAndPlay " + arguments[0] + " " + this.cLevel._currentframe);
this.checkM(arguments[0]);
this.playMcCntrl.setState("Play");
};
Object.PlayCtrlX.prototype.loadedMovieIsAtFrame = function(cf)
{
var myClev = this.cLevel;
if(myClev._totalframes == myClev._currentframe)
{
this.stopMc();
var t = this.nLevel;
while(this.movies[this.mcMovArr[t]].attributes.src == this.cLoadedMovie)
{
t++;
}
if(t == this.mcMovArr.length)
{
this.playMcCntrl.setState("Disable");
}
}
if(this.type == 3)
{
return undefined;
}
if(this._lastframe != cf)
{
this.checkM(cf);
}
this._lastframe = cf;
var cf = cf + 1;
if(this.cLevel.isPlaying() == true)
{
var i = 0;
while(i < this.cStopMoments.length)
{
if(cf == this.cStopMoments[i])
{
this.stopMc();
return undefined;
}
i++;
}
}
};
Object.PlayCtrlX.prototype.playMv = function(plMv, type)
{
removeMovieClip(Object.film.fr);
if(this.cLoadedMovie == this.movies[this.mcMovArr[plMv]].attributes.src && this.mcMovThr == null)
{
var myCMoment = this.movies[this.mcMovArr[plMv]].moment[this.mcMovMomArr[plMv]].getValue();
this.cLevel.gotoAndPlay(myCMoment,this);
}
else if(this.mcMovThr == null)
{
this.mcMovThr = setInterval(this,"initMov",100,plMv,type);
this.movingMc.delCurrent();
}
};
Object.PlayCtrlX.prototype.getM2Moments = function(plMv)
{
var nrMM = this.mcMovMomArr.length;
var m = 1;
var cMoment = this.mcMovMomArr[plMv] + 1;
while(this.movies[this.mcMovArr[plMv]].moment[cMoment].attributes.type == 2)
{
m++;
cMoment++;
}
if(m >= 2)
{
this.evCntrl.update(m);
}
else
{
this.evCntrl.hide();
}
};
Object.PlayCtrlX.prototype.playMc = function()
{
removeMovieClip(Object.film.fr);
if(this.cLevel.isPlaying() == true || this.mcMovThr != null)
{
return undefined;
}
var cf = this.cLevel._currentframe;
var tf = this.cLevel._totalframes;
if(cf == tf)
{
if(this.lookAtNextMovieAndSeeIfItIsEnabled_ForCristea(this.nlevel) == false)
{
return undefined;
}
var plMv = this.nLevel;
while(this.movies[this.mcMovArr[plMv]].attributes.src == this.cLoadedMovie)
{
plMv++;
}
if(plMv < this.mcMovArr.length)
{
this.mcMovThr = setInterval(this,"initMov",100,plMv,0);
this.movingMc.delCurrent();
}
else
{
this.playMcCntrl.setState("Disable");
}
}
else if(this.findMainMoment(cf + 1) != null)
{
var c = this.findMainMoment(cf + 1);
if(this.getEnabled(cf + 1) == true)
{
this.cLevel.play(this);
}
else
{
trace("Disabled");
}
}
else
{
if(this.evCntrl.canFill())
{
var i = 0;
while(i < this.cStopMoments.length)
{
if(cf + 1 == this.cStopMoments[i])
{
this.evCntrl.fill();
}
i++;
}
}
this.cLevel.play(this);
}
};
Object.PlayCtrlX.prototype.stopMc = function()
{
if(this.cLevel.isPlaying() == false || this.mcMovThr != null)
{
return undefined;
}
this.cLevel.stop(this);
};
Object.PlayCtrlX.prototype.checkM = function(cf)
{
var m = this.findMainMoment(cf);
if(null != m)
{
var m2Mom = this.getM2Moments(m);
this.movingMc.setCurrent(m);
}
};
Object.PlayCtrlX.prototype.getEnabled = function(cf)
{
var m = this.findMainMoment(cf);
if(null != m)
{
var en = this.movingMc.getEnabled(m);
return en;
}
return false;
};
Object.PlayCtrlX.prototype.setEnabled = function(m)
{
this.movingMc.setEnabled(m);
};
Object.PlayCtrlX.prototype.lookAtNextMovieAndSeeIfItIsEnabled_ForCristea = function()
{
var en = this.movingMc.getEnabled(this.nLevel + 1);
return en;
};
Object.PlayCtrlX.prototype.findMainMoment = function(cf)
{
var mLevel = this.nlevel;
var mMoment = null;
var m = 0;
while(m < this.movies[this.mcMovArr[this.nLevel]].moment.length)
{
if(this.movies[this.mcMovArr[mLevel]].moment[m].attributes.type == 1 && this.movies[this.mcMovArr[this.nLevel]].moment[m].getValue() == cf)
{
mMoment = m;
while(this.movies[this.mcMovArr[mLevel - 1]].attributes.src == this.movies[this.mcMovArr[this.nlevel]].attributes.src)
{
mLevel--;
}
break;
}
m++;
}
if(mMoment != null)
{
var y = mLevel;
while(y < this.mcMovMomArr.length)
{
if(cf == this.movies[this.mcMovArr[this.nLevel]].moment[this.mcMovMomArr[y]].getValue())
{
trace("Found " + y);
return y;
}
y++;
}
}
return null;
};
Object.PlayCtrlX.prototype.registerBO = function(cine)
{
this.addListener(cine);
};
Object.PlayCtrlX.prototype.getAttribute = function(att)
{
if(att == "cl1" or att == "cl2")
{
return "0x" + this.xmlSA.attributes[att];
}
return this.xmlSA.attributes[att];
};
Object.Error = function()
{
trace(arguments[0]);
};
Object.PlayButton = function(instance, cntrl)
{
if("movieclip" == typeof instance)
{
this.playMc = instance;
}
else
{
new Object.Error("initialization error in Object.PlayButton: " + typeOf(instance));
}
if("object" == typeof cntrl)
{
this.playCntrl = cntrl;
}
else
{
new Object.Error("initialization error in Object.PlayButton");
}
this.mcPlayMovThr = setInterval(this,"initPlayMc",100);
};
Object.PlayButton.prototype.initPlayMc = function()
{
clearInterval(this.mcPlayMovThr);
this.myOldRelease = this.playMc.onRelease;
this.playMc.master = this;
this.state = "Pause";
this.playMc.__plCntrl__ = this.playCntrl;
this.playMc.onRelease = function()
{
this.myOldRelease();
if(this.master.state == "Play")
{
this.__plCntrl__.stopMc();
}
else if(this.master.state == "Stop" || this.master.state == "Pause")
{
this.__plCntrl__.playMc();
}
else
{
return undefined;
}
};
};
Object.PlayButton.prototype.setState = function(state)
{
this.playMc.gotoAndStop(state);
this.state = state;
};
Object.MomentsBar = function(cont, cntrl)
{
this.movingMc = cont;
this.cntrl = cntrl;
this.mcMomArr = new Array();
this.mcMomEnabled = new Array();
this.mcMovMomArr = new Array();
this.mcMomTitArr = new Array();
var movies = this.cntrl.xmlSA.movie;
var x = 0;
while(x < movies.length)
{
var y = 0;
while(y < movies[x].moment.length)
{
var toLoad = null;
if(movies[x].moment[y].attributes.type == 1)
{
toLoad = movies[x].moment[y].attributes.src;
var mEnabled = Boolean(mTitle = movies[x].moment[y].attributes.enabled);
this.loadMovieInPlayBar(toLoad,y,movies[x].moment[y].attributes.title,mEnabled);
}
y++;
}
x++;
}
this.mcMomThr = setInterval(this,"initMom",100);
};
Object.MomentsBar.prototype.loadMovieInPlayBar = function(toLoad, cMvMov, mTitle, mEnabled)
{
this.tx != undefined ? (this.tx += 105) : (this.tx = 0);
var tMc = this.movingMc.createMc("__mc" + this.tx,this.tx,0);
this.mcMomArr.push(tMc);
this.mcMomEnabled.push(mEnabled);
this.mcMomTitArr.push(mTitle);
this.mcMovMomArr.push(cMvMov);
loadMovie(toLoad,tMc);
};
Object.MomentsBar.prototype.initMom = function()
{
var total = 0;
var part = 0;
for(var mc in this.mcMomArr)
{
total += this.mcMomArr[mc].getBytesTotal();
part += this.mcMomArr[mc].getBytesLoaded();
}
if(part > 0 && total / part == 1)
{
clearInterval(this.mcMomThr);
var mc = 0;
while(mc < this.mcMomArr.length)
{
this.init(mc);
if(this.mcMomEnabled[mc] == true)
{
this.setEnabled(mc);
}
mc++;
}
}
};
Object.MomentsBar.prototype.setCurrent = function(mc)
{
this.currentMc._x = this.currentMc.x;
this.currentMc._y = this.currentMc.y;
this.currentMc._xscale = this.currentMc._yscale = 100;
this.mcMomArr[mc]._x -= 3;
this.mcMomArr[mc]._y -= 7;
this.mcMomArr[mc]._xscale = 105;
this.mcMomArr[mc]._yscale = 105;
this.currentMc = this.mcMomArr[mc];
};
Object.MomentsBar.prototype.delCurrent = function()
{
this.currentMc._x = this.currentMc.x;
this.currentMc._y = this.currentMc.y;
this.currentMc._xscale = this.currentMc._yscale = 100;
};
Object.MomentsBar.prototype.getEnabled = function(m)
{
return this.mcMomEnabled[m];
};
Object.MomentsBar.prototype.init = function(mc)
{
this.mcMomArr[mc].x = this.mcMomArr[mc]._x;
this.mcMomArr[mc].y = this.mcMomArr[mc]._y;
this.mcMomArr[mc].__mcLnk__ = parseInt(mc);
this.mcMomArr[mc].__plCntrl__ = this.cntrl;
this.mcMomArr[mc].__title__ = this.mcMomTitArr[mc];
this.mcMomArr[mc].oldRollOver = this.mcMomArr[mc].onRollOver;
this.mcMomArr[mc].onRollOver = function()
{
this.oldRollOver();
this.__plCntrl__.__miniTile__.text = this.__title__;
};
this.mcMomArr[mc].oldRollOut = this.mcMomArr[mc].onRollOut;
this.mcMomArr[mc].onRollOut = function()
{
this.oldRollOut();
this.__plCntrl__.__miniTile__.text = "";
};
};
Object.MomentsBar.prototype.setEnabled = function(mc)
{
this.mcMomEnabled[mc] = true;
this.mcMomArr[mc].oldRelease = this.mcMomArr[mc].onRelease;
this.mcMomArr[mc].onRelease = function()
{
this.__plCntrl__.playMv(this.__mcLnk__,1);
};
};
Object.EvCntrl = function(pCont, master)
{
this.miArr = new Array();
this.pCont = pCont;
this.master = master;
this.mv = this.pCont.attachMc("prg____","lgt",0,32);
this.mv._visible = false;
};
Object.EvCntrl.prototype.update = function(nr)
{
this.steps = nr;
this.ev = 60 / nr;
this.cStep = 1;
this.mv._visible = true;
this.fill();
};
Object.EvCntrl.prototype.fill = function()
{
this.fr = this.ev * this.cStep;
this.mv.gotoAndStop(this.fr);
this.cStep = this.cStep + 1;
};
Object.EvCntrl.prototype.canFill = function()
{
if(this.steps > 0 && this.cStep <= this.steps)
{
return 1;
}
return 0;
};
Object.EvCntrl.prototype.hide = function()
{
this.mv._visible = false;
};
Object.POP = function()
{
};
Object.POP["extends"](Object.Glyph);
var POPp = Object.POP.prototype;
POPp.construct = function(cz, sy, tit, x, y, w, h)
{
var tip = Object.POP;
var exist = super.construct(cz,tip,sy,x,y,w,h);
if(exist)
{
this.fre.tit = tit;
this.fre.barconstruct();
this.fre.cont.setSize(this.fre.wid,this.fre.hig - this.fre.bara._height + 10);
this.fre.cont.refreshPane();
}
};
POPp.bgconstruct = function()
{
var fnd = super.bgconstruct();
this.dev = 4;
this.fre.fundal.dr1._y += this.dev;
};
POPp.cntconstruct = function()
{
var cine = this.fre;
var sy = this.sy;
var xoffset = 8;
var yoffset = 10;
var isinlib = false;
var img;
var vspace = this.vspace = Number(Object.contentFerXml.getVarsById(sy)[6][1]) || 10;
if(Object.library[sy].img == undefined)
{
img = Object.contentFerXml.getVarsById(sy)[6][0];
}
else
{
img = Object.library[sy].img;
vspace += Object.library[sy].vspace;
}
var c = cine.attachMc("FScrollPaneSymbol","cont",xoffset,yoffset);
c.boundingBox_mc.transform(Object.BaseObject);
c.boundingBox_mc.msetRGB("0xffffff");
c.setScrollContent("work_load");
c.setDragContent(false);
c.tmp_mc.transform(Object.BaseObject);
c.tmp_mc.rectangle("spacer",0,0,this.wid,10,"0xffffff");
if(img != undefined)
{
if(img.indexOf(".") == -1)
{
isinlib = true;
img = img.substr(img.lastIndexOf("/") + 1);
var i = c.tmp_mc.attachMc(img,"imag",10,10);
vspace += i._height;
}
else
{
var i = c.tmp_mc.loadImg(img,"imag",10,10);
}
}
if(Object.component.behaviour == 1)
{
c.tmp_mc.attachMc("mc" + sy,"txt",10,vspace);
}
else
{
if(!isinlib)
{
c.tmp_mc.onLoadImg = function()
{
vspace += i._height;
c.tmp_mc.write(Object.contentFerXml.getVarsById(sy)[5],10,vspace);
this._parent._parent.onLoadCnt();
c.refreshPane();
};
}
else
{
c.tmp_mc.write(Object.contentFerXml.getVarsById(sy)[5],10,vspace);
}
if(img == undefined)
{
c.tmp_mc.write(Object.contentFerXml.getVarsById(sy)[5],10,vspace);
}
}
this.wid = c.tmp_mc._width + 30;
return c;
};
POPp.barconstruct = function()
{
var cine = this.fre;
var culoare = this.obj.getAttribute("cl1") || "0xccaacc";
var xoffset = 10;
var yoffset = 10;
var bara = cine.createMc("bara",cine.fundal.colt1._width,2);
bara.transform(Object.BaseObject);
var bc1 = bara.attachCmp("b_c_1","colt1",Object.BaseObject,0,0,args);
if(bc1 == undefined)
{
bc1 = bara.rectangle("colt1",0,0,15,25,culoare);
}
bc1.msetRGB(culoare);
var bc2 = bara.attachCmp("b_c_2","colt2",Object.BaseObject,cine.fundal.colt2._x - cine.fundal.colt1._x - cine.fundal.colt1._width,0,args);
if(bc2 == undefined)
{
bc2 = bara.rectangle("colt2",cine.fundal.colt2._x - cine.fundal.colt1._x - cine.fundal.colt1._width,0,15,25,culoare);
}
bc2._x -= bc2._width;
bc2.msetRGB(culoare);
var r = bara.rectangle("bar",bc1._width,0,bc2._x - bc1._x - bc1._width,bc1._height,culoare);
var cls_e = cine.attachCmp("close_er","cls_er",Object.BaseObject,cine.fundal.colt2._x,bara._y + bara._height / 2);
cls_e.cls.onPress = function()
{
bara._parent.kill(cine);
if(cine.blk != undefined)
{
cine.blk.removeMovieClip();
}
};
cine.cont._y = bara._height + bara._y + this.dev;
this.setTitle(this.tit);
bara.onPress = function()
{
bara.fade(1,60,60);
this.dx = _xmouse - bara._parent._x;
this.dy = _ymouse - bara._parent._y;
this.che = Object.film.createMc("chenar",bara._parent._x,bara._parent._y);
this.che.transform(Object.BaseObject);
this.che.rec_outline("chenar",0,0,bara._parent.fundal._width,bara._parent.fundal._height,13421772);
startDrag(this.che,0,0,36,1024 - this.che._width,768 - this.che._height - 30);
};
bara.onRollOver = function()
{
bara.fade(1,95,60,true);
};
bara.onRollOut = function()
{
bara.fade(1,bara._alpha,100,true);
};
bara.onReleaseOutside = bara.onRelease = function()
{
bara.fade(1,bara._alpha,100,true);
bara._parent._x = this.che._x;
bara._parent._y = this.che._y;
removeMovieClip(this.che);
bara._parent.vlink.update();
};
bara.fade(1,40,100,true);
return bara;
};
POPp.setTitle = function(tit, culoare)
{
var culoare = culoare || this.bara._parent.obj.getAttribute("cl2");
var fnt = this.bara._parent.obj.getAttribute("font");
if(this.bara.mytext != undefined)
{
this.bara.mytext.removeTextField();
}
this.bara.createTextField("mytext",this.nextDepth(),5,3,this.bara._width - 30,35);
with(this.bara)
{
myformat = new TextFormat();
myformat.color = 16777215;
myformat.font = "eLearning_Black";
myformat.size = "14";
myformat.bold = true;
mytext._alpha = 100;
mytext.multiline = true;
mytext.type = "dynamic";
mytext.html = true;
mytext.wordWrap = true;
mytext.selectable = false;
mytext.embedFonts = true;
mytext.htmlText = tit;
mytext.setTextFormat(myformat);
}
};
POPp.poz = null;
POPp.vis_link = null;
Object.MO = function(id)
{
this.init(id);
};
Object.MO.tip = "MouseInteraction";
Object.MO["extends"](Object.BaseObject);
var MOp = Object.MO.prototype;
MOp.init = function(id)
{
this.behave();
this.parseID(id);
ASBroadcaster.initialize(this);
this.b_manager = new Object();
this.b_manager.ids = new Object();
this.b_manager.ids.id = 0;
};
MOp.addEvent = function(type, funct)
{
var c = this.b_manager[this.b_manager.ids.id++] = new Object();
c[type] = funct;
this.addListener(c);
};
MOp.behave = function()
{
this.onPress = function()
{
this.BroadcastMessage("onpress",this);
};
this.onRollOver = function()
{
this.BroadcastMessage("onrollover",this);
};
this.onRollOut = function()
{
this.BroadcastMessage("onrollout",this);
};
this.onRelease = function()
{
this.BroadcastMessage("onrelease",this);
};
};
MOp.parseID = function(id)
{
var set_id = new Object();
prs2 = function(id)
{
switch(id.substring(0,1))
{
case "f":
set_id.fer = id;
return set_id.fer;
case "t":
set_id.tlt = id;
return set_id.tlt;
case "p":
set_id.fer = id;
this.make_group(id);
return set_id.fer;
case "m":
set_id.msg = id;
return set_id.msg;
default:
trace(id + " - parametru introdus incorect!");
}
};
var v = id;
var i;
var j;
var par = new Array();
while(i < v.length)
{
if(isNaN(parseInt(v.charAt(i))))
{
if(j >= 2)
{
break;
}
j++;
par[j - 1] = v.charAt(i);
}
else
{
par[j - 1] += v.charAt(i);
}
i++;
}
for(var k in par)
{
if(par[k].length < 2)
{
trace(par[k] + " - parametru introdus incorect");
break;
}
prs2(par[k]);
}
if(set_id.fer != undefined)
{
this.id_fer = set_id.fer;
}
if(set_id.tlt != undefined)
{
this.id_tlt = set_id.tlt;
}
if(set_id.msg != undefined)
{
this.id_msg = set_id.msg;
}
return set_id;
};
MOp.make_group = function(id)
{
trace("referinta este " + this.cz);
if(!Object.arahnides)
{
Object.arahnides = new Object();
}
if(!Object.arahnides[id])
{
Object.arahnides[id] = new Object();
Object.arahnides[id].content = new Array();
Object.arahnides[id].content[0] = this.cz;
}
else
{
Object.arahnides[id].content.push(this.cz);
}
};
Object.CZ = function(id)
{
this.init(id);
};
Object.CZ.tip = "ClickableZone";
Object.CZ["extends"](Object.MO);
var CZp = Object.CZ.prototype;
CZp.init = function(id)
{
this.useHandCursor = false;
if(id == undefined)
{
trace("Nu a fost introdus ID in " + this);
return undefined;
}
super.init(id);
if(this.id_tlt != undefined)
{
this.addEvent("onrollover",this.tltp);
this.addEvent("onrollout",this.dtltp);
}
if(this.id_fer != undefined)
{
this.addEvent("onpress",this.fer);
this.addEvent("onrollover",this.label);
this.addEvent("onrollout",this.dlabel);
this.addEvent("onpress",this.dlabel);
}
};
CZp.label = function(cine)
{
Object.film.attachMovie("palma","cursor_palma",123);
Mouse.hide();
with(Object.film.cursor_palma)
{
_rotation = -135;
_xscale = _yscale = 30;
}
Object.film.cursor_palma.startDrag(true);
Object.film.cursor_palma.onMouseMove = function()
{
updateAfterEvent();
};
};
CZp.dlabel = function()
{
Mouse.show();
Object.film.cursor_palma.removeMovieClip();
};
CZp.fer = function(cine)
{
fscommand("ascund");
getURL("FSCommand:appletDo",0);
var cine = cine || this;
this.cz = cine;
var sy = cine.id_fer;
if(Object.component.behaviour == 1)
{
var f = Object.library[sy];
if(sy != undefined)
{
if(sy.substring(0,1) == "f")
{
new Object.POP().construct(cine,sy,f.title,f.x,f.y,f.width,f.height);
}
else
{
new Object.Ara().construct(cine,sy,f.title,f.x,f.y,f.width,f.height);
}
}
}
else if(sy != undefined)
{
var parametrii = Object.contentFerXml.getVarsById(sy);
if(sy.substring(0,1) == "f")
{
new Object.POP().construct(cine,sy,parametrii[4],parametrii[0],parametrii[1],parametrii[2],parametrii[3]);
}
else
{
new Object.Ara().construct(cine,sy,parametrii[4],parametrii[0],parametrii[1],parametrii[2],parametrii[3]);
}
}
};
CZp.tltp = function(cine)
{
this.yoff = 15;
this.xoff = 10;
var cine = cine || this;
this.cz = cine;
var sy = cine.id_tlt;
if(Object.component.behaviour == 1)
{
var tx = Object.library[sy].text;
if(tx != undefined)
{
cine.tooltip = new Object.TLT().construct(cine,tx,_level0._xmouse + this.xoff,_level0._ymouse + this.yoff);
}
}
else if(sy != undefined)
{
var tx = Object.contentFerXml.getTooltipById(cine.id_tlt);
cine.tooltip = new Object.TLT().construct(cine,tx,_xmouse + this.xoff,_ymouse + this.yoff);
}
};
Czp.dtltp = function(cine)
{
Object.film.tlt.fadez.kill();
removeMovieClip(Object.film.tlt);
};
Object.Btn = function(id)
{
this.init(id);
};
Object.Btn.tip = "button_zone";
Object.Btn["extends"](Object.MO);
var Bp = Object.Btn.prototype;
Bp.init = function(id)
{
super.init(id);
this.addEvent("onrollover",this.rlov);
this.addEvent("onrollout",this.rlou);
this.addEvent("onpress",this.down);
this.addEvent("onrelease",this.rlou);
};
Bp.setText = function(tx)
{
this.Label = tx;
};
Bp.getText = function()
{
return this.Label;
};
Bp.rlov = function(cine)
{
var cine = cine || this;
cine.gotoAndStop("over");
};
Bp.rlou = function(cine)
{
var cine = cine || this;
cine.gotoAndStop("up");
};
Bp.down = function(cine)
{
var cine = cine || this;
cine.gotoAndStop("down");
};
Object.TLT = function()
{
};
Object.TLT["extends"](Object.Glyph);
var TLTp = Object.TLT.prototype;
TLTp.construct = function(cz, sy, x, y)
{
if(sy == undefined)
{
return undefined;
}
var tip = Object.TLT;
var exist = super.construct(cz,tip,sy,x,y,w,h);
};
TLTp.cntconstruct = function()
{
var cine = this;
var tx = this.sy;
cine.createMc("cont",5,5);
with(cine.cont)
{
var txt = Function.replaceFunny(tx);
var w = 250;
myformat = new TextFormat();
myformat.bold = true;
myformat.font = "eLEARNING_Medium";
myformat.size = 25;
myformat.bullet = false;
createTextField("mytext",1,0,0,5,10);
mytext.autoSize = "left";
mytext.type = "dynamic";
mytext.selectable = false;
mytext.html = true;
mytext.wordWrap = true;
mytext.setTextFormat(myformat);
mytext.htmlText = txt;
mytext.embedFonts = true;
}
var w = cine.cont.mytext.textWidth;
if(w > 250)
{
w = 250;
}
else
{
w += 30;
}
cine.cont.mytext._width = w;
this.wid = w;
this.hig = cine.cont.mytext._height - 10;
};
TLTp.bgconstruct = function()
{
var fnd = super.bgconstruct();
fnd.fade(2,50,100,true);
};
TLTp.poz = function(cine, x, y)
{
var stw = 1024;
var sth = 718;
if(x + cine._width > stw)
{
x -= cine._x + cine._width - stw;
}
if(y + cine._height > sth)
{
trace("situatie anormala" + this.fre);
y = _ymouse - 10 - this.fre._height;
}
cine.setLocation(x,y);
};
TLTp.vis_link = null;
Object.Msg = function()
{
};
Object.Msg.tip = "Messages";
Object.Msg["extends"](Object.Glyph);
var Mp = Object.Msg.prototype;
Mp.construct = function(sy, tit, ico, exe)
{
fscommand("ascund");
getURL("FSCommand:appletDo",0);
var tip = Object.Msg;
var x = x || 100;
var y = y || 200;
var m = this.__proto__;
m.icon = ico;
m.wid = w;
m.exe = exe;
m.hig = h;
m.ico = ico;
var exist = super.construct(cz,tip,sy,x,y,w,h);
if(exist)
{
this.fre.tit = tit;
this.cont.boundingBox_mc._visible = false;
this.bar = this.fre.barconstruct(this.fre,tit,w,h,x,y);
this.fre.cont.boundingBox_mc._visible = false;
this.bt_ok();
this.centrez(this.fre);
this.fnc_blc();
return true;
}
return false;
};
Mp.bgconstruct = Object.POP.prototype.bgconstruct;
Mp.barconstruct = Object.POP.prototype.barconstruct;
Mp.setTitle = Object.POP.prototype.setTitle;
Mp.icoconstruct = function(cine)
{
var margine = 15;
var ico = cine.attachMc(this.icon,"icn",0,0);
ico._x += margine;
ico._y += margine;
return ico;
};
Mp.bt_ok = function()
{
var eu = this.fre;
var margine = 4;
var ms = 30;
var mj = 15;
var inchid = eu.createMc("shell",0,eu._height);
var bg = inchid.createMc("bkgrnd");
bg.transform(Object.BaseObject);
var buton = inchid.attachMc("ok_er","k_er",2,2);
var clt = bg.attachMc("c4","colt",0,0);
inchid._x = eu.fundal._width - buton._width - margine * 2;
inchid._y = eu.fundal._height - buton._height - clt._height;
clt._y = buton._height - clt._height / 2 - margine / 2;
bg.rectangle("r1",bg.colt._x + bg.colt._width,bg.colt._y,eu.fundal._width - inchid._x - bg.colt._width,bg.colt._height);
bg.rectangle("r2",0,0,bg._width,bg.r1._y + 1);
bg.msetRGB(this.obj.getAttribute("cl1") || "0x466099");
bg.fade(2,50,100,true);
buton.ok.onPress = function()
{
eu.kill(eu);
eu.blk.removeMovieClip();
eu.exe();
};
};
Mp.cntconstruct = function()
{
var eu = this.fre;
var tx = this.sy;
eu.createMc("cont",0,eu.bara._height + 5);
var ico = this.icoconstruct(eu.cont);
var in_space = 15;
var up_space = 10;
var margine = 30;
if(Object.component.behaviour == 1 and this.checkMsg())
{
eu.cont.attachMc("mc" + tx,"txt",ico._width + ico._x + in_space,up_space);
this.wid = this._width + margine / 2;
this.hig = this._height + margine * 3;
return undefined;
}
var txte = eu.cont.createMc("txbox",ico._width + ico._x + in_space,up_space);
txte.transform(Object.BaseObject);
with(txte)
{
var txt = Function.replaceFunny(tx);
if(tx.length > 1)
{
var w = 250;
}
else
{
w = 10;
}
myformat = new TextFormat();
myformat.bold = true;
myformat.font = "eLEARNING_Black";
myformat.size = 14;
myformat.bullet = false;
createTextField("mytext",1,0,0,w,10);
mytext.autoSize = "left";
mytext.type = "dynamic";
mytext.selectable = false;
mytext.html = true;
mytext.wordWrap = true;
mytext.setTextFormat(myformat);
mytext.embedFonts = true;
mytext.text = txt;
mytext.htmlText = txt;
mytext.setTextFormat(myformat);
}
if(txte.mytext._height < ico._height)
{
this.hig = ico._height + margine * 3;
}
else
{
this.hig = txte.mytext._height + margine * 3;
ico._y = txte._y + txte._height / 2 - ico._height / 2;
}
this.wid = this._width;
};
Mp.centrez = function(cine)
{
cine._x = Stage.width / 2 - cine._width / 2;
cine._y = Stage.height / 2 - cine._height / 2;
};
Mp.checkMsg = function()
{
if(this.sy.substring(0,1) == "m" and !isNaN(this.sy.substring(1,2)))
{
return true;
}
return false;
};
Mp.fnc_blc = function()
{
var blk = this.cnt.rectangle("blocker",0,0,Stage.width,Stage.height,16777215);
this.fre.blk = blk;
blk.swapDepths(this.fre);
blk.transform(Object.BaseObject);
blk.fade(3,20,40,true);
blk.onPress = function()
{
};
blk.enabled = false;
};
Mp.vis_link = null;
delete Mp;
_global.mesaj = function(mesaj, titlu, icon, exe)
{
var parseID = Object.MO.prototype.parseID;
if(mesaj.substring(0,1) == "#")
{
mesaj = mesaj.substring(1,mesaj.length);
}
else
{
var simb = parseID(mesaj);
var sy = simb.msg;
if(Object.component.behaviour == 1)
{
mesaj;
if(icon == undefined or icon == "")
{
icon = Object.library[sy].img;
}
if(titlu == undefined or titlu == "")
{
titlu = Object.library[sy].title;
}
}
else
{
mesaj = Object.contentFerXml.getVarsById(sy)[5];
if(titlu == undefined or titlu == "")
{
titlu = Object.contentFerXml.getVarsById(sy)[4];
}
if(icon == undefined or icon == "")
{
icon = Object.contentFerXml.getVarsById(sy)[6][0];
}
}
}
if(mesaj == undefined or mesaj == "")
{
mesaj = "Introduce├╛i mesajul dorit !";
}
if(titlu == undefined or titlu == "")
{
titlu = "Aten├╛ie !";
}
if(icon == undefined or icon == "")
{
icon = "icon_alert";
}
return new Object.Msg().construct(mesaj,titlu,icon,exe);
};
Object.VL = function(cine)
{
this.fer = cine;
this.kill();
this.construct();
this.layer.mcImplements(Object.VL);
};
var vp = Object.VL.prototype;
vp.construct = function()
{
this.layer = Object.film.createEmptyMovieClip("v_link",900);
this.layer.transform(Object.BaseObject);
this.layer.swapDepths(this.fer);
this.update();
updateAfterEvent();
};
vp.update = function()
{
var xdif = 15;
var ydif = 20;
var cine = this.fer;
this.clear();
this.l1 = this.layer.line("linie1",cine.cz._x,cine.cz._y,cine._x - xdif,cine.cz._y,this.fer.obj.getAttribute("cl1"));
this.l2 = this.layer.line("linie2",cine._x - xdif,cine.cz._y,cine._x - xdif,cine._y + ydif,this.fer.obj.getAttribute("cl1"));
this.l3 = this.layer.line("linie3",cine._x - xdif,cine._y + ydif,cine._x,cine._y + ydif,this.fer.obj.getAttribute("cl1"));
};
vp.clear = function()
{
removeMovieClip(this.l1);
removeMovieClip(this.l2);
removeMovieClip(this.l3);
};
delete vp;
XML.prototype.getElementsByTagName = function(targetName)
{
function diverDown(node, targetName)
{
var nodeList = node.childNodes;
var i = 0;
while(i < nodeList.length)
{
if(nodeList[i].nodeType == 1 && nodeList[i].hasChildNodes)
{
if(nodeList[i].nodeName == targetName)
{
var n = 0;
while(n < nodeList[i].parentNode.childNodes.length)
{
if(nodeList[i].parentNode.childNodes[n].nodeName == targetName)
{
returnValue[index] = nodeList[i].parentNode.childNodes[n];
index++;
}
n++;
}
return undefined;
}
diverDown(nodeList[i],targetName);
}
i++;
}
index = 0;
}
var index = 0;
var returnValue = new Array();
diverDown(this,targetName);
if(returnValue.length == 0)
{
returnValue = null;
}
return returnValue;
};
XML.prototype.findRootNode = function(XMLNode)
{
var nd = null;
trace("in findRootNode");
nd = XMLNode.parentNode;
while(nd != null)
{
XMLNode = nd;
nd = nd.parentNode;
}
return XMLNode;
};
Object.XMLloader = function(lXML, creator)
{
this.creator = creator;
this.cXML = new XML();
this.cXML.ignoreWhite = true;
this.cXML.parent = this;
this.cXML.onLoad = function(success)
{
if(success)
{
this.parent.xmlSA = new Object.XMLSA(this);
}
else
{
trace("error=" + this.status);
}
};
this.cXML.load(lXML);
this.thr = setInterval(this,"checkState",100);
};
Object.XMLloader.prototype.checkState = function()
{
if(this.xmlSA != null)
{
this.creator.swXmlLoaded(this.xmlSA);
clearInterval(this.thr);
}
};
Object.XMLSA = function(watchXML)
{
if(watchXML != undefined)
{
this.parse(watchXML,true);
}
};
Object.XMLSA.prototype.getValue = function()
{
if(this.__xml.firstChild.nodeType == 1)
{
var ret = "";
var t = 0;
while(t < this.__xml.childNodes.length)
{
ret += this.__xml.childNodes[t];
t++;
}
return ret;
}
var ret = "";
var t = 0;
while(t < this.__xml.childNodes.length)
{
ret += this.__xml.childNodes[t];
t++;
}
return ret;
};
Object.XMLSA.prototype.setValue = function(text)
{
this.__xml.firstChild.nodeValue = text;
};
Object.XMLSA.prototype.parse = function(node, replaceRoot)
{
if(replaceRoot)
{
this.__root = node;
node = node.firstChild;
}
this.__xml = node;
this.attributes = node.attributes;
if(node.nodeType == 1 and node.firstChild.nodeType == 1)
{
var childCounter = 0;
while(childCounter < node.childNodes.length)
{
var tempName = node.childNodes[childCounter].nodeName;
if(this[tempName] == undefined)
{
this[tempName] = new Array();
}
var tempIndex;
tempIndex = this[tempName].push(new Object.XMLSA());
this[tempName][tempIndex - 1].parse(node.childNodes[childCounter]);
childCounter++;
}
}
};
Object.PlayStopClass = function()
{
ASBroadcaster.initialize(this);
this.movie = this._parent[this._targetInstanceName];
this.check();
this.init();
this.attachEvents();
};
Object.PlayStopClass.prototype = new MovieClip();
Object.PlayStopClass["extends"](MovieClip);
Object.PlayStopClass.prototype.check = function()
{
if("function" != typeof this.movie.isPlaying)
{
trace("error:in PlayStop mc must implement Boolean isPlaying()");
}
};
Object.PlayStopClass.prototype.init = function()
{
if("function" != typeof this.playHandler.setState)
{
this.playHandler.setState = function(arg)
{
this.gotoAndPlay(arg);
};
}
if(this.loop == true)
{
trace("loop enabled");
}
ASBroadcaster.initialize(this.movie);
this.movie.addListener(this);
this.movie.master = this;
this.movie.old_stop = this.movie.stop;
ASSetPropFlags(this.movie,"stop",0,4);
this.movie.stop = function()
{
this.old_stop();
this.isPlaying();
this.broadcastMessage("mcStoped","broadcast");
};
};
Object.PlayStopClass.prototype.attachEvents = function()
{
this.playHandler.master = this;
this.playHandler.onRelease = function()
{
if(this.master.movie.isPlaying())
{
if(this.master.getContinuous() == true)
{
this.master.setContinuous(false);
}
this.master.movie.stop();
this.setState("stop");
}
else
{
this.master.movie.play();
this.setState("play");
}
};
this.checkBox.setChangeHandler("setContinuousCb");
};
Object.PlayStopClass.prototype.dettachEvents = function()
{
this.playHandler.onRelease = function()
{
trace("disabled");
};
};
Object.PlayStopClass.prototype.mcStoped = function()
{
if(this.movie._currentframe == this.movie._totalframes && true == this.loop)
{
this.movie.play();
}
else if(true == this.getContinuous() && this.movie._currentframe != this.movie._totalframes)
{
this.movie.play();
}
else
{
this.playHandler.setState("stop");
}
};
Object.PlayStopClass.prototype.getContinuous = function()
{
return this.checkBox.getValue();
};
Object.PlayStopClass.prototype.setContinuous = function()
{
this.checkBox.setValue(false);
};
Object.PlayStopClass.prototype.setContinuousCb = function()
{
if(true == this.getContinuous() && this.movie._currentframe != this.movie._totalframes && false == this.movie.isPlaying())
{
this.movie.play();
this.playHandler.setState("play");
}
this.broadcastMessage("loop",this.getLoop());
};
Object.PlayStopClass.prototype.setState = function(arg)
{
};
var AutorFereastraClass = Object.AutorFereastraClass = function()
{
this.path = "";
var myLv = targetPath(this);
this.tscr._visible = false;
this.behaviour = Object.component.behaviour;
this._parent.addListener(this);
Object.__MainPlayControler__.addListener(this);
this.width = this._width;
this.height = this._height;
this._xscale = this._yscale = 100;
this.cLevel = eval(myLv.substring(0,myLv.indexOf(".")));
if(this._width != undefined && this._height != undefined && this.id != undefined)
{
this.update();
}
else
{
trace("w: " + this._width + "\nh: " + this._height + "\nid: " + this.Id);
}
};
AutorFereastraClass.prototype = new MovieClip();
AutorFereastraClass["extends"](MovieClip);
AutorFereastraClass.prototype.setSize = function(w, h)
{
this.width = w;
this.height = h;
this._xscale = this._yscale = 100;
this.update();
};
AutorFereastraClass.prototype.update = function()
{
this._xscale = this._yscale = 100;
this.show();
};
AutorFereastraClass.prototype.show = function()
{
this.scr._visible = false;
this.scr.removeMovieClip();
this.scr.unloadMovie();
this.attachMc("FScrollPaneSymbol","scr",0,0);
this.scr.setSize(this.width,this.height);
this.behaviour != 1 ? this.xmlShow() : this.libShow();
this.scr.refreshPane();
};
AutorFereastraClass.prototype.xmlShow = function()
{
if(undefined != Object.contentFerXml)
{
var tArr = Object.contentFerXml.getVarsById(this.id);
this.cText = tArr[5];
if(undefined != tArr[6])
{
this.img = tArr[6][0];
this.vspace = parseInt(tArr[6][1]);
}
else
{
this.img = undefined;
}
}
else
{
this.cText = "<font face=\'eLearning Black\'>Loading...</font>";
}
this.scr.setScrollContent("dummy");
var c = this.scr.getScrollContent();
c.clear();
c.lineStyle(2,6719658);
c.drawRect(0,0,this.width - 20,this.height);
c._xscale = c._yscale = 100;
c._y = c._x = 0;
if(undefined != this.img)
{
c.createMc("imgMc",0,0);
this.imgMc = c.imgMc;
c.imgMc.loadMovie(this.path + this.img);
c._visible = false;
var prel = new Object.Preloader(this,c.imgMc);
}
this.textMc = c.write(this.cText,0,0);
c.clear();
};
AutorFereastraClass.prototype.loadComplete = function()
{
var mc = this.scr.getScrollContent();
this.imgMc._x = this.width / 2 - this.imgMc._width / 2;
this.imgMc._y = this.vspace / 2;
this.textMc._y = this.vspace + this.imgMc._height;
this.textMc._x = 5;
mc._visible = true;
};
AutorFereastraClass.prototype.libShow = function()
{
var w = Object.library[this.id].width;
var h = Object.library[this.id].height;
this.scr.setSize(w,h);
this.scr.setScrollContent("mc" + this.id);
};
AutorFereastraClass.prototype.onUnload = function()
{
this.scr._visible = false;
this.scr.removeMovieClip();
this.scr.unloadMovie();
};
AutorFereastraClass.prototype.setxmlSrc = function(xs)
{
this.xmlSrc = xs;
};
AutorFereastraClass.prototype.getSrc = function()
{
return this.xmlSrc;
};
AutorFereastraClass.prototype.setId = function(xid)
{
this.xmlId = xid;
};
AutorFereastraClass.prototype.getId = function()
{
return this.xmlId;
};
AutorFereastraClass.prototype.setWidth = function(w)
{
this.width = w;
};
AutorFereastraClass.prototype.getWidth = function()
{
return this.width;
};
AutorFereastraClass.prototype.setHeight = function(h)
{
this.height = h;
};
AutorFereastraClass.prototype.getHeight = function()
{
return this.height;
};
delete AutorFereastraClass;
var XmlTextBoxClass = Object.XmlTextBoxClass = function()
{
this.path = "";
this.watch("id",function(id, o, n)
{
this.id = n;
this.update();
}
);
var myLv = targetPath(this);
this.tscr._visible = false;
this.behaviour = Object.component.behaviour;
this._parent.addListener(this);
Object.__MainPlayControler__.addListener(this);
this.width = this._width;
this.height = this._height;
this._xscale = this._yscale = 100;
this.cLevel = eval(myLv.substring(0,myLv.indexOf(".")));
if(this._width != undefined && this._height != undefined && this.id != undefined)
{
this.update();
}
else
{
trace("w: " + this._width + "\nh: " + this._height + "\nid: " + this.Id);
}
};
XmlTextBoxClass.prototype = new MovieClip();
XmlTextBoxClass["extends"](MovieClip);
XmlTextBoxClass.prototype.setSize = function(w, h)
{
this.width = w;
this.height = h;
this._xscale = this._yscale = 100;
this.update();
};
XmlTextBoxClass.prototype.update = function()
{
this._xscale = this._yscale = 100;
this.show();
};
XmlTextBoxClass.prototype.show = function()
{
this.scr._visible = false;
this.scr.removeMovieClip();
this.scr.unloadMovie();
this.attachMc("FScrollPaneSymbol","scr",0,0);
this.scr.boundingBox_mc._visible = false;
this.scr.setSize(this.width,this.height);
this.behaviour != 1 ? this.xmlShow() : this.libShow();
this.scr.refreshPane();
};
XmlTextBoxClass.prototype.xmlShow = function()
{
if(undefined != Object.contentFerXml)
{
var tArr = Object.contentFerXml.getVarsById(this.id);
this.cText = tArr[5];
if(undefined != tArr[6])
{
this.img = tArr[6][0];
this.vspace = parseInt(tArr[6][1]);
}
else
{
this.img = undefined;
}
}
else
{
this.cText = "<font face=\'eLEARNING_Black\'>Loading...</font>";
}
this.scr.setScrollContent("dummy");
var c = this.scr.getScrollContent();
c.clear();
c.lineStyle(2,16777215);
c.drawRect(0,0,this.width - 20,this.height);
c._xscale = c._yscale = 100;
c._y = c._x = 0;
if(undefined != this.img)
{
c.createMc("imgMc",0,0);
this.imgMc = c.imgMc;
c.imgMc.loadMovie(this.path + this.img);
c._visible = false;
var prel = new Object.Preloader(this,c.imgMc);
}
this.textMc = c.write(this.cText,0,0);
c.clear();
};
XmlTextBoxClass.prototype.loadComplete = function()
{
var mc = this.scr.getScrollContent();
this.imgMc._x = this.width / 2 - this.imgMc._width / 2;
this.textMc._y = this.vspace + this.imgMc._height;
this.textMc._x = 5;
mc._visible = true;
this.scr.refreshPane();
};
XmlTextBoxClass.prototype.libShow = function()
{
var w = Object.library[this.id].width;
var h = Object.library[this.id].height;
this.scr.setSize(w,h);
this.scr.setScrollContent("mc" + this.id);
};
XmlTextBoxClass.prototype.onUnload = function()
{
this.scr._visible = false;
this.scr.removeMovieClip();
this.scr.unloadMovie();
};
XmlTextBoxClass.prototype.setxmlSrc = function(xs)
{
this.xmlSrc = xs;
};
XmlTextBoxClass.prototype.getSrc = function()
{
return this.xmlSrc;
};
XmlTextBoxClass.prototype.setId = function(xid)
{
this.xmlId = xid;
};
XmlTextBoxClass.prototype.getId = function()
{
return this.xmlId;
};
XmlTextBoxClass.prototype.setWidth = function(w)
{
this.width = w;
};
XmlTextBoxClass.prototype.getWidth = function()
{
return this.width;
};
XmlTextBoxClass.prototype.setHeight = function(h)
{
this.height = h;
};
XmlTextBoxClass.prototype.getHeight = function()
{
return this.height;
};
Function.prototype.replaceFunny = function(str)
{
var s = str.indexOf("@@");
while(s < str.length && s > 0)
{
var c = parseInt(str.substr(s + 2,3));
str = str.substring(0,s) + String.fromCharCode(c) + str.substring(s + 5,str.length);
s = str.indexOf("@@",s);
}
return str;
};
var SwLabelClass = Object.SwLabelClass = function()
{
this.behaviour = Object.component.behaviour;
this._parent.addListener(this);
Object.__MainPlayControler__.addListener(this);
this.createTextField("txLabel",this.nextDepth(),0,0,0,0);
with(this.txlabel)
{
autoSize = "left";
multiline = false;
type = "dynamic";
html = true;
selectable = false;
embedFonts = true;
}
this.update();
};
SwLabelClass.prototype = new MovieClip();
SwLabelClass["extends"](MovieClip);
SwLabelClass.prototype.update = function()
{
this._xscale = this._yscale = 100;
this.behaviour != 1 ? this.xmlShow() : this.libShow();
};
SwLabelClass.prototype.libShow = function()
{
var mtx = Function.replaceFunny(Object.library[this.id].text);
this.txLabel.htmlText = mtx;
this.txLabel._width = this.txLabel.textWidth + 10;
this.txLabel._height = this.txLabel.textHeight;
};
SwLabelClass.prototype.xmlShow = function()
{
if(undefined != Object.contentFerXml)
{
var tArr = Object.contentFerXml.getLabelById(this.id);
this.txLabel.htmlText = tArr[0];
}
else
{
this.txLabel.htmlText = "<font face=\'Arial\'>Loading...</font>";
}
this.txLabel._width = this.txLabel.textWidth + 15;
this.txLabel._height = this.txLabel.textHeight;
};
delete SwLabelClass;
var TestCmpClass = Object.TestCmpClass = function()
{
this._visible = false;
this.arrPlhs = new Array();
this.arrDragsB = new Array();
this.arrDrags = new Array();
this.Id = 0;
};
TestCmpClass.prototype = new MovieClip();
TestCmpClass["extends"](MovieClip);
TestCmpClass.prototype.addRel = function()
{
var drag = arguments.shift();
var btnBeh = arguments.pop();
var strType = arguments.pop();
var plhs = arguments[0];
if(!drag.init_x && typeof drag == "movieclip")
{
drag.mcExtends(Object.DragClassB,this,plhs,strType,btnBeh);
this.setNewDragB(drag);
}
var i = 0;
while(i < plhs.length)
{
if(!plhs[i].init_x)
{
plhs[i].mcExtends(Object.PlhClass,this,strType);
}
this.setNewPlh(plhs[i]);
if(typeof drag == "movieclip")
{
plhs[i].setNewDrag(drag);
}
i++;
}
};
TestCmpClass.prototype.setNewPlh = function(plh)
{
var found = 0;
var i = 0;
while(i < this.arrPlhs.length)
{
if(this.arrPlhs[i] == plh)
{
found = 1;
}
i++;
}
if(!found)
{
this.arrPlhs.push(plh);
}
found = 0;
};
TestCmpClass.prototype.setNewDragB = function(drag)
{
var found = 0;
var i = 0;
while(i < this.arrDragsB.length)
{
if(this.arrDragsB[1] == drag)
{
found = 1;
}
i++;
}
if(!found)
{
this.arrDragsB.push(drag);
}
found = 0;
};
TestCmpClass.prototype.setNewDrag = function(drag)
{
var found = 0;
var i = 0;
while(i < this.arrDrags.length)
{
if(this.arrDrags[1] == drag)
{
found = 1;
}
i++;
}
if(!found)
{
this.arrDrags.push(drag);
}
found = 0;
};
TestCmpClass.prototype.removeDrag = function(arg1)
{
var i = 0;
while(i < this.arrDrags.length)
{
if(this.arrDrags[i] == arg1)
{
this.arrDrags.splice(i,1);
return true;
}
i++;
}
return false;
};
TestCmpClass.prototype.getPlhs = function(strTypev)
{
var arr = new Array();
var i = 0;
while(i < this.arrPlhs.length)
{
if(this.arrPlhs[i].strType == strTypev)
{
arr.push(this.arrPlhs[i]);
}
i++;
}
return arr;
};
TestCmpClass.prototype.getBros = function(strTypev)
{
var arr = new Array();
var i = 0;
while(i < this.arrDrags.length)
{
if(this.arrDrags[i].strType == strTypev)
{
arr.push(this.arrDrags[i]);
}
i++;
}
return arr;
};
TestCmpClass.prototype.getBrosB = function(strTypev)
{
var arr = new Array();
var i = 0;
while(i < this.arrDragsB.length)
{
if(this.arrDragsB[i].strType == strTypev)
{
arr.push(this.arrDragsB[i]);
}
i++;
}
return arr;
};
TestCmpClass.prototype.getNName = function()
{
this.Id = this.Id + 1;
return "__created_movie__" + this.Id;
};
TestCmpClass.prototype.getNDepth = function()
{
var depth = this.nextDepth();
return depth;
};
TestCmpClass.prototype.validate = function(strTypev, resB, resG, onlyArr, serverInvolved, txBxDisplayRez)
{
var plhsToCheck = new Array();
var badAnswer = false;
var arrToSend = new Array();
var rezTx = "";
if(undefined == onlyArr)
{
var i = 0;
while(i < this.arrPlhs.length)
{
if(this.arrPlhs[i].strType == strTypev)
{
plhsToCheck.push(this.arrPlhs[i]);
}
i++;
}
}
else
{
plhsToCheck = onlyArr;
}
if(serverInvolved)
{
var i = 0;
while(i < plhsToCheck.length)
{
arrToSend.push(plhsToCheck[i],plhsToCheck[i].getCont());
i++;
}
var arrSrez = this.performServerValid(arrToSend);
badAnswer = arrSrez[0];
rezTx = arrSrez[1];
}
else
{
var i = 0;
while(i < plhsToCheck.length)
{
if(badAnswer)
{
break;
}
var corDrags = plhsToCheck[i].getDrags();
if(corDrags.length > 0)
{
var cntNs = plhsToCheck[i].getCont();
if(cntNs == null)
{
badAnswer = true;
}
else
{
badAnswer = true;
var y = 0;
while(y < corDrags.length)
{
if(corDrags[y] == cntNs.plhF)
{
badAnswer = false;
}
if(corDrags[y] == cntNs)
{
badAnswer = false;
}
y++;
}
}
}
else if(corDrags.length == 0)
{
var cntNs = plhsToCheck[i].getCont();
if(cntNs != null)
{
badAnswer = true;
}
}
i++;
}
if(badAnswer)
{
rezTx = "Bad";
}
else
{
rezTx = "Good";
}
}
if(badAnswer)
{
if(resB)
{
this.reset(strTypev,onlyArr,txBxDisplayRez);
}
if(undefined != txBxDisplayRez)
{
txBxDisplayRez.text = rezTx;
}
}
else
{
if(resG)
{
this.reset(strTypev,onlyArr,txBxDisplayRez);
}
if(undefined != txBxDisplayRez)
{
txBxDisplayRez.text = rezTx;
}
}
};
TestCmpClass.prototype.performServerValid = function(rezArr)
{
var arrMy = new Array();
arrMy.push(true);
arrMy.push("Good");
return arrMy;
};
TestCmpClass.prototype.reset = function(strTypev, onlyArr, txBxDisplayRez)
{
if(undefined == onlyArr)
{
var i = 0;
while(i < this.arrPlhs.length)
{
if(this.arrPlhs[i].strType == strTypev)
{
this.arrPlhs[i].setCont(null);
}
i++;
}
}
else
{
var i = 0;
while(i < onlyArr.length)
{
onlyArr[i].setCont(null);
i++;
}
}
if(undefined != txBxDisplayRez)
{
txBxDisplayRez.text = "";
}
};
Object.DragClassB = function(plhF, arrPlhs, strType, btnBeh)
{
this.init_x = this._x;
this.init_y = this._y;
this.btnBeh = btnBeh;
this.strType = strType;
this.plhF = plhF;
this.lastCreated = null;
this.corPlhs = arrPlhs;
this.cnt = null;
this.init();
};
Object.DragClassB.prototype.init = function()
{
this.onMouseMove = function()
{
if(!this.btnBeh)
{
return undefined;
}
if(this.getLastCreated() == null && this.hitTest(_root._xmouse,_root._ymouse,false))
{
var nName = this.plhF.getNName();
var nDepth = this.plhF.getNDepth();
duplicateMovieClip(this,nName,16384 + nDepth);
nName = eval(this._parent + "." + nName);
if(nDepth < this.getDepth())
{
this.swapDepths(nName);
}
nName.mcExtends(Object.DragClass,this,this.corPlhs,this.strType);
this.setNewDrag(nName);
this.setLastCreated(nName);
}
else if(this.getLastCreated() != null && !this.hitTest(_root._xmouse,_root._ymouse,false))
{
this.removeDrag(this.getLastCreated());
removeMovieClip(this.getLastCreated());
this.setLastCreated(null);
}
};
this.setLastCreated = function(arg1)
{
this.lastCreated = arg1;
};
this.getLastCreated = function()
{
return this.lastCreated;
};
this.removeDrag = function(arg1)
{
return this.plhF.removeDrag(arg1);
};
this.getBros = function()
{
if(this.btnBeh)
{
var arr = this.plhF.getBros(this.strType);
return arr;
}
var arr = this.plhF.getBrosB(this.strType);
return arr;
};
this.getPlhs = function(strTypev)
{
return this.plhF.getPlhs(strTypev);
};
this.setNewDrag = function(drag)
{
this.plhF.setNewDrag(drag);
};
this.setCnt = function(arg)
{
this.cnt = arg;
};
this.getCnt = function()
{
return this.cnt;
};
this.rlse = function()
{
this._x = this.init_x;
this._y = this.init_y;
};
this.onPress = function()
{
if(this.btnBeh)
{
return undefined;
}
startDrag(this,0);
};
this.onRelease = function()
{
if(this.btnBeh)
{
return undefined;
}
plCobjs = this.plhF.getPlhs(this.strType);
i = 0;
while(i < plCobjs.length)
{
plCobj = plCobjs[i];
if(plCobj.hitTest(this))
{
plCobj.setCont(this);
stopDrag();
this._x = plCobj._x + (plCobj._width / 2 - this._width / 2);
this._y = plCobj._y;
this._parent[this.strType](plCobj,this.corPlhs);
return undefined;
}
i++;
}
this.stopDrag();
this._parent[this.strType]();
this.rlse();
};
this.onReleaseOutside = this.onRelease;
this.onDragOut = function()
{
if(this.btnBeh)
{
return undefined;
}
var bros = this.plhF.getBrosB(this.strType);
i = 0;
while(i < bros.length)
{
if(this.hitTest(bros[i]) && this.getDepth() < bros[i].getDepth())
{
this.swapDepths(bros[i]);
}
i++;
}
};
this.setCnt = function(arg)
{
this.cnt = arg;
};
this.getCnt = function()
{
return this.cnt;
};
};
Object.DragClass = function(plhF, arrPlhs, strType)
{
this.init_x = this._x;
this.init_y = this._y;
this.strType = strType;
this.plhF = plhF;
this.corPlhs = arrPlhs;
this.cnt = null;
this.init();
};
Object.DragClass.prototype.init = function()
{
this.rlse = function()
{
this._x = this.init_x;
this._y = this.init_y;
};
this.onPress = function()
{
this.plhF.setLastCreated(null);
startDrag(this,0);
};
this.onMouseMove = function()
{
plCobjs = this.plhF.getPlhs(this.strType);
var j = this.plhF.plhF.arrPlhs.length - 1;
while(j >= 0)
{
this._parent.normal(this.plhF.plhF.arrPlhs[j]);
if(this.plhF.plhF.arrPlhs[j].nucleo.hitTest(this.hit))
{
this._parent.highlight(this.plhF.plhF.arrPlhs[j]);
}
j--;
}
};
this.onRelease = function()
{
plCobjs = this.plhF.getPlhs(this.strType);
i = plCobjs.length - 1;
while(i >= 0)
{
plCobj = plCobjs[i];
if(plCobj.nucleo.hitTest(this.hit))
{
trace("release" + plCobj);
this._parent.normal(plCobj);
this._parent.callback(this,plCobjs[i],this.plhF.plhF.arrPlhs);
plCobj.setCont(this);
stopDrag();
var point = new Object();
point.x = plCobj._x;
point.y = plCobj._y;
plCobj.localToGlobal(point);
this.globalToLocal(point);
this._x = point.x;
this._y = point.y;
return undefined;
}
i--;
}
var j = this.plhF.plhF.arrPlhs.length - 1;
while(j >= 0)
{
this._parent.normal(this.plhF.plhF.arrPlhs[j]);
if(this.plhF.plhF.arrPlhs[j].nucleo.hitTest(this.hit))
{
this._parent.ncallback(this,this.plhF.plhF.arrPlhs[j]);
break;
}
j--;
}
this.plhF.removeDrag(this);
if(this.getCnt() != null)
{
this.getCnt().setCont(null);
}
removeMovieClip(this);
};
this.onReleaseOutside = this.onRelease;
this.onDragOut = function()
{
var bros = this.plhF.getBros();
i = 0;
while(i < bros.length)
{
if(this.hitTest(bros[i]) && this.getDepth() < bros[i].getDepth())
{
this.swapDepths(bros[i]);
}
i++;
}
};
this.setCnt = function(arg)
{
this.cnt = arg;
};
this.getCnt = function()
{
return this.cnt;
};
};
Object.PlhClass = function(plhF, strType)
{
this.init_x = this._x;
this.init_y = this._y;
this.strType = strType;
this.plhF = plhF;
this.init();
this.Cont = null;
this.arrDrags = new Array();
};
Object.PlhClass.prototype.init = function()
{
this.setCont = function(cnt)
{
if(this.Cont != null && this.Cont != cnt && this.Cont.getCnt() == this)
{
if(this.cont.plhF.removeDrag(this.cont))
{
removeMovieClip(this.cont);
}
else
{
this.cont.rlse();
}
}
this.Cont = cnt;
cnt.setCnt(this);
};
this.getCont = function()
{
return this.Cont;
};
this.setNewDrag = function(drag)
{
var found = 0;
var i = 0;
while(i < this.arrDrags.length)
{
if(this.arrDrags[1] == drag)
{
found = 1;
}
i++;
}
if(!found)
{
this.arrDrags.push(drag);
}
found = 0;
};
this.getDrags = function()
{
return this.arrDrags;
};
};
MovieClip.prototype.mcExtends = function(superClass)
{
if(typeof superClass == "function")
{
this.__proto__ = superClass.prototype;
if(typeof this.attachMovie == "undefined")
{
var o = this.__proto__;
var p = o.__proto__.__proto__;
while(p != null)
{
p = p.__proto__;
o = o.__proto__;
}
o.__proto__ = MovieClip.prototype;
}
arguments.splice(0,1);
superClass.apply(this,arguments);
}
else
{
trace("mcExtends: Incorrect superClass type or path - " + typeof superClass);
}
};
var TestMcClass = Object.TestMcClass = function()
{
this._visible = false;
this.init();
};
TestMcClass.prototype = new MovieClip();
TestMcClass["extends"](MovieClip);
TestMcClass.prototype.init = function()
{
this.testComp = this._parent[this.testComp];
this.mc = this._parent[this._targetInstanceName];
var i = 0;
while(i < this.plhs.length)
{
this.plhs[i] = this._parent[this.plhs[i]];
i++;
}
this.testComp.addRel(this.mc,this.plhs,this.test,this.btnBeh);
};
Object.FRadioButtonGroupC = function()
{
this.radioInstances = new Array();
trace("hey");
};
Object.FRadioButtonGroupC.prototype = new FUIComponentClass();
var FRB = Object.FRadioButtonGroupC.prototype;
FRB.addRadioInstance = function(instance)
{
this.radioInstances.push(instance);
this.radioInstances[0].tabEnabled = true;
};
FRB.setEnabled = function(enableFlag)
{
var i = 0;
while(i < this.radioInstances.length)
{
this.radioInstances[i].setEnabled(enableFlag);
i++;
}
};
FRB.getEnabled = function()
{
var i = 0;
while(i < this.radioInstances.length)
{
if(this.radioInstances[i].getEnabled() != this.radioInstances[0].getEnabled())
{
return undefined;
}
i++;
}
return this.radioInstances[0].getEnabled();
};
FRB.setClickHandler = function(clickHandler, obj)
{
var i = 0;
while(i < this.radioInstances.length)
{
this.radioInstances[i].setClickHandler(clickHandler,obj);
i++;
}
};
FRB.getValue = function()
{
var i = 0;
while(i < this.radioInstances.length)
{
if(this.radioInstances[i].selected == true)
{
if(this.radioInstances[i].data == "" || this.radioInstances[i].data == undefined)
{
return this.radioInstances[i].getLabel();
}
return this.radioInstances[i].data;
}
i++;
}
};
FRB.getData = function()
{
var i = 0;
while(i < this.radioInstances.length)
{
if(this.radioInstances[i].selected)
{
return this.radioInstances[i].getData();
}
i++;
}
};
FRB.getInstance = function()
{
var i = 0;
while(i < this.radioInstances.length)
{
if(this.radioInstances[i].selected == true)
{
return i;
}
undefined;
i++;
}
};
FRB.setValue = function(dataValue)
{
var i = 0;
while(i < this.radioInstances.length)
{
if(this.radioInstances[i].data == dataValue)
{
this.radioInstances[i].setValue(true);
return undefined;
}
i++;
}
var i = 0;
while(i < this.radioInstances.length)
{
if(this.radioInstances[i].getLabel() == dataValue)
{
this.radioInstances[i].setValue(true);
}
i++;
}
};
FRB.setSize = function(w)
{
var i = 0;
while(i < this.radioInstances.length)
{
this.radioInstances[i].setSize(w);
i++;
}
};
FRB.getSize = function()
{
var widestRadio = 0;
var i = 0;
while(i < this.radioInstances.length)
{
if(this.radioInstances[i].width >= widestRadio)
{
widestRadio = this.radioInstances[i].width;
}
i++;
}
return widestRadio;
};
FRB.setGroupName = function(groupName)
{
this.oldGroupName = this.radioInstances[0].groupName;
var i = 0;
while(i < this.radioInstances.length)
{
this.radioInstances[i].groupName = groupName;
this.radioInstances[i].addToRadioGroup();
i++;
}
delete this._parent[this.oldGroupName];
};
FRB.getGroupName = function()
{
return this.radioInstances[0].groupName;
};
FRB.setLabelPlacement = function(pos)
{
var i = 0;
while(i < this.radioInstances.length)
{
this.radioInstances[i].setLabelPlacement(pos);
i++;
}
};
FRB.setStyleProperty = function(propName, value, isGlobal)
{
var i = 0;
while(i < this.radioInstances.length)
{
this.radioInstances[i].setStyleProperty(propName,value,isGlobal);
i++;
}
};
FRB.addListener = function()
{
var i = 0;
while(i < this.radioInstances.length)
{
this.radioInstances[i].addListener();
i++;
}
};
FRB.applyChanges = function()
{
var i = 0;
while(i < this.radioInstances.length)
{
this.radioInstances[i].applyChanges();
i++;
}
};
FRB.removeListener = function(component)
{
var i = 0;
while(i < this.radioInstances.length)
{
this.radioInstances[i].removeListener(component);
i++;
}
};
Object.BUClass = function()
{
this.init();
};
Object.BUClass.prototype = new FUIComponentClass();
Object.registerClass("ButonUniversal",Object.BUClass);
var BUC = Object.BUClass.prototype;
BUC.init = function()
{
super.setSize(this._width,this._height);
this.boundingBox_mc._visible = false;
this.textStyle = new TextFormat();
this.textStyle.font = "eLEARNING_Medium";
this.textStyle.size = 18;
this.textStyle.align = "left";
this.attachMovie("fpb_states2","fpbState_mc",1);
this.attachMovie("FLabelSymbol","fLabel_mc",2);
this.attachMovie("fpb_hitArea","fpb_hitArea_mc",3);
super.init();
this.createTextField("styleTable",100,0,0,0,0);
this.styleTable.type = "dynamic";
this.styleTable.embedFonts = true;
this.btnState = false;
this.setClickHandler(this.clickHandler);
this._xscale = 100;
this._yscale = 100;
this.setSize(this.width,this.inaltime);
if(this.data == "" || this.tipBtn == 3 || this.tipBtn == 4)
{
this.data = undefined;
}
else
{
this.setData(this.data);
}
if(this.tipBtn == undefined)
{
this.tipBtn = 4;
}
this.selected = false;
if(this.label != undefined)
{
this.setLabel(this.label);
}
this.ROLE_SYSTEM_PUSHBUTTON = 43;
this.STATE_SYSTEM_PRESSED = 8;
this.EVENT_OBJECT_STATECHANGE = 32778;
this.EVENT_OBJECT_NAMECHANGE = 32780;
this._accImpl.master = this;
this._accImpl.stub = false;
this._accImpl.get_accRole = this.get_accRole;
this._accImpl.get_accName = this.get_accName;
this._accImpl.get_accState = this.get_accState;
this._accImpl.get_accDefaultAction = this.get_accDefaultAction;
this._accImpl.accDoDefaultAction = this.accDoDefaultAction;
if(this.tipBtn == 1 || this.tipBtn == 2)
{
this.addToRadioGroup();
}
};
BUC.setHitArea = function(w, h)
{
var hit = this.fpb_hitArea_mc;
this.hitArea = hit;
hit._visible = false;
hit._width = w;
hit._height = arguments.length <= 1 ? hit._height : h;
};
BUC.setSize = function(w, h)
{
w = w >= 6 ? w : 6;
if(arguments.length > 1)
{
if(h < 6)
{
h = 6;
}
}
super.setSize(w,h);
this.setLabel(this.getLabel());
this.arrangeLabel();
this.setHitArea(w,h);
this.boundingBox_mc._width = w;
this.boundingBox_mc._height = h;
this.drawFrame();
if(this.focused)
{
super.myOnSetFocus();
}
this.initContentPos("fLabel_mc");
};
BUC.arrangeLabel = function()
{
var label = this.fLabel_mc;
var h = this.height;
var w = this.width - 2;
var b = 1;
this.fLabel_mc.setSize(w - b * 4);
label._x = 10;
label._y = h / 2 - label._height / 2;
};
BUC.getLabel = function()
{
return this.fLabel_mc.labelField.text;
};
BUC.setLabel = function(label)
{
this.fLabel_mc.setLabel(label);
this.txtFormat();
this.arrangeLabel();
if(Accessibility.isActive())
{
Accessibility.sendEvent(this,0,this.EVENT_OBJECT_NAMECHANGE);
}
};
BUC.setData = function(dataValue)
{
this.data = dataValue;
};
BUC.getData = function()
{
return this.data;
};
BUC.getState = function()
{
return this.selected;
};
BUC.getGroupName = function()
{
return this.groupName;
};
BUC.setGroupName = function(groupName)
{
var i = 0;
while(i < this._parent[this.groupName].radioInstances.length)
{
if(this._parent[this.groupName].radioInstances[i] == this)
{
delete this._parent[this.groupName].radioInstances[i];
}
i++;
}
this.groupName = groupName;
this.addToRadioGroup();
};
BUC.setValue = function(selected)
{
if(selected || selected == undefined)
{
this.setState(true);
this.focusRect.removeMovieClip();
this.drawFrame();
this.setBtnState(true);
this.executeCallBack();
}
else if(selected == false)
{
this.setState(false);
}
};
BUC.setTabState = function(selected)
{
Selection.setFocus(this);
this.setState(selected);
this.drawFocusRect();
this.executeCallBack();
};
BUC.getValue = function()
{
if(this.selected)
{
if(this.data == "" || this.data == undefined)
{
return this.getLabel();
}
return this.data;
}
};
BUC.setState = function(selected)
{
if((selected || selected == undefined) && (this.tipBtn == 1 || this.tipBtn == 2))
{
this.tabEnabled = true;
for(var i in this._parent)
{
if(this != this._parent[i] && this._parent[i].groupName == this.groupName && (this._parent[i].tipBtn == 1 || this._parent[i].tipBtn == 2))
{
this._parent[i].setState(false);
this._parent[i].tabEnabled = false;
}
}
}
if(this.enable && this.tipBtn != 4)
{
this.flabel_mc.setEnabled(true);
if(selected || selected == undefined)
{
this.fpbState_mc.gotoAndStop(3);
if(this.tipBtn === 1)
{
this.enabled = false;
}
this.selected = true;
this.tabEnabled = true;
this.tabFocused = true;
this.fLabel_mc.setColor("0xeeeeee");
}
else
{
this.fpbState_mc.gotoAndStop(1);
this.drawFrame();
this.enabled = true;
this.selected = false;
this.tabEnabled = false;
var enabTrue = this._parent[this.groupName].getEnabled();
var noneSelect = this._parent[this.groupName].getValue() == undefined;
if(enabTrue && noneSelect)
{
this._parent[this.groupName].radioInstances[0].tabEnabled = true;
}
}
}
else
{
this.flabel_mc.setEnabled(false);
if(selected || selected == undefined)
{
this.fpbState_m.gotoAndStop("selectedDisabled");
this.enabled = false;
this.selected = true;
this.tabEnabled = false;
}
else
{
this.fpbState_m.gotoAndStop("unselectedDisabled");
this.enabled = false;
this.selected = false;
this.tabEnabled = false;
}
}
if(Accessibility.isActive())
{
Accessibility.sendEvent(this,0,this.EVENT_OBJECT_STATECHANGE,true);
}
};
BUC.getEnabled = function()
{
return this.enabled;
};
BUC.setEnabled = function(enable)
{
if(enable || enable == undefined)
{
this.gotoFrame(1);
this.drawFrame();
this.flabel_mc.setEnabled(true);
this.enabled = true;
this.enable = true;
super.setEnabled(true);
}
else
{
this.gotoFrame(4);
this.drawFrame();
this.flabel_mc.setEnabled(false);
this.enabled = false;
this.enable = false;
super.setEnabled(false);
}
};
BUC.getGroupName = function()
{
return this.groupName;
};
BUC.txtFormat = function()
{
var txtS = this.textStyle;
var sTbl = this.styleTable;
txtS.align = sTbl.textAlign.value != undefined ? undefined : (txtS.align = "left");
txtS.leftMargin = sTbl.textLeftMargin.value != undefined ? undefined : (txtS.leftMargin = 1);
txtS.rightMargin = sTbl.textRightMargin.value != undefined ? undefined : (txtS.rightMargin = 1);
if(this.fLabel_mc._height > this.height)
{
super.setSize(this.width,this.fLabel_mc._height);
}
else
{
super.setSize(this.width,this.height);
}
this.fLabel_mc.labelField.setTextFormat(this.textStyle);
this.setEnabled(this.enable);
};
BUC.drawFrame = function()
{
var b = 1;
var x1 = 0;
var y1 = 0;
var x2 = this.width;
var y2 = this.height;
var mc_array = ["up_mc","over_mc","down_mc","disabled_mc"];
var frame = mc_array[this.fpbState_mc._currentframe - 1];
var mc = "frame";
var i = 0;
while(i < 6)
{
x1 += i % 2 * b;
y1 += i % 2 * b;
x2 -= (i + 1) % 2 * b;
y2 -= (i + 1) % 2 * b;
var w = Math.abs(x1 - x2) + 2 * b;
var h = Math.abs(y1 - y2) + 2 * b;
this.fpbState_mc[frame][mc + i]._width = w;
this.fpbState_mc[frame][mc + i]._height = h;
this.fpbState_mc[frame][mc + i]._x = x1 - b;
this.fpbState_mc[frame][mc + i]._y = y1 - b;
i++;
}
};
BUC.setClickHandler = function(chng, obj)
{
this.handlerObj = arguments.length >= 2 ? obj : this._parent;
this.clickHandler = chng;
};
BUC.executeCallBack = function()
{
if(this.tipBtn == 3 || this.tipBtn == 2 || this.tipBtn == 4)
{
this.handlerObj[this.clickHandler](this);
}
else
{
this.handlerObj[this.clickHandler](this._parent[this.radioGroup]);
}
};
BUC.initContentPos = function(mc)
{
this.incrVal = 1;
this.initx = this[mc]._x - this.getBtnState() * this.incrVal;
this.inity = this[mc]._y - this.getBtnState() * this.incrVal;
this.togx = this.initx + this.incrVal;
this.togy = this.inity + this.incrVal;
};
BUC.setBtnState = function(state)
{
this.btnState = state;
if(state)
{
this.fLabel_mc._x = this.togx;
this.fLabel_mc._y = this.togy;
}
else
{
this.fLabel_mc._x = this.initx;
this.fLabel_mc._y = this.inity;
}
};
BUC.getBtnState = function()
{
return this.btnState;
};
BUC.myOnSetFocus = function()
{
this.focused = true;
super.myOnSetFocus();
};
BUC.selectat = function(b)
{
if(b != undefined)
{
if(b)
{
this.boundingBox_mc._visible = true;
this.boundingBox_mc._width = this._width + 4;
this.boundingBox_mc._height = this._height + 4;
this.boundingBox_mc._x = -2;
this.boundingBox_mc._y = -2;
}
else
{
this.boundingBox_mc._visible = false;
this.boundingBox_mc._width = this._width - 4;
this.boundingBox_mc._height = this._height - 4;
}
}
else if(this.boundingBox_mc._visible)
{
this.boundingBox_mc._visible = false;
this.boundingBox_mc._width = this._width - 4;
this.boundingBox_mc._height = this._height - 4;
}
else
{
this.boundingBox_mc._visible = true;
this.boundingBox_mc._width += 4;
this.boundingBox_mc._height += 4;
this.boundingBox_mc._x = -2;
this.boundingBox_mc._y = -2;
}
};
BUC.addToRadioGroup = function()
{
if(this._parent[this.groupName] == undefined)
{
this._parent[this.groupName] = new Object.FRadioButtonGroupC();
}
this._parent[this.groupName].addRadioInstance(this);
};
BUC.onPress = function()
{
this.pressFocus();
switch(this.tipBtn)
{
case 1:
this.setState(true);
break;
case 2:
if(this.selected)
{
this.setState(false);
}
else
{
this.setState(true);
}
break;
case 3:
if(this.selected)
{
this.setState(false);
}
else
{
this.setState(true);
}
break;
case 4:
this.fpbState_mc.gotoAndStop(3);
this.fLabel_mc.setColor("0xeeeeee");
}
this.drawFrame();
this.executeCallBack();
this.setBtnState(true);
if(Accessibility.isActive())
{
Accessibility.sendEvent(this,0,this.EVENT_OBJECT_STATECHANGE,true);
}
};
BUC.onRelease = function()
{
if(this.tipBtn == 4)
{
this.fpbState_mc.gotoAndStop(2);
this.fLabel_mc.setColor("0x000000");
}
this.drawFrame();
this.setBtnState(false);
if(Accessibility.isActive())
{
Accessibility.sendEvent(this,0,this.EVENT_OBJECT_STATECHANGE,true);
}
};
BUC.onRollOver = function()
{
if(this.tipBtn == 1 || this.tipBtn == 4 || (this.tipBtn == 2 || this.tipBtn == 3) && !this.selected)
{
this.fpbState_mc.gotoAndStop(2);
}
this.drawFrame();
};
BUC.onRollOut = function()
{
if(this.tipBtn == 1 | this.tipBtn == 4 || (this.tipBtn == 2 || this.tipBtn == 3) && !this.selected)
{
this.fpbState_mc.gotoAndStop(1);
}
this.drawFrame();
};
BUC.onReleaseOutside = function()
{
this.setBtnState(false);
if(this.tipBtn == 1)
{
this.fpbState_mc.gotoAndStop(1);
}
this.drawFrame();
};
BUC.onDragOut = function()
{
this.setBtnState(false);
if(this.tipBtn == 1)
{
this.fpbState_mc.gotoAndStop(1);
}
this.drawFrame();
};
BUC.onDragOver = function()
{
this.setBtnState(true);
if(this.tipBtn == 1)
{
this.fpbState_mc.gotoAndStop(3);
}
this.drawFrame();
};
BUC.myOnKeyDown = function()
{
if(Key.getCode() == 32 && this.pressOnce == undefined)
{
this.onPress();
this.pressOnce = 1;
}
};
BUC.myOnKeyUp = function()
{
if(Key.getCode() == 32)
{
this.onRelease();
this.pressOnce = undefined;
}
};
BUC.get_accRole = function(childId)
{
return this.master.ROLE_SYSTEM_PUSHBUTTON;
};
BUC.get_accName = function(childId)
{
return this.master.getLabel();
};
BUC.get_accState = function(childId)
{
if(this.pressOnce)
{
return this.master.STATE_SYSTEM_PRESSED;
}
return this.master.STATE_SYSTEM_DEFAULT;
};
BUC.get_accDefaultAction = function(childId)
{
return "Press";
};
BUC.accDoDefaultAction = function(childId)
{
this.master.onPress();
this.master.onRelease();
};
delete FRB;
delete BUC;