flash on 2009-6-21
package {
import flash.display.*;
import flash.events.*;
import flash.utils.escapeMultiByte;
import flash.text.*;
import flash.net.*;
public class FlashTest extends Sprite {
public var re:int = 0;
public var er:int = 0;
public var haikei:int = 0;
public var query:String = "";
public var numOfImage:uint = 100;
public var loader:URLLoader;
public var imgWidth:uint = 77;
public var imgHeight:uint = 77;
public var imgOffset:uint = 2;
public var xmlData:XML;
public var media:Namespace = new Namespace("http://search.yahoo.com/mrss/");
public var kyonum:Number = 0;
public var tolnum:int = 0;
public var bennum:Number = 20;
public var gsnum:Number = 119;
public var fuenum:Number = 7;
public var teanum:int = 10;
public var carnum:int = 6000;
public var new1num:Number = 0;
public var newobj1:int = 1;
public var mode:int = 0;
public var move:int = 0;
public var clickx:int = 0;
public var clicky:int = 0;
public var push:int = 0;
public var url1:String = "";
public var un:int = 0;
public var gen:int = (kyonum*gsnum/fuenum+kyonum*teanum+tolnum+carnum);
public var res:int = (gen*100)/(100-bennum);
public function FlashTest() {
// write as3 code here..
stage.addEventListener(MouseEvent.MOUSE_MOVE, mlocate);
stage.addEventListener(MouseEvent.MOUSE_UP, moveend);
var kyotxt:TextField = new TextField();
kyotxt.x = 10; kyotxt.y = 80;
kyotxt.width = 80; kyotxt.height = 20;
kyotxt.background = true;
kyotxt.backgroundColor = 0x00FFFF;
kyotxt.alpha = 1;
kyotxt.text = "走行距離(km)";
kyotxt.addEventListener(MouseEvent.MOUSE_DOWN, kyotxtstart);
addChild(kyotxt);
var kyoinp:TextField = new TextField();
kyoinp.border = true;
kyoinp.x = 10; kyoinp.y = 100;
kyoinp.width = 70; kyoinp.height = 20;
kyoinp.background = true;
kyoinp.backgroundColor = 0xFFFFFF;
kyoinp.type = "input";
kyoinp.restrict = "0-9\\.";
kyoinp.text = kyonum.toString();
kyoinp.addEventListener(KeyboardEvent.KEY_UP, KeyDown);
kyoinp.addEventListener(MouseEvent.MOUSE_DOWN, kyoinpstart);
addChild(kyoinp);
function kyotxtstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - kyotxt.x;
clicky = mouseY - kyotxt.y;
push = 1;
un = 1;}
}
function kyoinpstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - kyoinp.x;
clicky = mouseY - kyoinp.y;
push = 1;
un = 2;}
}
var toltxt:TextField = new TextField();
toltxt.x = 100; toltxt.y = 80;
toltxt.width = 55; toltxt.height = 20;
toltxt.background = true;
toltxt.backgroundColor = 0x00FFFF;
toltxt.text = "高速料金";
toltxt.addEventListener(MouseEvent.MOUSE_DOWN, toltxtstart);
addChild(toltxt);
var tolinp:TextField = new TextField();
tolinp.border = true;
tolinp.x = 100; tolinp.y = 100;
tolinp.width = 70; tolinp.height = 20;
tolinp.background = true;
tolinp.backgroundColor = 0xFFFFFF;
tolinp.type = "input";
tolinp.restrict = "0-9";
tolinp.text = tolnum.toString();
tolinp.addEventListener(KeyboardEvent.KEY_UP, KeyDown);
tolinp.addEventListener(MouseEvent.MOUSE_DOWN, tolinpstart);
addChild(tolinp);
function toltxtstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - toltxt.x;
clicky = mouseY - toltxt.y;
push = 1;
un = 3;}
}
function tolinpstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - tolinp.x;
clicky = mouseY - tolinp.y;
push = 1;
un = 4;}
}
var bentxt:TextField = new TextField();
bentxt.width = 50; bentxt.height = 20;
bentxt.x = 280; bentxt.y = 80;
bentxt.background = true;
bentxt.backgroundColor = 0x00FFFF;
bentxt.text = "粗利(%)";
bentxt.addEventListener(MouseEvent.MOUSE_DOWN, bentxtstart);
addChild(bentxt);
var beninp:TextField = new TextField();
beninp.border = true;
beninp.x = 280; beninp.y = 100;
beninp.width = 70; beninp.height = 20;
beninp.background = true;
beninp.backgroundColor = 0xFFFFFF;
beninp.type = "input";
beninp.restrict = "0-9\\.";
beninp.text = bennum.toString();
beninp.addEventListener(KeyboardEvent.KEY_UP, araKeyDown);
beninp.addEventListener(MouseEvent.MOUSE_DOWN, beninpstart);
addChild(beninp);
function bentxtstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - bentxt.x;
clicky = mouseY - bentxt.y;
push = 1;
un = 5;}
}
function beninpstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - beninp.x;
clicky = mouseY - beninp.y;
push = 1;
un = 6;}
}
var gstxt:TextField = new TextField();
gstxt.x = 10; gstxt.y = 200;
gstxt.width = 80; gstxt.height = 20;
gstxt.background = true;
gstxt.backgroundColor = 0x00FFFF;
gstxt.text = "ガス代(yen/L)";
gstxt.addEventListener(MouseEvent.MOUSE_DOWN, gstxtstart);
addChild(gstxt);
var gsinp:TextField = new TextField();
gsinp.border = true;
gsinp.x = 10; gsinp.y = 220;
gsinp.width = 70; gsinp.height = 20;
gsinp.background = true;
gsinp.backgroundColor = 0xFFFFFF;
gsinp.type = "input";
gsinp.restrict = "0-9\\.";
gsinp.text = gsnum.toString();
gsinp.addEventListener(KeyboardEvent.KEY_UP, KeyDown);
gsinp.addEventListener(MouseEvent.MOUSE_DOWN, gsinpstart);
addChild(gsinp);
function gstxtstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - gstxt.x;
clicky = mouseY - gstxt.y;
push = 1;
un = 8;}
}
function gsinpstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - gsinp.x;
clicky = mouseY - gsinp.y;
push = 1;
un = 9;}
}
var fuetxt:TextField = new TextField();
fuetxt.x = 100; fuetxt.y = 200;
fuetxt.width = 70; fuetxt.height = 20;
fuetxt.background = true;
fuetxt.backgroundColor = 0x00FFFF;
fuetxt.text = "燃費(Km/L)";
fuetxt.addEventListener(MouseEvent.MOUSE_DOWN, fuetxtstart);
addChild(fuetxt);
var fueinp:TextField = new TextField();
fueinp.border = true;
fueinp.x = 100; fueinp.y = 220;
fueinp.width = 70; fueinp.height = 20;
fueinp.background = true;
fueinp.backgroundColor = 0xFFFFFF;
fueinp.type = "input";
fueinp.restrict = "0-9\\.";
fueinp.text = fuenum.toString();
fueinp.addEventListener(KeyboardEvent.KEY_UP, KeyDown);
fueinp.addEventListener(MouseEvent.MOUSE_DOWN, fueinpstart);
addChild(fueinp);
function fuetxtstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - fuetxt.x;
clicky = mouseY - fuetxt.y;
push = 1;
un = 10;}
}
function fueinpstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - fueinp.x;
clicky = mouseY - fueinp.y;
push = 1;
un = 11;}
}
var teatxt:TextField = new TextField();
teatxt.x = 190; teatxt.y = 200;
teatxt.width = 80; teatxt.height = 20;
teatxt.background = true;
teatxt.backgroundColor = 0x00FFFF;
teatxt.text = "手当(yen/Km)";
teatxt.addEventListener(MouseEvent.MOUSE_DOWN, teatxtstart);
addChild(teatxt);
var teainp:TextField = new TextField();
teainp.border = true;
teainp.x = 190; teainp.y = 220;
teainp.width = 70; teainp.height = 20;
teainp.background = true;
teainp.backgroundColor = 0xFFFFFF;
teainp.type = "input";
teainp.restrict = "0-9";
teainp.text = teanum.toString();
teainp.addEventListener(KeyboardEvent.KEY_UP, KeyDown);
teainp.addEventListener(MouseEvent.MOUSE_DOWN, teainpstart);
addChild(teainp);
function teatxtstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - teatxt.x;
clicky = mouseY - teatxt.y;
push = 1;
un = 12;}
}
function teainpstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - teainp.x;
clicky = mouseY - teainp.y;
push = 1;
un = 13;}
}
var cartxt:TextField = new TextField();
cartxt.x = 280; cartxt.y = 200;
cartxt.width = 70; cartxt.height = 20;
cartxt.background = true;
cartxt.backgroundColor = 0x00FFFF;
cartxt.text = "車両ベース";
cartxt.addEventListener(MouseEvent.MOUSE_DOWN, cartxtstart);
addChild(cartxt);
var carinp:TextField = new TextField();
carinp.border = true;
carinp.x = 280; carinp.y = 220;
carinp.width = 70; carinp.height = 20;
carinp.background = true;
carinp.backgroundColor = 0xFFFFFF;
carinp.type = "input";
carinp.restrict = "0-9";
carinp.text = carnum.toString();
carinp.addEventListener(KeyboardEvent.KEY_UP, KeyDown);
carinp.addEventListener(MouseEvent.MOUSE_DOWN, carinpstart);
addChild(carinp);
function cartxtstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - cartxt.x;
clicky = mouseY - cartxt.y;
push = 1;
un = 14;}
}
function carinpstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - carinp.x;
clicky = mouseY - carinp.y;
push = 1;
un = 15;}
}
var bastxt:TextField = new TextField();
bastxt.x = 190; bastxt.y = 80;
bastxt.width = 85; bastxt.height = 20;
bastxt.background = true;
bastxt.backgroundColor = 0x00FFFF;
bastxt.text = "原価(自動計算)";
bastxt.addEventListener(MouseEvent.MOUSE_DOWN, bastxtstart);
addChild(bastxt);
var basinp:TextField = new TextField();
basinp.border = true;
basinp.x = 190; basinp.y = 100;
basinp.width = 70; basinp.height = 20;
basinp.background = true;
basinp.backgroundColor = 0xFFFFFF;
basinp.text = gen.toString();
basinp.addEventListener(MouseEvent.MOUSE_DOWN, basinpstart);
addChild(basinp);
function bastxtstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - bastxt.x;
clicky = mouseY - bastxt.y;
push = 1;
un = 16;}
}
function basinpstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - basinp.x;
clicky = mouseY - basinp.y;
push = 1;
un = 17;}
}
var restxt:TextField = new TextField();
restxt.x = 10; restxt.y = 130;
restxt.width = 50; restxt.height = 20;
restxt.background = true;
restxt.backgroundColor = 0x00FFFF;
restxt.text = "諸経費";
restxt.addEventListener(MouseEvent.MOUSE_DOWN, restxtstart);
addChild(restxt);
var resinp:TextField = new TextField();
resinp.border = true;
resinp.type = "input";
resinp.x = 10; resinp.y = 150;
resinp.width = 70; resinp.height = 20;
resinp.background = true;
resinp.backgroundColor = 0xFFFFFF;
resinp.restrict = "0-9";
resinp.text = res.toString();
resinp.addEventListener(KeyboardEvent.KEY_UP, resKeyDown);
resinp.addEventListener(MouseEvent.MOUSE_DOWN, resinpstart);
addChild(resinp);
function restxtstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - restxt.x;
clicky = mouseY - restxt.y;
push = 1;
un = 18;}
}
function resinpstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - resinp.x;
clicky = mouseY - resinp.y;
push = 1;
un = 19;}
}
var modetxt:TextField = new TextField();
modetxt.x = 190; modetxt.y = 130;
modetxt.width = 70; modetxt.height = 20;
modetxt.background = true;
modetxt.backgroundColor = 0x00FFFF;
modetxt.text = "モード選択";
modetxt.addEventListener(MouseEvent.MOUSE_DOWN, modetxtstart);
addChild(modetxt);
var modedi:TextField = new TextField();
modedi.border = true;
modedi.x = 190; modedi.y = 150;
modedi.width = 100; modedi.height = 20;
modedi.background = true;
modedi.backgroundColor = 0xFFFFFF;
modedi.text = "粗利固定モード";
modedi.addEventListener(MouseEvent.MOUSE_UP, modedichange);
modedi.addEventListener(MouseEvent.MOUSE_DOWN, modedistart);
addChild(modedi);
function modetxtstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - modetxt.x;
clicky = mouseY - modetxt.y;
push = 1;
un = 20;}
}
function modedistart(e:MouseEvent):void
{
move = 0;
if(mode == 2){
clickx = mouseX - modedi.x;
clicky = mouseY - modedi.y;
push = 1;
un = 21;}
}
var areseltxt:TextField = new TextField();
areseltxt.x = 10; areseltxt.y = 10;
areseltxt.width = 130; areseltxt.height = 20;
areseltxt.background = true;
areseltxt.backgroundColor = 0x00FFFF;
areseltxt.text = "統括部選択(クリック!)";
addChild(areseltxt);
var kitatxt:TextField = new TextField();
kitatxt.border = true;
kitatxt.x = 10; kitatxt.y = 30;
kitatxt.width = 70; kitatxt.height = 20;
kitatxt.background = true;
kitatxt.backgroundColor = 0xFFFFFF;
kitatxt.text = "北日本";
kitatxt.addEventListener(MouseEvent.CLICK, kitabra);
addChild(kitatxt);
var higasitxt:TextField = new TextField();
higasitxt.border = true;
higasitxt.x = 80; higasitxt.y = 30;
higasitxt.width = 70; higasitxt.height = 20;
higasitxt.background = true;
higasitxt.backgroundColor = 0xFFFFFF;
higasitxt.text = "東日本";
higasitxt.addEventListener(MouseEvent.CLICK, higasibra);
addChild(higasitxt);
var syutotxt:TextField = new TextField();
syutotxt.border = true;
syutotxt.x = 150; syutotxt.y = 30;
syutotxt.width = 70; syutotxt.height = 20;
syutotxt.background = true;
syutotxt.backgroundColor = 0xFFFFFF;
syutotxt.text = "首都圏";
syutotxt.addEventListener(MouseEvent.CLICK, syutobra);
addChild(syutotxt);
var nisitxt:TextField = new TextField();
nisitxt.border = true;
nisitxt.x = 220; nisitxt.y = 30;
nisitxt.width = 70; nisitxt.height = 20;
nisitxt.background = true;
nisitxt.backgroundColor = 0xFFFFFF;
nisitxt.text = "西日本";
nisitxt.addEventListener(MouseEvent.CLICK, nisibra);
addChild(nisitxt);
var braseltxt:TextField = new TextField();
braseltxt.x = 10; braseltxt.y = 10;
braseltxt.width = 150; braseltxt.height = 20;
braseltxt.background = true;
braseltxt.backgroundColor = 0x00FFFF;
braseltxt.text = "支店選択(↓クリック!)";
var umedatxt:TextField = new TextField();
umedatxt.border = true;
umedatxt.x = 80; umedatxt.y = 30;
umedatxt.width = 70; umedatxt.height = 20;
umedatxt.background = true;
umedatxt.backgroundColor = 0xFFFFFF;
umedatxt.text = "梅田";
umedatxt.addEventListener(MouseEvent.MOUSE_DOWN, umepro);
umedatxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var saptxt:TextField = new TextField();
saptxt.border = true;
saptxt.x = 80; saptxt.y = 30;
saptxt.width = 70; saptxt.height = 20;
saptxt.background = true;
saptxt.backgroundColor = 0xFFFFFF;
saptxt.text = "札幌";
saptxt.addEventListener(MouseEvent.MOUSE_DOWN, sapppro);
saptxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var mitotxt:TextField = new TextField();
mitotxt.border = true;
mitotxt.x = 80; mitotxt.y = 30;
mitotxt.width = 70; mitotxt.height = 20;
mitotxt.background = true;
mitotxt.backgroundColor = 0xFFFFFF;
mitotxt.text = "水戸";
mitotxt.addEventListener(MouseEvent.MOUSE_DOWN, mitopro);
mitotxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var yoyotxt:TextField = new TextField();
yoyotxt.border = true;
yoyotxt.x = 80; yoyotxt.y = 30;
yoyotxt.width = 70; yoyotxt.height = 20;
yoyotxt.background = true;
yoyotxt.backgroundColor = 0xFFFFFF;
yoyotxt.text = "東京";
yoyotxt.addEventListener(MouseEvent.MOUSE_DOWN, tokypro);
yoyotxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var hirotxt:TextField = new TextField();
hirotxt.border = true;
hirotxt.x = 150; hirotxt.y = 30;
hirotxt.width = 70; hirotxt.height = 20;
hirotxt.background = true;
hirotxt.backgroundColor = 0xFFFFFF;
hirotxt.text = "広島";
hirotxt.addEventListener(MouseEvent.MOUSE_DOWN, hiropro);
hirotxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var moritxt:TextField = new TextField();
moritxt.border = true;
moritxt.x = 150; moritxt.y = 30;
moritxt.width = 70; moritxt.height = 20;
moritxt.background = true;
moritxt.backgroundColor = 0xFFFFFF;
moritxt.text = "盛岡";
moritxt.addEventListener(MouseEvent.MOUSE_DOWN, moripro);
moritxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var utsutxt:TextField = new TextField();
utsutxt.border = true;
utsutxt.x = 150; utsutxt.y = 30;
utsutxt.width = 70; utsutxt.height = 20;
utsutxt.background = true;
utsutxt.backgroundColor = 0xFFFFFF;
utsutxt.text = "宇都宮";
utsutxt.addEventListener(MouseEvent.MOUSE_DOWN, utsupro);
utsutxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var hachtxt:TextField = new TextField();
hachtxt.border = true;
hachtxt.x = 150; hachtxt.y = 30;
hachtxt.width = 70; hachtxt.height = 20;
hachtxt.background = true;
hachtxt.backgroundColor = 0xFFFFFF;
hachtxt.text = "八王子";
hachtxt.addEventListener(MouseEvent.MOUSE_DOWN, hachpro);
hachtxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var fukutxt:TextField = new TextField();
fukutxt.border = true;
fukutxt.x = 220; fukutxt.y = 30;
fukutxt.width = 70; fukutxt.height = 20;
fukutxt.background = true;
fukutxt.backgroundColor = 0xFFFFFF;
fukutxt.text = "福岡";
fukutxt.addEventListener(MouseEvent.MOUSE_DOWN, fukupro);
fukutxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var akittxt:TextField = new TextField();
akittxt.border = true;
akittxt.x = 220; akittxt.y = 30;
akittxt.width = 70; akittxt.height = 20;
akittxt.background = true;
akittxt.backgroundColor = 0xFFFFFF;
akittxt.text = "秋田";
akittxt.addEventListener(MouseEvent.MOUSE_DOWN, akitpro);
akittxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var oomitxt:TextField = new TextField();
oomitxt.border = true;
oomitxt.x = 220; oomitxt.y = 30;
oomitxt.width = 70; oomitxt.height = 20;
oomitxt.background = true;
oomitxt.backgroundColor = 0xFFFFFF;
oomitxt.text = "大宮";
oomitxt.addEventListener(MouseEvent.MOUSE_DOWN, oomipro);
oomitxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var yokotxt:TextField = new TextField();
yokotxt.border = true;
yokotxt.x = 220; yokotxt.y = 30;
yokotxt.width = 70; yokotxt.height = 20;
yokotxt.background = true;
yokotxt.backgroundColor = 0xFFFFFF;
yokotxt.text = "横浜";
yokotxt.addEventListener(MouseEvent.MOUSE_DOWN, yokopro);
yokotxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var kumatxt:TextField = new TextField();
kumatxt.border = true;
kumatxt.x = 10; kumatxt.y = 50;
kumatxt.width = 70; kumatxt.height = 20;
kumatxt.background = true;
kumatxt.backgroundColor = 0xFFFFFF;
kumatxt.text = "熊本";
kumatxt.addEventListener(MouseEvent.MOUSE_DOWN, kumapro);
kumatxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var sendtxt:TextField = new TextField();
sendtxt.border = true;
sendtxt.x = 10; sendtxt.y = 50;
sendtxt.width = 70; sendtxt.height = 20;
sendtxt.background = true;
sendtxt.backgroundColor = 0xFFFFFF;
sendtxt.text = "仙台";
sendtxt.addEventListener(MouseEvent.MOUSE_DOWN, sendpro);
sendtxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var kasitxt:TextField = new TextField();
kasitxt.border = true;
kasitxt.x = 10; kasitxt.y = 50;
kasitxt.width = 70; kasitxt.height = 20;
kasitxt.background = true;
kasitxt.backgroundColor = 0xFFFFFF;
kasitxt.text = "柏";
kasitxt.addEventListener(MouseEvent.MOUSE_DOWN, kasipro);
kasitxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var sizutxt:TextField = new TextField();
sizutxt.border = true;
sizutxt.x = 80; sizutxt.y = 50;
sizutxt.width = 70; sizutxt.height = 20;
sizutxt.background = true;
sizutxt.backgroundColor = 0xFFFFFF;
sizutxt.text = "静岡";
sizutxt.addEventListener(MouseEvent.MOUSE_DOWN, sizupro);
sizutxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var yamatxt:TextField = new TextField();
yamatxt.border = true;
yamatxt.x = 80; yamatxt.y = 50;
yamatxt.width = 70; yamatxt.height = 20;
yamatxt.background = true;
yamatxt.backgroundColor = 0xFFFFFF;
yamatxt.text = "山形";
yamatxt.addEventListener(MouseEvent.MOUSE_DOWN, yamapro);
yamatxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var nagotxt:TextField = new TextField();
nagotxt.border = true;
nagotxt.x = 150; nagotxt.y = 50;
nagotxt.width = 70; nagotxt.height = 20;
nagotxt.background = true;
nagotxt.backgroundColor = 0xFFFFFF;
nagotxt.text = "名古屋";
nagotxt.addEventListener(MouseEvent.MOUSE_DOWN, nagopro);
nagotxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var koortxt:TextField = new TextField();
koortxt.border = true;
koortxt.x = 150; koortxt.y = 50;
koortxt.width = 70; koortxt.height = 20;
koortxt.background = true;
koortxt.backgroundColor = 0xFFFFFF;
koortxt.text = "郡山";
koortxt.addEventListener(MouseEvent.MOUSE_DOWN, koorpro);
koortxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var kyototxt:TextField = new TextField();
kyototxt.border = true;
kyototxt.x = 220; kyototxt.y = 50;
kyototxt.width = 70; kyototxt.height = 20;
kyototxt.background = true;
kyototxt.backgroundColor = 0xFFFFFF;
kyototxt.text = "京都";
kyototxt.addEventListener(MouseEvent.MOUSE_DOWN, kyotpro);
kyototxt.addEventListener(MouseEvent.MOUSE_UP, navijump);
var backtxt:TextField = new TextField();
backtxt.border = true;
backtxt.x = 10; backtxt.y = 30;
backtxt.width = 70; backtxt.height = 20;
backtxt.background = true;
backtxt.backgroundColor = 0xFFFFFF;
backtxt.addEventListener(MouseEvent.CLICK, areback);
backtxt.text = "統括部選択";
var new1txt:TextField = new TextField();
new1txt.x = 100; new1txt.y = 130;
new1txt.width = 80; new1txt.height = 20;
new1txt.background = true;
new1txt.backgroundColor = 0x00FFFF;
new1txt.type = "input";
new1txt.text = "その他原価";
new1txt.doubleClickEnabled = true;
new1txt.addEventListener(KeyboardEvent.KEY_UP, urahanbetsu1);
new1txt.addEventListener(MouseEvent.MOUSE_DOWN, new1txtstart);
addChild(new1txt);
var new1inp:TextField = new TextField();
new1inp.border = true;
new1inp.x = new1txt.x; new1inp.y = new1txt.y + 20;
new1inp.width = 70; new1inp.height = 20;
new1inp.background = true;
new1inp.backgroundColor = 0xFFFFFF;
new1inp.type = "input";
new1inp.restrict = "0-9";
new1inp.text = new1num.toString();
new1inp.addEventListener(KeyboardEvent.KEY_UP, KeyDown);
new1inp.addEventListener(MouseEvent.MOUSE_DOWN, new1inpstart);
addChild(new1inp);
var new1haikei:TextField = new TextField();
new1haikei.border = true;
new1haikei.x = new1txt.x; new1inp.y = new1txt.y + 20;
new1haikei.width = 70; new1haikei.height = 20;
new1haikei.background = true;
new1haikei.backgroundColor = 0xFFFFFF;
new1haikei.type = "input";
new1haikei.text = "keywords";
new1haikei.addEventListener(KeyboardEvent.KEY_UP, gazouload);
new1haikei.addEventListener(MouseEvent.MOUSE_DOWN, new1inpstart);
function new1txtstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - new1txt.x;
clicky = mouseY - new1txt.y;
push = 1;
un = 22;}
}
function new1inpstart(e:MouseEvent):void
{
if(mode == 2){
clickx = mouseX - new1inp.x;
clicky = mouseY - new1inp.y;
push = 1;
un = 23;}
}
var seiri:TextField = new TextField();
seiri.border = true;
seiri.x = 340; seiri.y = 10;
seiri.width = 120; seiri.height = 20;
seiri.background = true;
seiri.backgroundColor = 0xFFFFFF;
seiri.text = "各項目下に整理";
seiri.addEventListener(MouseEvent.CLICK, seiriloca);
function seiriloca(event:MouseEvent):void
{
kyoinp.x = kyotxt.x; kyoinp.y = kyotxt.y + 20;
tolinp.x = toltxt.x; tolinp.y = toltxt.y + 20;
basinp.x = bastxt.x; basinp.y = bastxt.y + 20;
resinp.x = restxt.x; resinp.y = restxt.y + 20;
beninp.x = bentxt.x; beninp.y = bentxt.y + 20;
modedi.x = modetxt.x; modedi.y = modetxt.y + 20;
gsinp.x = gstxt.x; gsinp.y = gstxt.y + 20;
fueinp.x = fuetxt.x; fueinp.y = fuetxt.y + 20;
teainp.x = teatxt.x; teainp.y = teatxt.y + 20;
carinp.x = cartxt.x; carinp.y = cartxt.y + 20;
new1inp.x = new1txt.x; new1inp.y = new1txt.y + 20;
addChild(kyoinp);
addChild(tolinp);
addChild(basinp);
addChild(resinp);
addChild(beninp);
addChild(modedi);
addChild(gsinp);
addChild(fueinp);
addChild(teainp);
addChild(carinp);
if(new1txt.text == "背景"){
new1num = 0;
new1haikei.x =new1inp.x;new1haikei.y =new1inp.y;
removeChild(new1inp);
addChild(new1haikei);}
else{
addChild(new1inp);}
}
var defo:TextField = new TextField();
defo.border = true;
defo.x = 340; defo.y = 30;
defo.width = 120; defo.height = 20;
defo.background = true;
defo.backgroundColor = 0xFFFFFF;
defo.text = "最初の位置に戻す";
defo.addEventListener(MouseEvent.CLICK, defoloca);
function defoloca(event:MouseEvent):void
{
kyotxt.x = 10; kyotxt.y = 80;
kyoinp.x = kyotxt.x; kyoinp.y = kyotxt.y + 20;
toltxt.x = 100; toltxt.y = 80;
tolinp.x = toltxt.x; tolinp.y = toltxt.y + 20;
bastxt.x = 190; bastxt.y = 80;
basinp.x = bastxt.x; basinp.y = bastxt.y + 20;
restxt.x = 10; restxt.y = 130;
resinp.x = restxt.x; resinp.y = restxt.y + 20;
bentxt.x = 280; bentxt.y = 80;
beninp.x = bentxt.x; beninp.y = bentxt.y + 20;
modetxt.x = 190; modetxt.y = 130;
modedi.x = modetxt.x; modedi.y = modetxt.y + 20;
gstxt.x = 10; gstxt.y = 200;
gsinp.x = gstxt.x; gsinp.y = gstxt.y + 20;
fuetxt.x = 100; fuetxt.y = 200;
fueinp.x = fuetxt.x; fueinp.y = fuetxt.y + 20;
teatxt.x = 190; teatxt.y = 200;
teainp.x = teatxt.x; teainp.y = teatxt.y + 20;
cartxt.x = 280; cartxt.y = 200;
carinp.x = cartxt.x; carinp.y = cartxt.y + 20;
new1txt.x = 100; new1txt.y = 130;
new1inp.x = new1txt.x; new1inp.y = new1txt.y + 20;
addChild(kyotxt);
addChild(kyoinp);
addChild(toltxt);
addChild(tolinp);
addChild(bastxt);
addChild(basinp);
addChild(restxt);
addChild(resinp);
addChild(bentxt);
addChild(beninp);
addChild(modetxt);
addChild(modedi);
addChild(gstxt);
addChild(gsinp);
addChild(fuetxt);
addChild(fueinp);
addChild(teatxt);
addChild(teainp);
addChild(cartxt);
addChild(carinp);
addChild(new1txt);
if(new1txt.text == "背景"){
new1num = 0;
new1haikei.x =new1inp.x;new1haikei.y =new1inp.y;
removeChild(new1inp);
addChild(new1haikei);}
else{
addChild(new1inp);}
}
function KeyDown(event:KeyboardEvent):void
{
kyonum = Number(kyoinp.text);
tolnum = Number(tolinp.text);
gsnum = Number(gsinp.text);
fuenum = Number(fueinp.text);
teanum = Number(teainp.text);
carnum = Number(carinp.text);
new1num = Number(new1inp.text);
if(mode == 0)
{
bennum = Number(beninp.text);
gen = (kyonum*gsnum/fuenum+kyonum*teanum+tolnum+carnum+new1num);
res = (gen*100)/(100-bennum);
}
if(mode == 1)
{
gen = (kyonum*gsnum/fuenum+kyonum*teanum+tolnum+carnum+new1num);
res = Number(resinp.text);
var bennumm:Number = Math.round(((res-gen)/res)*10000);
bennum = bennumm/100;
}
basinp.text = gen.toString();
resinp.text = res.toString();
beninp.text = bennum.toString();
kyoinp.text = kyonum.toString();
tolinp.text = tolnum.toString();
gsinp.text = gsnum.toString();
fueinp.text = fuenum.toString();
teainp.text = teanum.toString();
carinp.text = carnum.toString();
new1inp.text = new1num.toString();
addChild(basinp);
addChild(resinp);
addChild(beninp);
}
function araKeyDown(event:KeyboardEvent):void
{
kyonum = Number(kyoinp.text);
tolnum = Number(tolinp.text);
gsnum = Number(gsinp.text);
fuenum = Number(fueinp.text);
teanum = Number(teainp.text);
carnum = Number(carinp.text);
bennum = Number(beninp.text);
gen = (kyonum*gsnum/fuenum+kyonum*teanum+tolnum+carnum+new1num);
res = (gen*100)/(100-bennum);
basinp.text = gen.toString();
resinp.text = res.toString();
beninp.text = bennum.toString();
addChild(basinp);
addChild(resinp);
addChild(beninp);
}
function resKeyDown(event:KeyboardEvent):void
{
gen = (kyonum*gsnum/fuenum+kyonum*teanum+tolnum+carnum+new1num);
res = Number(resinp.text);
var bennumm:Number = Math.round(((res-gen)/res)*10000);
bennum = bennumm/100;
basinp.text = gen.toString();
resinp.text = res.toString();
beninp.text = bennum.toString();
addChild(basinp);
addChild(resinp);
addChild(beninp);
}
function nisibra(event:MouseEvent):void
{
removeChild(areseltxt);
removeChild(kitatxt);
removeChild(higasitxt);
removeChild(syutotxt);
removeChild(nisitxt);
addChild(braseltxt);
addChild(kyototxt);
addChild(umedatxt);
addChild(hirotxt);
addChild(fukutxt);
addChild(kumatxt);
addChild(sizutxt);
addChild(nagotxt);
addChild(backtxt);
}
function higasibra(event:MouseEvent):void
{
removeChild(areseltxt);
removeChild(kitatxt);
removeChild(higasitxt);
removeChild(syutotxt);
removeChild(nisitxt);
addChild(braseltxt);
addChild(mitotxt);
addChild(utsutxt);
addChild(oomitxt);
addChild(kasitxt);
addChild(backtxt);
}
function syutobra(event:MouseEvent):void
{
removeChild(areseltxt);
removeChild(kitatxt);
removeChild(higasitxt);
removeChild(syutotxt);
removeChild(nisitxt);
addChild(braseltxt);
addChild(yoyotxt);
addChild(hachtxt);
addChild(yokotxt);
addChild(backtxt);
}
function kitabra(event:MouseEvent):void
{
removeChild(areseltxt);
removeChild(kitatxt);
removeChild(higasitxt);
removeChild(syutotxt);
removeChild(nisitxt);
addChild(braseltxt);
addChild(saptxt);
addChild(moritxt);
addChild(akittxt);
addChild(sendtxt);
addChild(yamatxt);
addChild(koortxt);
addChild(backtxt);
}
function areback(event:MouseEvent):void
{
addChild(areseltxt);
addChild(kitatxt);
addChild(higasitxt);
addChild(syutotxt);
addChild(nisitxt);
addChild(kyototxt);
addChild(umedatxt);
addChild(hirotxt);
addChild(fukutxt);
addChild(kumatxt);
addChild(sizutxt);
addChild(nagotxt);
addChild(mitotxt);
addChild(utsutxt);
addChild(oomitxt);
addChild(kasitxt);
addChild(backtxt);
addChild(yoyotxt);
addChild(hachtxt);
addChild(yokotxt);
removeChild(backtxt);
removeChild(braseltxt);
removeChild(kyototxt);
removeChild(umedatxt);
removeChild(hirotxt);
removeChild(fukutxt);
removeChild(kumatxt);
removeChild(sizutxt);
removeChild(nagotxt);
removeChild(mitotxt);
removeChild(utsutxt);
removeChild(oomitxt);
removeChild(kasitxt);
removeChild(yoyotxt);
removeChild(hachtxt);
removeChild(yokotxt);
removeChild(saptxt);
removeChild(moritxt);
removeChild(akittxt);
removeChild(sendtxt);
removeChild(yamatxt);
removeChild(koortxt);
}
function umepro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E5%A4%A7%E9%98%AA%E5%B8%82%E5%8C%97%E5%8C%BA%E5%85%8E%E6%88%91%E9%87%8E%E7%94%BA15-13&keyword1=%E7%A5%9E%E6%88%B8%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function sapppro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E5%8C%97%E6%B5%B7%E9%81%93%E6%9C%AD%E5%B9%8C%E5%B8%82%E7%99%BD%E7%9F%B3%E5%8C%BA%E6%9D%B1%E6%9C%AD%E5%B9%8C2%E6%9D%A16%E4%B8%81%E7%9B%AE1-11&keyword1=%E6%9C%AD%E5%B9%8C%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function moripro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E5%B2%A9%E6%89%8B%E7%9C%8C%E7%9B%9B%E5%B2%A1%E5%B8%82%E6%9C%AC%E5%AE%AE3-15-20&keyword1=%E7%9B%9B%E5%B2%A1%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function akitpro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E7%A7%8B%E7%94%B0%E7%9C%8C%E7%A7%8B%E7%94%B0%E5%B8%82%E5%B7%9D%E5%B0%BB%E7%94%BA&keyword1=%E7%A7%8B%E7%94%B0%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function yamapro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E5%B1%B1%E5%BD%A2%E7%9C%8C%E5%B1%B1%E5%BD%A2%E5%B8%82%E9%A3%AF%E6%B2%A2161-2&keyword1=%E5%B1%B1%E5%BD%A2%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function sendpro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E5%AE%AE%E5%9F%8E%E7%9C%8C%E4%BB%99%E5%8F%B0%E5%B8%82%E5%AE%AE%E5%9F%8E%E9%87%8E%E5%8C%BA%E6%A6%B4%E5%B2%A11-2-20&keyword1=%E4%BB%99%E5%8F%B0%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function koorpro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E7%A6%8F%E5%B3%B6%E7%9C%8C%E9%83%A1%E5%B1%B1%E5%B8%82%E5%A0%82%E5%89%8D%E7%94%BA3-25&keyword1=%E9%83%A1%E5%B1%B1%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function mitopro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E8%8C%A8%E5%9F%8E%E7%9C%8C%E6%B0%B4%E6%88%B8%E5%B8%82%E5%9F%8E%E6%9D%B13-5-49&keyword1=%E6%B0%B4%E6%88%B8%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function utsupro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E6%A0%83%E6%9C%A8%E7%9C%8C%E5%AE%87%E9%83%BD%E5%AE%AE%E5%B8%82%E9%9B%80%E3%81%AE%E5%AE%AE1-7-11&keyword1=%E5%AE%87%E9%83%BD%E5%AE%AE%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function oomipro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E5%9F%BC%E7%8E%89%E7%9C%8C%E3%81%95%E3%81%84%E3%81%9F%E3%81%BE%E5%B8%82%E5%A4%A7%E5%AE%AE%E5%8C%BA%E5%AE%AE%E7%94%BA2-56-2&keyword1=%E3%81%95%E3%81%84%E3%81%9F%E3%81%BE%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function kasipro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E5%8D%83%E8%91%89%E7%9C%8C%E6%9F%8F%E5%B8%82%E6%97%AD%E7%94%BA1-7-12&keyword1=%E6%9F%8F%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function tokypro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E6%9D%B1%E4%BA%AC%E9%83%BD%E6%B1%9F%E6%9D%B1%E5%8C%BA%E5%B8%B8%E7%9B%A4%EF%BC%91%EF%BC%8D%EF%BC%92%EF%BC%8D%EF%BC%95&keyword1=%E6%9D%B1%E4%BA%AC%E9%83%BD%E6%B8%8B%E8%B0%B7%E5%8C%BA&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function hachpro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E6%9D%B1%E4%BA%AC%E9%83%BD%E5%85%AB%E7%8E%8B%E5%AD%90%E5%B8%82%E4%B8%89%E5%B4%8E%E7%94%BA4-14&keyword1=%E7%94%BA%E7%94%B0%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function yokopro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E7%A5%9E%E5%A5%88%E5%B7%9D%E7%9C%8C%E6%A8%AA%E6%B5%9C%E5%B8%82%E7%A5%9E%E5%A5%88%E5%B7%9D%E5%8C%BA%E9%B6%B4%E5%B1%8B%E7%94%BA1-7-21&keyword1=%E6%A8%AA%E9%A0%88%E8%B3%80%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function sizupro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E9%9D%99%E5%B2%A1%E7%9C%8C%E9%9D%99%E5%B2%A1%E5%B8%82%E8%91%B5%E5%8C%BA%E4%BC%9D%E9%A6%AC%E7%94%BA8-1&keyword1=%E6%B5%9C%E6%9D%BE%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function nagopro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E6%84%9B%E7%9F%A5%E7%9C%8C%E5%90%8D%E5%8F%A4%E5%B1%8B%E5%B8%82%E8%A5%BF%E5%8C%BA%E9%82%A3%E5%8F%A4%E9%87%8E2-20-10&keyword1=%E6%B4%A5%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function kyotpro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E4%BA%AC%E9%83%BD%E5%B8%82%E4%BC%8F%E8%A6%8B%E5%8C%BA%E7%AB%B9%E7%94%B0%E7%9C%9F%E5%B9%A1%E6%9C%A8%E7%94%BA22&keyword1=%E5%A4%A7%E6%B4%A5%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function hiropro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E5%BA%83%E5%B3%B6%E5%B8%82%E5%AE%89%E4%BD%90%E5%8D%97%E5%8C%BA%E7%A5%87%E5%9C%923-45-11-102&keyword1=%E6%9D%BE%E6%B1%9F%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function fukupro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E7%A6%8F%E5%B2%A1%E7%9C%8C%E7%A6%8F%E5%B2%A1%E5%B8%82%E4%B8%AD%E5%A4%AE%E5%8C%BA%E7%99%BD%E9%87%911-6-9&keyword1=%E4%BD%90%E4%B8%96%E4%BF%9D%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function kumapro(event:MouseEvent):void
{
url1 = "http://www.navitime.co.jp/?keyword0=%E7%86%8A%E6%9C%AC%E7%9C%8C%E7%86%8A%E6%9C%AC%E5%B8%82%E6%96%B0%E5%B8%82%E8%A1%9711%E7%95%AA%E5%9C%B011&keyword1=%E9%B9%BF%E5%85%90%E5%B3%B6%E5%B8%82&tollroad=1&ctl=0604&orv=&dnv=&orvAdd=&dnvAdd=";
}
function navijump(event:MouseEvent):void
{
var req:URLRequest = new URLRequest(url1);
navigateToURL(req);
}
function modedichange(event:MouseEvent):void
{
if(move == 0){
mode = mode + 1;
if(mode == 1)
{
modedi.text = "諸経費固定モード";
addChild(modedi);
}
if(mode == 2)
{
modedi.text = "カスタマイズモード";
kyoinp.type = "dynamic";
tolinp.type = "dynamic";
beninp.type = "dynamic";
gsinp.type = "dynamic";
fueinp.type = "dynamic";
teainp.type = "dynamic";
carinp.type = "dynamic";
resinp.type = "dynamic";
addChild(modedi);
addChild(defo);
addChild(seiri);
}
if(mode == 3)
{
mode = 0;
modedi.text = "粗利固定モード";
kyoinp.type = "input";
tolinp.type = "input";
beninp.type = "input";
gsinp.type = "input";
fueinp.type = "input";
teainp.type = "input";
carinp.type = "input";
resinp.type = "input";
addChild(modedi);
removeChild(defo);
removeChild(seiri);
}
}
}
function moveend(e:MouseEvent):void
{
push = 0;
un = 0;
}
function mlocate(e:MouseEvent):void
{
move = 1;
if(push == 1)
{
if(un == 1)
{
kyotxt.x = mouseX - clickx;
kyotxt.y = mouseY - clicky;
addChild(kyotxt);
}
if(un == 2)
{
kyoinp.x = mouseX - clickx;
kyoinp.y = mouseY - clicky;
addChild(kyoinp);
}
if(un == 3)
{
toltxt.x = mouseX - clickx;
toltxt.y = mouseY - clicky;
addChild(toltxt);
}
if(un == 4)
{
tolinp.x = mouseX - clickx;
tolinp.y = mouseY - clicky;
addChild(tolinp);
}
if(un == 5)
{
bentxt.x = mouseX - clickx;
bentxt.y = mouseY - clicky;
addChild(bentxt);
}
if(un == 6)
{
beninp.x = mouseX - clickx;
beninp.y = mouseY - clicky;
addChild(beninp);
}
if(un == 8)
{
gstxt.x = mouseX - clickx;
gstxt.y = mouseY - clicky;
addChild(gstxt);
}
if(un == 9)
{
gsinp.x = mouseX - clickx;
gsinp.y = mouseY - clicky;
addChild(gsinp);
}
if(un == 10)
{
fuetxt.x = mouseX - clickx;
fuetxt.y = mouseY - clicky;
addChild(fuetxt);
}
if(un == 11)
{
fueinp.x = mouseX - clickx;
fueinp.y = mouseY - clicky;
addChild(fueinp);
}
if(un == 12)
{
teatxt.x = mouseX - clickx;
teatxt.y = mouseY - clicky;
addChild(teatxt);
}
if(un == 13)
{
teainp.x = mouseX - clickx;
teainp.y = mouseY - clicky;
addChild(teainp);
}
if(un == 14)
{
cartxt.x = mouseX - clickx;
cartxt.y = mouseY - clicky;
addChild(cartxt);
}
if(un == 15)
{
carinp.x = mouseX - clickx;
carinp.y = mouseY - clicky;
addChild(carinp);
}
if(un == 16)
{
bastxt.x = mouseX - clickx;
bastxt.y = mouseY - clicky;
addChild(bastxt);
}
if(un == 17)
{
basinp.x = mouseX - clickx;
basinp.y = mouseY - clicky;
addChild(basinp);
}
if(un == 18)
{
restxt.x = mouseX - clickx;
restxt.y = mouseY - clicky;
addChild(restxt);
}
if(un == 19)
{
resinp.x = mouseX - clickx;
resinp.y = mouseY - clicky;
addChild(resinp);
}
if(un == 20)
{
modetxt.x = mouseX - clickx;
modetxt.y = mouseY - clicky;
addChild(modetxt);
}
if(un == 21)
{
modedi.x = mouseX - clickx;
modedi.y = mouseY - clicky;
addChild(modedi);
}
if(un == 22)
{
new1txt.x = mouseX - clickx;
new1txt.y = mouseY - clicky;
addChild(new1txt);
}
if(un == 23)
{
new1inp.x = mouseX - clickx;
new1inp.y = mouseY - clicky;
if(new1txt.text == "背景"){
new1num = 0;
new1haikei.x =new1inp.x;new1haikei.y =new1inp.y;
removeChild(new1inp);
addChild(new1haikei);}
else{
addChild(new1inp)
removeChild(new1haikei);}
}
}
}
function urahanbetsu1(event:KeyboardEvent):void
{
if(new1txt.text == "背景"){
new1haikei.x =new1inp.x;new1haikei.y =new1inp.y;
removeChild(new1inp);
addChild(new1haikei);}
else{
addChild(new1inp)
removeChild(new1haikei);}
}
function gazouload(event:KeyboardEvent):void
{
query = new1haikei.text;
var URL:String = "http://pipes.yahooapis.com/pipes/pipe.run?_id=1FZD9tbQ3RGdxrAHbbsjiw&_render=rss&n=" + String(numOfImage) + "&q=" + escapeMultiByte(query);
var kcode:uint = event.keyCode;
if(kcode == 13)
{
var req:URLRequest = new URLRequest(URL);
loader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.TEXT;
req.method = "GET";
req.url = URL;
configureListeners(loader);
loader.load(req);
function configureListeners(dispatcher:IEventDispatcher):void
{
dispatcher.addEventListener(Event.COMPLETE, completeHandler);
}
function completeHandler(event:Event):void
{
if(re == 1 && er > 0)
{
for (var era:int = 1;era <= 36; era++)
{
stage.removeChildAt(0);
}
}
else{re = 1}
var loader:URLLoader = URLLoader(event.target);
xmlData = new XML(loader.data);
var count:uint = 0;
er = xmlData.channel.item.length();
if(er>=100){er = 100}
default xml namespace = media;
for (var i : int = 1; i <= 36; i++)
{
var imgkind:uint = Math.floor (Math.random () * er);
var imgURL:String = xmlData.channel.item[imgkind].media::group.media::thumbnail.@url;
var imgReq:URLRequest = new URLRequest(imgURL);
var img:Loader = new Loader();
img.load(imgReq);
img.alpha = 0.4;
img.x = imgWidth * (count % 6) + imgOffset;
img.y = imgHeight * Math.round(count / 6 -0.5) + imgOffset;
stage.addChildAt( img,0 );
count++;
}
}
}
}
}
}
}