ActionScript domina quien viene al frente swapDepths

1.- En este ejemplo he creado 4 clips de película

2.- En el primer fotograma de la línea de tiempo principal declaramos una variable "x"

   1. var x=0

3.- En cada uno de los clips de película les asignamos el siguiente Actionscript


   1. //Al presionar comenzamos a arrastrar el clip
   2. on (press) {
   3.       startDrag(this);
   4. }
   5. //Al liberar dejamos de arrastrar el clip
   6. on (release) {
   7.       stopDrag();
   8. }
   9. //Al presionar o liberar
  10. on (press, release) {
  11.       _root.x +=1; //Incrementamos el valor de la variable en 1
  12.       this.swapDepths(_root.x); //Le asignamos como nivel de apilamiento
  13.       //el valor de la variable
  14. }

JavaScript 序数词

Number.prototype.ordinal = function () {
	return this + (
		(this % 10 == 1 && this % 100 != 11) ? 'st' :
		(this % 10 == 2 && this % 100 != 12) ? 'nd' :
		(this % 10 == 3 && this % 100 != 13) ? 'rd' : 'th'
	);
}

HTML html链接新窗口

<a href="link" title="hover text" target="_blank">text to link</a>

Lua Lua类层次结构

class("newclass", parentclass)

Lua 在lua中调用函数和assigment

self.object = domainname.object2:function(param1,param2)

Bash unix系统中网络管理员的有用命令和文件

#useful commands:
	hostname - show or set the system’s host name
	ifconfig - configure a network interface
	host - DNS lookup utility (host "adress.com")
	route - show / manipulate the IP routing table
	netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
	dnsdomainname - show the system’s DNS domain name
	arp - manipulate the system ARP cache
	ping, ping6 - send ICMP ECHO_REQUEST to network hosts



#useful conf files:

#DNS and resolv
/etc/hosts 
/etc/resolv.conf

#eth configuration
/etc/network/interfaces

Bash 本地LAN内或路由器后面的动态IP更新(对于像zoneedit或dyndns这样的DNS服务)

#!/bin/sh
newip=`wget -o /dev/null -O - http://simple.showmyip.com | cut -f1 -d' ' | sed -n 1p`
presentip=`host myweb.com | sed -n 1p | cut -d' ' -f4`
if [ "$newip" != "$presentip" ]; then update_dns_ip.sh; fi

JavaScript moveCaret

function moveCaret(e, n) {
  e.selectionStart = e.selectionEnd = n;
}

Bash linux日期和时钟的变化

sudo date --set "2006-08-19 00:43" #system update
sudo hwclock --set --date="2006-08-19 00:43" #bios update

HTML xhtml doc结构中的swfObject。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

	<title>untitled</title>
	<script type="text/javascript" src="swfobject.js"></script>
</head>

<body>


		
<div id="flashcontent">
  This text is replaced by the Flash movie.
</div>

<script type="text/javascript">
   var so = new SWFObject("movie.swf", "mymovie", "200", "100", "8", "#FFFFFF");
   so.write("flashcontent");
</script>

</body>
</html>