private function imageclick(evt:Event):void { var img:Image=evt.currentTarget as Image; var idx:int=int(img.data); // var str:String=placeholder.replace("{0}", idx.toString()); // this.insertString(str);
//关闭弹出菜单 this.popUpButton_pic.close(); } //设置字体属性 private function checkBox_fontsetup(evt:Event):void { var ch:CheckBox=evt.currentTarget as CheckBox; var data:String=ch.data.toString();
if (data == "fontWeight") { if (ch.selected) { // this.fontWeight="bold"; } else { // this.fontWeight="normal"; } }
if (data == "fontStyle") { if (ch.selected) { // this.fontStyle="italic"; } else { // this.fontStyle="normal"; } }
if (data == "textDecoration") { if (ch.selected) { // this.fontTextDecoration="underline"; } else { // this.fontTextDecoration="none"; } } }
//设置字体颜色 private function colorPicker_color(evt:ColorPickerEvent):void { // fontColor=this.fontsetup_color.selectedColor; }
private function insertString(insertStr:String):void { if (this.textEditor.selectionBeginIndex == this.textEditor.selectionEndIndex) { var startPart:String=this.textEditor.text.substring(0, this.textEditor.selectionBeginIndex); var endPart:String=this.textEditor.text.substring(this.textEditor.selectionEndIndex, this.textEditor.text.length); startPart+=insertStr; startPart+=endPart; this.textEditor.text=startPart; } else { this.textEditor.text=insertStr; } }
import mx.messaging.messages.AsyncMessage; import mx.messaging.events.MessageEvent; public function init(){ initChannel(); consumer.subscribe(); producer.addEventListener(MessageFaultEvent.FAULT,error);
public function initChannel(){ var url="http://192.168.200.14:8080/J2EE/"; var myStreamingAMF:StreamingAMFChannel = new StreamingAMFChannel(url+"my-streaming-amf", url+"messagebroker/streamingamf"); var myPollingAMF:AMFChannel = new AMFChannel(url+"my-polling-amf", url+"messagebroker/amfpolling"); myPollingAMF.pollingEnabled = true; myPollingAMF.pollingInterval = 2000; var channelSet:ChannelSet = new ChannelSet(); channelSet.addChannel(myStreamingAMF); channelSet.addChannel(myPollingAMF); consumer.channelSet = channelSet; producer.channelSet = channelSet; } public function messagehandle(event:MessageEvent){ // ta.text+=event.message.body.text+"\n"; // ta.htmlText+=event.message.body.htmlText;
this.vd.verticalScrollPosition=this.vd.maxVerticalScrollPosition; this.cs.verticalScrollPosition=cs.maxVerticalScrollPosition; var messages:String=event.message.body.text;
// var image:Image=new Image; // image.source="img/Face/134.swf"; // image.autoLoad=true; // vd.addChild(image); //日期和时间 var messageDate:Text=this.getTxtMessage(event.message.body.userAndDate) messageDate.setStyle("color","red") vd.addChild(messageDate); vd.addChild(parseMessage(messages));