概述
2019独角兽企业重金招聘Python工程师标准>>>
第二版对第一版做了一些优化,其中最主要的优化就是将属性提示界面单独封装为一个类。这样不但减少了属性界面与editor功能的耦合,而且使整个代码清爽了许多,并且同时解决了一部分BUG
更新主要代码如下:
InforAlert.as
package
{
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFieldType;
public class InforAlert extends Sprite
{editor02
private var hotSpot:HotspotEditor02;
private var txtBack:TextField;
private var txtInput:TextField;
private var txtInput1:TextField;
private var txtInput2:TextField;
private var txtLable1:TextField;
private var txtLable2:TextField;
private var txtLable3:TextField;
private var btn1:TextField;
private var btn2:TextField;
public function InforAlert(hotSpot:HotspotEditor02)
{
this.hotSpot = hotSpot;
init();
addToStage();
}
private function init():void{
txtBack = new TextField();
txtInput = new TextField();
txtInput1 = new TextField();
txtInput2 = new TextField();
txtLable1 = new TextField();
txtLable2 = new TextField();
txtLable3 = new TextField();
btn1 = new TextField();
btn2 = new TextField();
txtInput.type = TextFieldType.INPUT;
txtInput1.type = TextFieldType.INPUT;
txtInput2.type = TextFieldType.INPUT;
txtInput.width = 100;
txtInput.height = 25;
txtInput1.width = 100;
txtInput1.height = 25;
txtInput2.width = 100;
txtInput2.height = 25;
txtLable1.width = 100;
txtLable1.height = 50;
txtLable1.textColor = 0xffffff;
txtLable2.width = 100;
txtLable2.height = 50;
txtLable2.textColor = 0xffffff;
txtLable3.width = 100;
txtLable3.height = 50;
txtLable3.textColor = 0xffffff;
btn1.width = 70;
btn1.height = 25;
btn1.autoSize = TextFieldAutoSize.CENTER;
btn1.text = “确定”;
btn1.background = true;
btn1.backgroundColor = 0xdddddd;
btn2.width = 70;
btn2.height = 25;
btn2.autoSize = TextFieldAutoSize.CENTER;
btn2.text = “取消”;
btn2.background = true;
btn2.backgroundColor = 0xdddddd;
txtBack.background = 0xddff00;
txtBack.backgroundColor = 0×000000;
txtInput.background = 0xFFFFFF;
txtInput1.background = 0xFFFFFF;
txtInput2.background = 0xFFFFFF;
txtBack.x = 500;
txtBack.y = 150;
btn1.x = txtBack.x+50;
btn1.y = txtBack.y+110;
btn1.addEventListener(MouseEvent.CLICK,hotSpot.baginDraw);
btn2.x = txtBack.x+195;
btn2.y = txtBack.y+110;
btn2.addEventListener(MouseEvent.CLICK,hotSpot.baginDraw);
txtInput.x = txtBack.x+120;
txtInput.y = txtBack.y+20;
txtInput1.x = txtBack.x+120;
txtInput1.y = txtBack.y+50;
txtInput2.x = txtBack.x+120;
txtInput2.y = txtBack.y+80;
txtLable1.x = txtBack.x+50;
txtLable1.y = txtBack.y+20;
txtLable2.x = txtBack.x+50;
txtLable2.y = txtBack.y+50;
txtLable3.x = txtBack.x+50;
txtLable3.y = txtBack.y+80;
txtBack.alpha = 0.25;
txtBack.width = 300;
txtBack.height = 150;
txtLable1.text = “商品ID:”;
txtLable2.text = “商品编号:”;
txtLable3.text = “商品URL:”;
}
public function addToStage():void{
this.addChild(txtBack);
this.addChild(txtLable1);
this.addChild(txtLable2);
this.addChild(txtLable3);
this.addChild(txtInput);
this.addChild(txtInput1);
this.addChild(txtInput2);
this.addChild(btn1);
this.addChild(btn2);
}
}
}
版本下载
转载于:https://my.oschina.net/xinyuan6009/blog/295586
最后
以上就是寒冷滑板为你收集整理的基于Krpano的Hotspot热区插件·第二版的全部内容,希望文章能够帮你解决基于Krpano的Hotspot热区插件·第二版所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复