posted on 26 Dec 2008 01:08 by snippet
<?php
$Num=55;
print str_pad($Num, 6, "0", STR_PAD_LEFT);
?> |
| |
| |
<?php
$Num=55;
printf("%06d", $Num);
?> |
| |
Output : 000006
http://www.weberdev.com/get_example-3578.html
posted on 22 Dec 2008 23:37 by snippet
ใน MXML
<mx:Metadata>
[Event(name="myevent", type="com.MyEvent")]
</mx:Metadata>
//เรียก Event
dispatchEvent(new MyEvent(MyEvent.MY_EVENT));
Custom Event
package com
{
import flash.events.Event;
// our custom event extends flash.events.Event
public class MyEvent extends Event
{
// the string must be the same with the one specified
// in the Event metatag in name attribute
public static const MY_EVENT:String = "myevent";
// constructor
public function MyEvent(type:String):void
{
super(type);
}
}
}
อ้างอิง http://www.flexer.info/2008/05/30/how-to-add-an-event-to-a-custom-mxml-component-using-event-meta-tag/