home *** CD-ROM | disk | FTP | other *** search
- class application.ui.DynamicInfoTextfield extends MovieClip
- {
- var instCounter;
- var maxWidth;
- var maxHeight;
- var tfAspectRatio;
- var dataObj;
- var holder;
- var textArray;
- function DynamicInfoTextfield()
- {
- super();
- this.instCounter = 1;
- this.maxWidth = 421;
- this.maxHeight = 285;
- this.tfAspectRatio = this.maxWidth / this.maxHeight;
- }
- function run(id)
- {
- this.splitString(id);
- var _loc2_ = this.showInfo(id);
- return _loc2_;
- }
- function setDataObj(dataObj)
- {
- this.dataObj = dataObj;
- }
- function setContainer(holder)
- {
- this.holder = holder;
- }
- function showInfo(i)
- {
- var _loc16_ = this.dataObj.software.contentList[i];
- if(_loc16_.information == "")
- {
- return null;
- }
- var _loc6_ = this.holder.createEmptyMovieClip("info",this.instCounter++);
- var _loc12_ = _loc6_.createEmptyMovieClip("background",1);
- _loc6_.createTextField("tf",2,0,0,this.maxWidth,this.maxHeight);
- var _loc3_ = _loc6_.tf;
- _loc3_.multiline = true;
- _loc3_.wordWrap = true;
- _loc3_.embedFonts = true;
- _loc3_.selectable = false;
- _loc3_.html = true;
- _loc3_.styleSheet = _global.CSS;
- _loc3_.text = _loc16_.information;
- if(_loc3_.maxscroll == 1)
- {
- var _loc19_ = int(_loc3_._width);
- var _loc10_ = 0;
- var _loc9_ = _loc19_;
- var _loc11_ = -1;
- i = 0;
- while(i < 10)
- {
- if(_loc3_.maxscroll == 1 && _loc3_._height <= this.maxHeight)
- {
- _loc11_ = -1;
- if(_loc3_._width < _loc9_)
- {
- _loc9_ = int(_loc3_._width);
- }
- }
- else
- {
- _loc11_ = 1;
- if(_loc3_._width > _loc10_)
- {
- _loc10_ = int(_loc3_._width);
- }
- }
- _loc19_ = int(_loc3_._width + _loc11_ * ((_loc9_ - _loc10_) / 2));
- _loc3_._width = _loc19_;
- _loc3_._height = _loc19_ / this.tfAspectRatio;
- _loc3_.embedFonts = true;
- _loc3_.border = false;
- _loc3_.html = true;
- _loc3_.wordWrap = true;
- _loc3_.multiline = true;
- _loc3_.styleSheet = _global.CSS;
- _loc3_.text = _loc16_.information;
- i = i + 1;
- }
- _loc19_ = _loc9_;
- _loc3_._width = _loc19_;
- _loc3_._height = int(_loc19_ / this.tfAspectRatio);
- _loc3_.embedFonts = true;
- _loc3_.border = false;
- _loc3_.selectable = false;
- _loc3_.html = true;
- _loc3_.wordWrap = true;
- _loc3_.multiline = true;
- _loc3_.styleSheet = _global.CSS;
- _loc3_.text = _loc16_.information;
- var _loc13_ = 0;
- var _loc8_ = 1;
- this.instCounter = this.instCounter + 1;
- var _loc4_ = 10;
- _loc9_ = 0;
- i = 0;
- while(i < this.textArray.length)
- {
- if(this.textArray[i].type == "text")
- {
- _loc6_.createTextField("tf" + _loc4_,this.instCounter++,_loc13_,_loc8_,_loc19_,22);
- var _loc5_ = _loc6_["tf" + _loc4_];
- _loc5_.embedFonts = true;
- _loc5_.selectable = false;
- _loc5_.border = false;
- _loc5_.html = true;
- _loc5_.wordWrap = true;
- _loc5_.multiline = true;
- _loc5_.styleSheet = _global.CSS;
- _loc5_.htmlText = this.textArray[i].data;
- _loc5_._height = int(_loc5_.maxscroll * 22);
- _loc8_ += int(_loc5_.textHeight);
- if(_loc5_.textWidth > _loc9_)
- {
- _loc9_ = int(_loc5_.textWidth);
- }
- _loc5_.autoSize = true;
- _loc4_ = _loc4_ + 1;
- }
- else
- {
- _loc6_.createTextField("tf" + _loc4_,this.instCounter++,35,_loc8_,_loc19_ - 35,22);
- _loc5_ = _loc6_["tf" + _loc4_];
- _loc5_.embedFonts = true;
- _loc5_.selectable = false;
- _loc5_.border = false;
- _loc5_.html = true;
- _loc5_.wordWrap = true;
- _loc5_.multiline = true;
- _loc5_.styleSheet = _global.CSS;
- _loc5_.text = this.textArray[i].data;
- _loc5_._height = int(_loc5_.maxscroll * 22);
- _loc4_ = _loc4_ + 1;
- _loc6_.createTextField("tf" + _loc4_,this.instCounter++,25,_loc8_,20,20);
- _loc8_ += int(_loc5_.textHeight);
- if(_loc5_.textWidth + 35 > _loc9_)
- {
- _loc9_ = int(_loc5_.textWidth + 35);
- }
- _loc5_ = _loc6_["tf" + _loc4_];
- _loc5_.embedFonts = true;
- _loc5_.selectable = false;
- _loc5_.border = false;
- _loc5_.html = true;
- _loc5_.wordWrap = true;
- _loc5_.multiline = true;
- _loc5_.htmlText = "<TEXTFORMAT LEADING=\"2\"><FONT FACE=\"Testfont\" SIZE=\"16\" COLOR=\"#000000\">#</FONT></TEXTFORMAT>";
- _loc4_ = _loc4_ + 1;
- }
- i = i + 1;
- }
- _loc12_.clear();
- _loc12_.beginFill(16777215,100);
- _loc12_.lineStyle(1,0,100);
- _loc12_.moveTo(0,0);
- _loc12_.lineTo(0,_loc8_ + 3 + 24);
- _loc12_.lineTo(_loc9_ + 2 + 24,_loc8_ + 3 + 24);
- _loc12_.lineTo(_loc9_ + 2 + 24,0);
- _loc12_.lineTo(0,0);
- _loc12_.endFill();
- var _loc15_ = _loc12_._width;
- var _loc14_ = _loc12_._height;
- var _loc17_ = _loc12_.attachMovie("infoBackground","infoBackground",1);
- _loc17_.tc._width = int(_loc15_ - 5);
- _loc17_.tr._x = _loc17_.tc._x + _loc17_.tc._width;
- _loc17_.cl._height = int(_loc14_ - 8);
- _loc17_.cr._height = _loc14_ - 5;
- _loc17_.cr._x = _loc17_.tr._x;
- _loc17_.br._y = _loc17_.cl._height + _loc17_.cl._y;
- _loc17_.br._x = _loc17_.tr._x;
- _loc17_.bl._y = _loc17_.br._y;
- _loc17_.bc._y = _loc17_.br._y;
- _loc17_.bc._width = _loc17_.tc._width;
- _loc12_._x -= 12;
- _loc12_._y -= 12;
- _loc6_.tf.htmlText = "";
- }
- else
- {
- _loc3_.htmlText = "";
- }
- _loc16_ = {mc:_loc6_,h:_loc14_,w:_loc15_};
- return _loc16_;
- }
- function splitString(i)
- {
- this.textArray = [];
- var _loc10_ = this.dataObj.software.contentList[i].information;
- var _loc6_ = _loc10_.split("<p>");
- var _loc9_ = "";
- i = 0;
- while(i < _loc6_.length)
- {
- if(_loc10_[i] != "<p>")
- {
- _loc9_ += _loc6_[i];
- }
- i = i + 1;
- }
- _loc6_ = _loc9_.split("</p>");
- _loc9_ = "";
- i = 0;
- while(i < _loc6_.length)
- {
- if(_loc10_[i] != "</p>")
- {
- _loc9_ += _loc6_[i];
- }
- i = i + 1;
- }
- var _loc11_ = _loc9_.split("<li>");
- var _loc2_ = 0;
- var _loc5_ = 0;
- while(_loc5_ < _loc11_.length)
- {
- var _loc3_ = _loc11_[_loc5_];
- var _loc7_ = _loc3_.indexOf("</li>");
- if(_loc7_ == -1)
- {
- this.textArray[_loc2_] = {type:"text",data:"<p>" + _loc3_ + "</p>"};
- _loc2_ = _loc2_ + 1;
- }
- else if(_loc7_ <= _loc3_.length - 7)
- {
- var _loc8_ = _loc3_.split("</li>");
- this.textArray[_loc2_] = {type:"list",data:"<p class=\'text\'>" + _loc8_[0] + "</p>"};
- _loc2_ = _loc2_ + 1;
- this.textArray[_loc2_] = {type:"text",data:"<p>" + _loc8_[1] + "</p>"};
- _loc2_ = _loc2_ + 1;
- }
- else
- {
- _loc8_ = _loc3_.split("</li>");
- this.textArray[_loc2_] = {type:"list",data:"<p class=\'text\'>" + _loc8_[0] + "</p>"};
- _loc2_ = _loc2_ + 1;
- }
- _loc5_ = _loc5_ + 1;
- }
- }
- }
-