class BlogEntry extends Page { static $default_parent = array('BlogHolder'); static $can_be_root = false; static $icon = "blog/images/blogpage"; static $db = array( "Date" => "Datetime", "Author" => "Text", "Tags" => "Text" ); static $casting = array( "Date" => "Date" ); static $defaults = array( "ProvideComments" => true ); static $allowed_children = "none"; /** * overload so that the default date is today. */ public function populateDefaults(){ parent::populateDefaults(); $this->Date = date("d/m/Y H:i:s",time()); } /** * Ensures the most recent article edited on the same day is shown first. */ public function setDate($val){ $datepart = date("Y-m-d",strtotime($val)); $minutepart = date("H:i:s",time()); $date = $datepart . " " . $minutepart; return $this->setField("Date",$date); } function getCMSFields() { Requirements::javascript('blog/javascript/bbcodehelp.js'); Requirements::css('blog/css/bbcodehelp.css'); $firstName = Member::CurrentMember() ? Member::currentMember()->FirstName : ''; $codeparser = new BBCodeParser(); $fields = parent::getCMSFields(); $fields->removeFieldFromTab("Root.Content.Main","Content"); $fields->addFieldToTab("Root.Content.Main", new TextareaField("Content", "Content", 20)); $fields->addFieldToTab("Root.Content.Main", new CalendarDateField("Date", "Date"),"Content"); $fields->addFieldToTab("Root.Content.Main", new TextField("Author", "Author", $firstName),"Content"); $fields->addFieldToTab("Root.Content.Main", new LiteralField("BBCodeHelper", "
Method | Description |
---|---|
start() | This function is use to start the menu. You can set the parameter in action script and use this function to start the menu. |
getItems() | To get the array of the menu item object. |
getItemAt() | To get the menu item object as specified ID.. |
nextItem() | Tell the menu goto next item. This only work with enableMouseScroll set to false. |
prevItem() | Tell the menu goto prev item. This only work with enableMouseScroll set to false. |
gotoItem() | Tell the menu goto the item with ID. This only work with enableMouseScroll set to false. |
Availability Flash Player 8.
Edition Flash 8.
Usage RTMenuLite.getItems()
Returns Array; Object array of the menu items.
Description Method; get the Object array of the menu items.
Code Example :
var item_array = menu_mc.getItems();
for(i=0;i<item_array.length;i++) {
trace(item_array.id);
}
Availability Flash Player 8.
Edition Flash 8.
Usage RTMenuLite.getItemAt(id)
Parameters
id: Number: id of the menu item.
Returns MoiveClip; Object reference of the menu item.
Description Method; Get the object reference of the menu item by specified id.
Code Example :
for(i=0;i<item_max_id.length;i++) {
var item_array = menu_mc.getItemAt(i);
trace(item_array.id); }
Availability Flash Player 8.
Edition Flash 8.
Usage RTMenuLite.nextItem()
Returns None
Description Method; Move to next item.
Code Example :
//Action Script in a button
on(press) {
RTMenuLite_mc.nextItem();//Move to next item
}
Availability Flash Player 8.
Edition Flash 8.
Usage RTMenuLite.prevItem()
Returns None
Description Method; Move to previous item.
Code Example :
//Action Script in a button
on(press) {
RTMenuLite_mc.prevItem();//Move to previous item
}
Availability Flash Player 8.
Edition Flash 8.
Usage RTMenuLite.gotoItem(id)
Parameters
id: id number of each item. From left to right, 0 to item max.
Returns None
Description Method; Goto the item with specified id.
Code Example :
//Action Script in a button
on(press) {
RTMenuLite_mc.gotoItem(10);//Goto the item with id 10
}
Event | Description |
---|---|
onItemClick() | Broadcast when mouse clicked on the item. |
onItemRollOver() | Broadcast when mouse over on the item. |
onItemRollOut() | Broadcast when mouse move outside the item after mouse over. |
onItemSelected | Broadcast when the item moved to the center (i.e. move to center mean selected). |
Code Example :
//Define Event Listener Object
var menuListener = new Object();
//Event for item clicked
menuListener.onItemPress= function(eventObj) {
trace(eventObj.selectedItem.id);//Ouput the id of the item
trace(eventObj.selectedItem.url);//Ouput the url of the item url array
trace(eventObj.selectedItem.target);//Ouput the target of the item target array
} //Event for roll over an item
menuListener .onItemRollOver = function(eventObj) {
trace(eventObj.selectedItem.id);//Ouput the id of the item }
//Event for roll out an item
menuListener.onItemRollOut = function(eventObj) {
trace(eventObj.selectedItem.id);//Ouput the id of the item
}
//Event when item selected (i.e. goto center)
menuListener.onItemSelected = function(eventObj) {
trace(eventObj.selectedItem.id);//Ouput the id of the item
}
//Add Event Listener
RTMenu_mc.addEventListener("onItemPress",menuListener );
RTMenu_mc.addEventListener("onItemRollOver",menuListener );
RTMenu_mc.addEventListener("onItemRollOut",menuListener );
RTMenu_mc.addEventListener("onItemSelected",menuListener );
Property | Type | Description | Default Value | Possible Value |
---|---|---|---|---|
autoStart | Boolean | The parameter determine if you want the menu to autostart. | true | true/false |
blurEffect | Boolean | The parameter determine where the blur effect active or not. This effect is only supported in Flash Player version 8+. | true | true/false |
enableGetUrl | Boolean | Enable/disable getURL action of the items . | false | true/false |
enableItemEvent | Boolean | Enable/disable events of the items . | true | true/false |
enableMouseScroll | Boolean | Enable/disable mouse scrolling. | true | true/false |
globalScale | Number | Specfiy the scale of the item appear in the menu relative to it's orginal size. | 1 | Number > 1 |
fcLink | String | Instance name of other component which supported fcLINK. (needed to set in component inspector) | Any instance name, _root.abc_mc or _parent.xyz_mc | |
instanceNameArray | Array | A array define the identifier name array of the symbols which use for create the menu. | [] | Any string |
itemLinkArray | Array | A array define the url link for each item in the menu. If you don't want the menu item appeared as a link or you want to define your action in your item, leave this array blank. | [] | Any valid URL, product.html or other vaild url |
itemLinkTargetArray | Array | A array define the url link traget for each item in the menu. If you don't want the menu item appeared as a link or you want to define your action in your item, leave this array blank. | [] | _blank, _self, _parent, or other name |
menuAlignment | String | Determine the alighment of the menu item. The item can be align for top, middle or bottom. | middle | top / middle / bottom |
menuOrientation | String | Determine the orientation of the rotation menu. The menu can be in horizontal or vertical. | horizontal | horizontal / vertical |
mirrorEffect | Boolean | The parameter determine where the mirror effect active or not. This effect is only supported in Flash Player version 8+. | true | true/false |
perspectiveScaling | Boolean | The parameter determine where the perpective scaling effect active or not. | true | true/false |
perspectiveTransform | Boolean | The parameter determine where the perpective transform effect active or not. | true | true/false |
rotationDirection | String | The parameter determine where the behaviour of the menu to the mouse gesture. | Opposite Mouse | Opposite Mouse / Follow Mouse |
rotationSpeed | Number | The parameter determine where the perpective transform effect active or not. This parameter accepts values from 1 to 100. | 50 | 1 - 150 |
rotationSpeedLimit | Number | The parameter determine the speed limit of the rotation. The speed is measured in angle rotated per frame. | 10 | 1 - 360 |
enabled | Boolean | Determines whether the component is enabled or not. | true | true |
visible | Boolean | Determines the visibility of the component. | true | true |
| ||||||||||||||||||||||||||||||||||||||||
|