flash on 2010-5-19
セキュリティサンドボックス侵害
♥0 |
Line 45 |
Modified 2010-05-19 23:49:36 |
MIT License
archived:2017-03-20 05:37:58
ActionScript3 source code
/**
* Copyright enecre ( http://wonderfl.net/user/enecre )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/sgHl
*/
//セキュリティサンドボックス侵害
package {
import flash.display.Sprite;
import flash.net.FileReference;
import flash.events.Event;
import flash.text.TextField;
import flash.net.XMLSocket;
import com.bit101.components.*;
[SWF(width = 465, height = 465, frameRate = 60, backgroundColor = 0xFFFFFF)]
public class FlashTest extends Sprite {
private var socket:XMLSocket = new XMLSocket();
private var file:FileReference = new FileReference();
private var tf:TextField = new TextField();
private const id:String = "NoName";
public function FlashTest() {
tf.text = "TEXTFIELD";
tf.y = 100;
tf.width = 400;
addChild(tf);
var button:PushButton = new PushButton(this,0,10,"Select File",function():void{
file.browse();
});
addChild(button);
socket.addEventListener(Event.CONNECT,function():void{
socket.send('<HELO name="' + id + '" sx="C" tid="w0" />');
tf.appendText("test");
});
file.addEventListener(Event.SELECT,onSelect);
}
private function onSelect(e:Event):void{
tf.appendText("hoge");
if(file.name != "config.ini"){
tf.text = "Filename Invalid.";
return;
}
check();
}
private function check():void{
try{
socket.connect('219.94.173.41', 10080);
tf.appendText("接続完了");
}
catch(e:Error){tf.text = "Failed to connect.";}
}
}
}