Android-MotoDev Shop4Apps
MotoDev Shop4Apps对中国开放,目前豆腐的状态是刚注册了下,具体还没有发布,晚上回去测试。
另外就是我也没下载Moto的Market客户端,里边的Apk介绍希望做的比Google Market好一点,不然,,只能说两个字,杯具。
来几张可爱的图:



很Q,很可爱~
Flash-TextHighlighter
最近是越来越懒了,Blog有段时间接近于荒废……今天更新下哈。
顾名思义,TextHighlighter就是代码高亮,Demo和做法在这里:http://blog.formatlos.de/2009/06/22/as3-texthighlighter/
1.0版的下载:TextHighlighter_01.zip。
Code:
// highlight container
var highlight : Sprite = new Sprite();
addChild(highlight);
// create textfield
var textField : TextField = new TextField();
addChild(textField);
// apply text style and add text
...
// highlight style
var style : IHighlightStyle = new SimpleHighlightStyle(0x00ff00, 0.5);
// highlighter
var textHighlighter : TextHighlighter = new TextHighlighter(textField, highlight, style);
textHighlighter.highlight(/far/gi);
textHighlighter.highlight("Duden", false);
Flash-鼠标,键盘事件
今天咱来看下Flash的鼠标和键盘事件。。
先放Demo:
这个Demo实现的功能很简单,鼠标放到小球上,小球透明度会变成0.5,鼠标移开会恢复到1,按住鼠标可以拖动小球。按下键盘的上下左右键可以移动小球。
下边咱慢慢来看下,显示fla文档下的代码:
//设置舞台属性,坐上角对齐,不拉伸
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
//new一个Role类的实例出来,并居中显示
var mRole = new Role(stage);
addChild(mRole);
setCenter(mRole);
function setCenter(obj:DisplayObject):void{
obj.x = (stage.stageWidth - obj.width)/2;
obj.y = (stage.stageHeight - obj.height)/2;
}
//onResize事件
stage.addEventListener(Event.RESIZE,mResize);
function mResize(e:Event):void{
//场景大小变化时的操作
}
mklink 简单用法
mklink是 链接文件命令,具体用途是连接文件夹,或者说引用更来的直接?
什么时候会用到这个命令,以及在什么环境下可以用?
Windows平台下需要Vista或者更高版本,比如目前的Win7。
在非Windows下边基本都可以用。
Windows下的命令行如下,记得用管理员帐号运行cmd。
mklink "F:\目标文件夹" "E:\源文件夹" /j
Android-OnGestureListener接口
在做应用的时候难免会碰到触摸事件,Android提供了不少事件,只要实现OnGestureListener接口,并且呢,在onTouch方法里写个:
//记得要implements OnTouchListener,OnGestureListener
//public class mGestureDetector extends Activity implements OnTouchListener,OnGestureListener
private GestureDetector mGestureDetector;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.main);
View v = new View(this);
setContentView(v);
//mGestureDetector是个GestureDetector对象,记得初始化一下。
mGestureDetector = new GestureDetector(this);
//另外呢,需要针对onFling方法的监听,需要在监听的View里边加上:
v.setOnTouchListener(this);
v.setLongClickable(true);
}
public boolean onTouch(View v, MotionEvent mo) {
return mGestureDetector.onTouchEvent(mo);
}
另外是OnGestureListener接口必须实现的几个方法,具体要怎么实现大家自个儿对号入座吧。
public boolean onDown(MotionEvent e) {
return false;
}
public void onLongPress(MotionEvent e) {
}
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
float distanceY) {
return false;
}
public void onShowPress(MotionEvent e) {
}
public boolean onSingleTapConfirmed(MotionEvent e) {
return false;
}
public boolean onSingleTapUp(MotionEvent e) {
return false;
}
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
float velocityY) {
return true;
}
Google-New Approach To China
真是每天都有新闻,今天比昨天的baidu被干掉还要厉害。Google官方博文如下(被xxx的党和谐了):
Like many other well-known organizations, we face cyber attacks of varying degrees on a regular basis. In mid-December, we detected a highly sophisticated and targeted attack on our corporate infrastructure originating from China that resulted in the theft of intellectual property from Google. However, it soon became clear that what at first appeared to be solely a security incident--albeit a significant one--was something quite different.
First, this attack was not just on Google. As part of our investigation we have discovered that at least twenty other large companies from a wide range of businesses--including the Internet, finance, technology, media and chemical sectors--have been similarly targeted. We are currently in the process of notifying those companies, and we are also working with the relevant U.S. authorities.
Second, we have evidence to suggest that a primary goal of the attackers was accessing the Gmail accounts of Chinese human rights activists. Based on our investigation to date we believe their attack did not achieve that objective. Only two Gmail accounts appear to have been accessed, and that activity was limited to account information (such as the date the account was created) and subject line, rather than the content of emails themselves.
Third, as part of this investigation but independent of the attack on Google, we have discovered that the accounts of dozens of U.S.-, China- and Europe-based Gmail users who are advocates of human rights in China appear to have been routinely accessed by third parties. These accounts have not been accessed through any security breach at Google, but most likely via phishing scams or malware placed on the users' computers.
Flash-SWFAddress
SWFAddress是个干嘛用的东西呢?请看下边的内容:
主要就是一个SEO优化和URL语义化的东西,建议Flash整站的都看下吧~
SWFAddress - Deep linking for Flash and Ajax
SWFAddress is a small but powerful library that provides deep linking for Flash and Ajax. It's a developer tool, allowing creation of unique virtual URLs that can point to a website section or an application state. SWFAddress enables a number of important capabilities which are missing in today's rich web technologies including:
- Bookmarking in a browser or social website
- Sending links via email or instant messenger
- Finding specific content with the major search engines
- Utilizing browser history and reload buttons
Download SWFAddress 2.4 (12MB, Including docs, samples and sources) or just the core scripts and libraries (39KB).
Samples
Flash | Flex | Ajax | SEO | More »
License
SWFAddress is licensed under the MIT license.
Source
The latest and greatest development version of the project can be found at SourceForge.
Android – AlertDialog,Dialog
丢一个自定义AlertDialog的例子。
AlertDialog.Builder alert = new AlertDialog.Builder(aBrainExploration.this);
alert.setTitle(R.string.label_enterOneName);
// Set an EditText view to get user input
final EditText input = new EditText(aBrainExploration.this);
alert.setView(input);
alert.setPositiveButton("Ok",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int whichButton) {
Appendable value = input.getText();
// setTitle(value.toString());
}
});
alert.setNegativeButton("Cancel",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int whichButton) {
// Canceled.
}
});
alert.show();
相对来说有个更轻量级的Dialog类,用法也是差不多~