diff --git a/src/NavigationMenu.xml b/src/NavigationMenu.xml index cd960f1..1eef3d7 100644 --- a/src/NavigationMenu.xml +++ b/src/NavigationMenu.xml @@ -15,20 +15,19 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - + 20 20 Home + 0 + index.xml - + 130 20 - About Me - - - 240 - 20 - Testing Item + Technologies + 0 + page2.xml diff --git a/src/as/global/Broadcaster.as b/src/as/global/Broadcaster.as new file mode 100644 index 0000000..27512e3 --- /dev/null +++ b/src/as/global/Broadcaster.as @@ -0,0 +1,119 @@ +// ***************** +// broadcaster class +// ***************** +class as.global.Broadcaster +{ + private var changed_flag:Boolean; // state that if the value is changed + private var observers_array:Array; // an array of all the observers + + private var broadcaster_type:Number; // the type of broadcaster + + // *********** + // constructor + // *********** + public function Broadcaster (t:Number) + { + changed_flag = false; + observers_array = new Array (); + broadcaster_type = t; + } + + // ************ + // add observer + // ************ + public function add_observer (o:as.global.Observer):Boolean + { + // preventing null observer + if (o == null) + { + return false; + } + + // preventing already registered observer + for (var i in observers_array) + { + if (observers_array [i] == o) + { + return false; + } + } + + // putting observer into the array + observers_array.push (o); + return true; + } + + // *************** + // remove observer + // *************** + public function remove_observer (o:as.global.Observer):Boolean + { + for (var i in observers_array) + { + if (observers_array [i] == o) + { + observers_array.splice (i, 1); + return true; + } + } + + return false; + } + + // ********* + // broadcast + // ********* + public function broadcast (o:Object):Void + { + // if nothing... make it null + if (o == undefined) + { + o = null; + } + + // if not changed, skip it + if (!changed_flag) + { + return; + } + + // invoke the changer + for (var i in observers_array) + { + switch (broadcaster_type) + { + case 1: + { + // edit mode broadcaster + observers_array [i].broadcaster_event (o); + break; + } + case 2: + { + // exporter broadcaster + observers_array [i].export_xml (); + break; + } + } + } + + // flag down + changed_flag = false; + } + + // *************** + // clear observers + // *************** + public function clear_observers ():Void + { + observers_array = new Array (); + } + + // **************** + // set changed flag + // **************** + public function set_changed_flag ():Void + { + changed_flag = true; + } +} \ No newline at end of file diff --git a/src/as/global/EditPanelMC.as b/src/as/global/EditPanelMC.as new file mode 100644 index 0000000..7a9e221 --- /dev/null +++ b/src/as/global/EditPanelMC.as @@ -0,0 +1,102 @@ +// ***************** +// EditPanelMC class +// ***************** +class as.global.EditPanelMC extends MovieClip +{ + // private variables + private var mc_ref:MovieClip; // interface for the edit panel mc + private var target_ref:MovieClip; // reference to the controlling mc + + private var interval_id:Number; // temp store for interval id + + // *********** + // constructor + // *********** + public function EditPanelMC () + { + mc_ref = this; + + setup_move_button (); + } + + // ************** + // set target ref + // ************** + public function set_target_ref (m:MovieClip):Void + { + target_ref = m; + } + + // ************ + // set position + // ************ + public function set_position (x:Number, y:Number):Void + { + var temp_obj:Object; + var temp_width:Number; + var temp_height:Number; + + temp_obj = _root.sys_func.get_movie_size (); + temp_width = temp_obj.width; + temp_height = temp_obj.height; + + // fix position if out bound + if (x < 0) { x = 0; } + if (y < 0) { y = 0; } + if (x + mc_ref._width > temp_width) { x = temp_width - mc_ref._width; } + if (y + mc_ref._height > temp_height) { y = temp_height - mc_ref._height; } + + x = x + 5; + y = y - 5; + + mc_ref._x = x; + mc_ref._y = y; + + // show the edit panel + mc_ref._visible = true; + mc_ref.enabled = false; + } + + // ********** + // throw away + // ********** + public function throw_away ():Void + { + mc_ref._x = 0; + mc_ref._y = -100; + + mc_ref._visible = false; + mc_ref.enabled = false; + } + + // ***************** + // setup move button + // ***************** + public function setup_move_button ():Void + { + mc_ref.move_button ["class_ref"] = mc_ref; + + // onpress override + mc_ref.move_button.onPress = function () + { + this.class_ref.target_ref.startDrag (); + + this.class_ref.interval_id = setInterval (this.class_ref.target_ref, "pull_edit_panel", 75); + } + + // onrelease override + mc_ref.move_button.onRelease = function () + { + this.class_ref.stopDrag (); + this.class_ref.target_ref.stopDrag (); + + clearInterval (this.class_ref.interval_id); + } + + // onreleaseoutside override + mc_ref.move_button.onReleaseOutside = function () + { + this.onRelease (); + } + } +} \ No newline at end of file diff --git a/src/as/global/MCFilters.as b/src/as/global/MCFilters.as new file mode 100644 index 0000000..adc733c --- /dev/null +++ b/src/as/global/MCFilters.as @@ -0,0 +1,38 @@ +// *************** +// MCFilters Class +// *************** +class as.global.MCFilters extends MovieClip +{ + // *********** + // constructor + // *********** + public function MCFilters () + { + // actually nothing is necessary for MCFilters + } + + // ********************* + // set brightness filter + // ********************* + public function set_brightness_filter (m:MovieClip):Void + { + var matrix_array:Array; + var matrix_filter:flash.filters.ColorMatrixFilter; + + matrix_array = [1, 0, 0, 0, 100, + 0, 1, 0, 0, 100, + 0, 0, 1, 0, 100, + 0, 0, 0, 1, 0]; + + matrix_filter = new flash.filters.ColorMatrixFilter (matrix_array); + m.filters = [matrix_filter]; + } + + // ************* + // remove filter + // ************* + public function remove_filter (m:MovieClip):Void + { + m.filters = null; + } +} \ No newline at end of file diff --git a/src/as/global/Observer.as b/src/as/global/Observer.as new file mode 100644 index 0000000..de96fce --- /dev/null +++ b/src/as/global/Observer.as @@ -0,0 +1,8 @@ +// ****************** +// Observer interface +// ****************** +interface as.global.Observer +{ + // change mode function + public function broadcaster_event (o:Object):Void; +} \ No newline at end of file diff --git a/src/as/global/StatusMessageMC.as b/src/as/global/StatusMessageMC.as index 8c6c582..44e7c0f 100644 --- a/src/as/global/StatusMessageMC.as +++ b/src/as/global/StatusMessageMC.as @@ -1,4 +1,6 @@ -// StatusMessageMC class +// ********************* +// StatusMessageMC class +// ********************* class as.global.StatusMessageMC extends MovieClip { // MC variables @@ -64,6 +66,12 @@ class as.global.StatusMessageMC extends MovieClip { clearInterval (temp_interval); } + + // hide the mini mc text when transparent reach a certain amount + if (mc_ref._alpha < 40 && n < 0) + { + mc_ref.mini_mc.content_field._visible = false; + } } // ************* @@ -77,6 +85,7 @@ class as.global.StatusMessageMC extends MovieClip mc_ref.mini_mc.onRollOver = function () { this.class_ref._alpha = 100; + this.class_ref.mini_mc.content_field._visible = true; clearInterval (this.class_ref.temp_interval); } @@ -126,6 +135,7 @@ class as.global.StatusMessageMC extends MovieClip { // make the mc appear first mc_ref._alpha = 100; + mc_ref.mini_mc.content_field._visible = true; clearInterval (temp_interval); temp_interval = setInterval (this, "set_transparent", 5000); diff --git a/src/as/global/SystemFunction.as b/src/as/global/SystemFunction.as index 40f7e9c..036c41a 100644 --- a/src/as/global/SystemFunction.as +++ b/src/as/global/SystemFunction.as @@ -1,12 +1,32 @@ // SystemFunction class class as.global.SystemFunction { + // private variables + var edit_mode:Boolean; + // *********** // constructor // *********** public function SystemFunction () { // actually nothing is necessary for system function + edit_mode = false; + } + + // ************* + // get edit mode + // ************* + public function get_edit_mode ():Boolean + { + return edit_mode; + } + + // ************* + // set edit mode + // ************* + public function set_edit_mode (b:Boolean):Void + { + edit_mode = b; } // **************** @@ -34,4 +54,39 @@ class as.global.SystemFunction return (temp_string); } + + // ************ + // popup window + // ************ + public function build_popup (w:Number, h:Number, n:String, u:String, t:Number):Void + { + var temp_properties:String; + + if (t == 0) + { + temp_properties = "toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=yes, width=" + w + ", height=" + h; + } + else + { + temp_properties = "toolbar=yes, location=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes, width=" + w + ", height=" + h; + } + + var temp_script:String; + temp_script = "javascript:popup ('" + u + "','" + n + "','" + temp_properties + "')"; + getURL (temp_script); + } + + // ************** + // get movie size + // ************** + public function get_movie_size ():Object + { + var temp_obj:Object; + + temp_obj = new Object (); + temp_obj ["width"] = 800; + temp_obj ["height"] = 600; + + return temp_obj; + } } diff --git a/src/as/navigation_menu/NavigationItemMC.as b/src/as/navigation_menu/NavigationItemMC.as index d773cd1..4ad5850 100644 --- a/src/as/navigation_menu/NavigationItemMC.as +++ b/src/as/navigation_menu/NavigationItemMC.as @@ -1,125 +1,237 @@ -// NavigationItemMC class +// ********************** +// NavigationItemMC class +// ********************** class as.navigation_menu.NavigationItemMC extends MovieClip { // MC variables // Dynamic Text Field content_field // private variables - private var text_format:TextFormat; // text format of the text content + private var link_url:String; // url of the link content + private var link_type:Number; // internal link or external private var mc_ref:MovieClip; // interface for the navigation item mc - private var menu_ref:MovieClip; // reference back to the navigation menu - private var page_ref:MovieClip; // reference back to the page content mc - private var global_flag:Boolean; // state that this item is using global style or not + private var style_global:Boolean; // state that if this item is using global style + private var format_global:Boolean; // state that if this item is using global textformat + private var file_name:String; // for tracer + private var edit_mode:Boolean; // edit mode flag + + // *********** // constructor + // *********** public function NavigationItemMC () { mc_ref = this; - text_format = new TextFormat (); - } - - // onpress override - public function onPress () - { - // react only in edit mode - if (_root.config ["edit_mode"]) - { - this.startDrag (); - } + + file_name = "(NavigationItemMC.as)"; + + edit_mode = false; } + // ****************** // onrelease override + // ****************** public function onRelease () { - // react as drag in edit mode - if (_root.config ["edit_mode"]) - { - this.stopDrag (); - } - // otherwise work as simple button - else + // work as simple button in non edit mode + if (edit_mode == false) { - // somthing + mc_ref.gotoAndStop ("normal"); + + switch (link_type) + { + case 0: + { + // loading internal content + _root.page_mc.load_root_xml (link_url); + break; + } + case 1: + { + // loading external content + _root.sys_func.build_popup (800, 600, "", link_url, 1); + break; + } + } } } + // ************************* // onreleaseoutside override + // ************************* public function onReleaseOutside () { - onRollOut (); + // work as simple button in non edit mode + if (edit_mode = false) + { + mc_ref.gotoAndStop ("normal"); + } } + // ******************* // onrollover override + // ******************* public function onRollOver () { - // react only in non editing mode - if (!_root.config ["edit_mode"]) + // react normally in action mode + if (edit_mode == false) { mc_ref.gotoAndStop ("over"); - _root.status_mc.add_message ("Navigation Item", "tooltip"); + + var temp_string:String; + + temp_string = mc_ref.content_field.text + " - " + link_url; + _root.status_mc.add_message (temp_string , "tooltip"); + } + // react as movable in edit mode + else + { + _root.mc_filters.set_brightness_filter (mc_ref); + + pull_edit_panel (); } } + // ****************** // onrollout override + // ****************** public function onRollOut () { - // react only in non editing mode - if (!_root.config ["edit_mode"]) + // react normally in action mode + if (edit_mode == false) { mc_ref.gotoAndStop ("normal"); } + // react as movable in edit mode + else + { + _root.mc_filters.remove_filter (mc_ref); + } } - - // content_field setter and getter - public function set_content_field (s:String):Void { mc_ref.content_field.text = s; } - public function get_content_field ():String { return mc_ref.content_field.text; } - - // text_format setter and getter - public function set_text_format (a:Array, f:TextFormat):Void + + // *************** + // pull edit panel + // *************** + public function pull_edit_panel ():Void { - if (a) + var temp_x:Number; + var temp_y:Number; + + temp_x = mc_ref._parent._x + mc_ref._x; + temp_y = mc_ref._parent._y + mc_ref._y + mc_ref._height; + + _root.edit_panel_mc.set_target_ref (mc_ref); + _root.edit_panel_mc.set_position (temp_x, temp_y); + } + + // ***************** + // broadcaster event + // ***************** + public function broadcaster_event (o:Object):Void + { + edit_mode = new Boolean (o); + } + + // *************** + // data_xml setter + // *************** + public function set_data_xml (x:XMLNode, t:TextFormat):Void + { + for (var i in x.childNodes) { - for (var i in a) + var temp_node:XMLNode; + var temp_name:String; + var temp_value:String; + + temp_node = x.childNodes [i]; + temp_name = temp_node.nodeName; + + // since text_format will have further nodes + if (temp_name != "text_format") { - var temp_position = a [i].indexOf ("|"); - var temp_property = a [i].substr (0, temp_position); - var temp_value = a [i].substr (temp_position + 1); - text_format [temp_property] = temp_value; + temp_value = temp_node.firstChild.nodeValue; + } + + switch (temp_name) + { + // x position of the navigation item respect to the menu + case "x": + { + mc_ref._x = parseInt (temp_value); + break; + } + // y position of the navigation item respect to the menu + case "y": + { + mc_ref._y = parseInt (temp_value); + break; + } + // text content of the navigation item + case "text": + { + mc_ref.content_field.text = temp_value; + break; + } + // text format of the navigation item + case "text_format": + { + var temp_format:TextFormat; + temp_format = new TextFormat (); + + for (var j in x.childNodes) + { + temp_format [x.childNodes [j].nodeName] = x.childNodes [j].nodeValue; + } + + mc_ref.content_field.setTextFormat (temp_format); + break; + } + // link type of the navigation item + case "type": + { + link_type = parseInt (temp_value); + break; + } + // link url of the navigation item + case "url": + { + link_url = temp_value; + break; + } + // exception + default: + { + _root.status_mc.add_message (file_name + " node skipped with node name '" + temp_name + "'", "critical"); + } } } - else if (f) + + // style of the navigation item + if (x.attributes ["style"] != "global") { - text_format = f; + style_global = false; } else { - trace ("NavigationItemMC.as -> set_text_format fail."); + style_global = true; } - mc_ref.content_field.setTextFormat (text_format); - } - - public function copy_text_format (f:TextFormat):Void - { - text_format = f; - mc_ref.content_field.setTextFormat (text_format); - } - - public function get_text_format ():Array - { - var temp_array = new Array (); - - for (var i in text_format) + // textformat of the navigation item + if (x.attributes ["textformat"] != "global") { - temp_array.push (i + "|" + text_format [i]); + format_global = false; + } + else + { + format_global = true; } - - trace (temp_array); - return temp_array; } + // ********** + // export xml + // ********** public function export_xml ():XMLNode { var out_xml:XML; @@ -152,16 +264,18 @@ class as.navigation_menu.NavigationItemMC extends MovieClip root_node.appendChild (temp_node); // overriding styles, if any - if (global_flag) + if (!style_global) { //TODO if doing override style, then many things have to be added here } + // overriding textformats, if any + if (!format_global) + { + //TODO if doing override textformat, then many things have to be added here + } + // export the xml node to whatever place need this return (root_node); } - - // global_flag setter and getter - public function set_global_flag (b:Boolean):Void { global_flag = b; } - public function get_global_flag ():Boolean { return global_flag; } } diff --git a/src/as/navigation_menu/NavigationMenuMC.as b/src/as/navigation_menu/NavigationMenuMC.as index 157bc83..df497a4 100644 --- a/src/as/navigation_menu/NavigationMenuMC.as +++ b/src/as/navigation_menu/NavigationMenuMC.as @@ -3,6 +3,9 @@ // ********************** class as.navigation_menu.NavigationMenuMC extends MovieClip { + // MC variables + // MovieClip edit_mode_bg + // private variables private var data_xml:XMLNode; // xml data private var config_xml:XMLNode; // xml config @@ -10,14 +13,14 @@ class as.navigation_menu.NavigationMenuMC extends MovieClip private var text_format:TextFormat; // text format of the menu items private var menu_style:Object; // menu style's linkage name - private var item_num:Number; // number of menu items private var item_mc_array:Array; // array storing all the menu items private var mc_ref:MovieClip; // reference back to the navigation menu mc - private var page_ref:MovieClip; // reference back to the page content mc private var file_name:String; // for tracer - private var export_flag:Boolean; // state that this mc have to be exported + private var loaded_file:String; // loaded file name + + private var edit_mode:Boolean; // edit mode flag // *********** // constructor @@ -31,53 +34,101 @@ class as.navigation_menu.NavigationMenuMC extends MovieClip item_mc_array = new Array (); file_name = "(NavigationMenuMC.as)"; - export_flag = true; + + edit_mode = false; + + setup_edit_mode_bg (); + } + + // ****************** + // setup edit mode bg + // ****************** + public function setup_edit_mode_bg () + { + // hide the edit mode bg tag + mc_ref.edit_mode_bg_tag._visible = false; + + mc_ref.edit_mode_bg ["class_ref"] = mc_ref; + + // onrollover override + mc_ref.edit_mode_bg.onRollOver = function () + { + // react only in edit mode + if (this.class_ref.edit_mode == true) + { + _root.mc_filters.set_brightness_filter (this.class_ref); + + this.class_ref.pull_edit_panel (); + } + } + + // onrollout override + mc_ref.edit_mode_bg.onRollOut = function () + { + // react only in edit mode + if (this.class_ref.edit_mode == true) + { + _root.mc_filters.remove_filter (this.class_ref); + } + } + } + + // ************* + // load root_xml + // ************* + public function load_root_xml (s:String):Void + { + loaded_file = s; // xml data loading - var temp_xml:XML = new XML (); - temp_xml ["class_ref"] = this; - temp_xml.ignoreWhite = true; - temp_xml.load ("NavigationMenu.xml"); - // temp_xml.load ("NavigationMenu.xml?break_cache=" + new Date ().getTime ()); + var root_xml:XML = new XML (); + root_xml ["class_ref"] = this; + root_xml.ignoreWhite = true; + root_xml ["break_cache"] = new Date ().getTime (); + root_xml.sendAndLoad (s, root_xml, "POST"); - temp_xml.onLoad = function (b:Boolean) + root_xml.onLoad = function (b:Boolean) { // when xml loading is success if (b) { - var temp_node:XMLNode; - var temp_length:Number; - - temp_length = temp_xml.firstChild.childNodes.length; + var temp_config:XMLNode; + var temp_data:XMLNode; // try to find out the config node and data node - for (var i = 0; i < temp_length; i++) + for (var i in root_xml.firstChild.childNodes) { - temp_node = temp_xml.firstChild.childNodes [i]; - switch (temp_node.nodeName) + var temp_node:XMLNode; + var temp_name:String; + + temp_node = root_xml.firstChild.childNodes [i]; + temp_name = temp_node.nodeName; + + switch (temp_name) { // config node case "config": { - // because within onLoad is outside class scope, so need a pointer point back - this.class_ref.set_config_xml (temp_node); + temp_config = temp_node; break; } // data node case "data": { - // because within onLoad is outside class scope, so need a pointer point back - this.class_ref.set_data_xml (temp_node); + temp_data = temp_node; break; } // exception default: { - _root.status_mc.add_message (this.class_ref.file_name + " node skipped with node name '" + temp_node.nodeName + "'", "critical"); + _root.status_mc.add_message (this.class_ref.file_name + " node skipped with node name '" + temp_name + "'", "critical"); } } } + + this.class_ref.set_config_xml (temp_config); + this.class_ref.set_data_xml (temp_data); } else { @@ -86,43 +137,45 @@ class as.navigation_menu.NavigationMenuMC extends MovieClip } } - // ****************** - // config_xml parsing - // ****************** - public function parse_config_xml ():Void + // ***************** + // config_xml setter + // ***************** + public function set_config_xml (x:XMLNode):Void { - var temp_node:XMLNode; - var temp_length:Number; - temp_length = config_xml.childNodes.length; - // try to parse the config node - for (var i = 0; i < temp_length; i++) + for (var i in x.childNodes) { - temp_node = config_xml.childNodes [i]; + var temp_node:XMLNode; + var temp_name:String; + var temp_value:String; + + temp_node = x.childNodes [i]; + temp_name = temp_node.nodeName; - switch (temp_node.nodeName) + if (temp_name != "menu_style" || temp_name != "text_format") + { + temp_value = temp_node.firstChild.nodeValue; + } + + switch (temp_name) { // x position of the navigation menu case "x": { - mc_ref._x = parseInt (temp_node.firstChild.nodeValue); + mc_ref._x = parseInt (temp_value); break; } // y position of the navigation menu case "y": { - mc_ref._y = parseInt (temp_node.firstChild.nodeValue); + mc_ref._y = parseInt (temp_value); break; } // global menu style case "menu_style": { - var temp_length_2:Number; - - temp_length_2 = temp_node.childNodes.length; - // since menu style still have many nodes, so need to iterate again - for (var j = 0; j < temp_length_2; j++) + for (var j in temp_node.childNodes) { menu_style [temp_node.childNodes [j].nodeName] = temp_node.childNodes [j].firstChild.nodeValue; } @@ -131,12 +184,8 @@ class as.navigation_menu.NavigationMenuMC extends MovieClip // global text format case "text_format": { - var temp_length_2:Number; - - temp_length_2 = temp_node.childNodes.length; - // since text format still have many nodes, so need to iterate again - for (var j = 0; j < temp_length_2; j++) + for (var j in temp_node.childNodes) { text_format [temp_node.childNodes [j].nodeName] = temp_node.childNodes [j].firstChild.nodeValue; } @@ -144,130 +193,89 @@ class as.navigation_menu.NavigationMenuMC extends MovieClip } default: { - _root.status_mc.add_message (file_name + " node skipped with node name '" + temp_node.nodeName + "'", "critical"); + _root.status_mc.add_message (file_name + " node skipped with node name '" + temp_name + "'", "critical"); } } } } - // **************** - // data_xml parsing - // **************** - public function parse_data_xml ():Void + // *************** + // data_xml setter + // *************** + public function set_data_xml (x:XMLNode):Void { - if (config_xml) + for (var i in x.childNodes) { var temp_node:XMLNode; - var temp_length:Number; - - var temp_x:Number; - var temp_y:Number; - var temp_text:String; - - var temp_style:Object; // in case the navigation item mc want to override the global - var temp_format:TextFormat; // same reason as above + var temp_name:String; - item_num = data_xml.childNodes.length; + temp_node = x.childNodes [i]; + temp_name = temp_node.nodeName; - // try to find out the navigation item mc nodes - for (var i = 0; i < item_num; i++) + if (temp_name == "NavigationItemMC") { - temp_node = data_xml.childNodes [i]; - - if (temp_node.nodeName == "NavigationItemMC") + if (temp_node.attributes ["style"] != "global") { - - temp_length = temp_node.childNodes.length; - - // getting the contents of the navigation item mc to temp variables first before building mc - for (var j = 0; j < temp_length; j++) - { - // initialize variables - temp_style = new Object (); - temp_format = new TextFormat (); - - switch (temp_node.childNodes [j].nodeName) - { - // x position of the navigation item respect to the menu - case "x": - { - temp_x = parseInt (temp_node.childNodes [j].firstChild.nodeValue); - break; - } - // y position of the navigation item respect to the menu - case "y": - { - temp_y = parseInt (temp_node.childNodes [j].firstChild.nodeValue); - break; - } - // text content of the navigation item - case "text": - { - temp_text = temp_node.childNodes [j].firstChild.nodeValue; - break; - } - // overriding global menu style - case "menu_style": - { - //TODO hardcode now, to be completed - temp_style ["name"] = "something else"; - break; - } - // overriding global text format - case "text_format": - { - //TODO hardcode now, to be completed - temp_format ["font"] = "something else"; - break; - } - // exception - default: - { - _root.status_mc.add_message (file_name + " node skipped with node name '" + temp_node.nodeName + "'", "critical"); - } - } - } - - // building mc - if (temp_style ["name"]) - { - // have overriding style - item_mc_array [i] = mc_ref.attachMovie (temp_style ["name"], "menu_item_" + i, mc_ref.getNextHighestDepth ()); - } - else - { - // use global style - item_mc_array [i] = mc_ref.attachMovie (menu_style ["name"], "menu_item_" + i, mc_ref.getNextHighestDepth ()); - } - - // applying text format - if (temp_format ["font"] != null) - { - // have overriding style - item_mc_array [i].set_global_flag (false); - item_mc_array [i].set_text_format (null, temp_format); - } - else - { - // use global style - item_mc_array [i].set_global_flag (true); - item_mc_array [i].set_text_format (null, text_format); - } - - // applying other properties - item_mc_array [i]._x = temp_x; - item_mc_array [i]._y = temp_y; - item_mc_array [i].set_content_field (temp_text); + item_mc_array [i] = mc_ref.attachMovie (temp_node.attributes ["style"], "menu_item_" + i, mc_ref.getNextHighestDepth ()); } else { - _root.status_mc.add_message (file_name + " node skipped with node name '" + temp_node.nodeName + "'", "critical"); + item_mc_array [i] = mc_ref.attachMovie (menu_style ["name"], "menu_item_" + i, mc_ref.getNextHighestDepth ()); } + + item_mc_array [i].set_data_xml (temp_node, text_format); + } + else + { + _root.status_mc.add_message (file_name + " node skipped with node name '" + temp_node.nodeName + "'", "critical"); } } + } + + // *************** + // pull edit panel + // *************** + public function pull_edit_panel ():Void + { + var temp_x:Number; + var temp_y:Number; + + temp_x = mc_ref._x; + temp_y = mc_ref._y + mc_ref._height; + + _root.edit_panel_mc.set_target_ref (mc_ref); + _root.edit_panel_mc.set_position (temp_x, temp_y); + } + + // *********** + // change mode + // *********** + public function broadcaster_event (o:Object):Void + { + // change mode flag + edit_mode = new Boolean (o); + + // show / remove the edit mode bg + if (edit_mode == true) + { + var temp_xml:XML; + temp_xml = new XML ("003005002|0x666666|1000xFFFFFF10"); + + mc_ref.edit_mode_bg.set_data_xml (temp_xml.firstChild); + mc_ref.edit_mode_bg.draw_it (); + + mc_ref.edit_mode_bg_tag._visible = true; + } else { - _root.status_mc.add_message (file_name + " config_xml not built before parsing data_xml.", "critical"); + mc_ref.edit_mode_bg.clear (); + + mc_ref.edit_mode_bg_tag._visible = false; + } + + for (var i in item_mc_array) + { + item_mc_array [i].broadcaster_event (o); } } @@ -367,26 +375,6 @@ class as.navigation_menu.NavigationMenuMC extends MovieClip out_string = out_string + out_xml.toString (); out_xml = new XML (out_string); out_xml.contentType = "text/xml"; - out_xml.sendAndLoad ("update_xml.php?target_object=navigation_menu", return_xml); - } - - // **************************** - // config_xml setter and getter - // **************************** - public function set_config_xml (x:XMLNode):Void - { - config_xml = x; - parse_config_xml (); - } - public function get_config_xml ():XMLNode { return config_xml; } - - // ************************** - // data_xml setter and getter - // ************************** - public function set_data_xml (x:XMLNode):Void - { - data_xml = x; - parse_data_xml (); + //out_xml.sendAndLoad ("update_xml.php?target_file=" + loaded_file, return_xml); } - public function get_data_xml ():XMLNode { return data_xml; } } diff --git a/src/as/page_content/ImageMC.as b/src/as/page_content/ImageMC.as new file mode 100644 index 0000000..cb4ba75 --- /dev/null +++ b/src/as/page_content/ImageMC.as @@ -0,0 +1,115 @@ +// ************* +// ImageMC class +// ************* +class as.page_content.ImageMC extends MovieClip +{ + // MC variables + // MovieClip clip_mc + + // private variables + private var mc_ref:MovieClip; // interface for the image mc + private var mc_loader:MovieClipLoader; // loader for the image mc + + private var mc_url:String; + + private var edit_mode:Boolean; // edit mode flag + + // constructor + public function ImageMC () + { + mc_ref = this; + mc_loader = new MovieClipLoader (); + + edit_mode = false; + } + + // *************** + // data_xml setter + // *************** + public function set_data_xml (x:XMLNode):Void + { + for (var i in x.childNodes) + { + var temp_node:XMLNode; + var temp_name:String; + var temp_value:String; + + temp_node = x.childNodes [i]; + temp_name = temp_node.nodeName; + temp_value = temp_node.firstChild.nodeValue; + + switch (temp_name) + { + // x position of the image + case "x": + { + mc_ref._x = parseInt (temp_value); + break; + } + // y position of the image + case "y": + { + mc_ref._y = parseInt (temp_value); + break; + } + // path of the image + case "url": + { + mc_url = temp_value; + break; + } + } + } + + mc_loader.loadClip (mc_url, mc_ref.clip_mc); + } + + // ******************* + // onrollover override + // ******************* + public function onRollOver () + { + // react only in edit mode + if (edit_mode == true) + { + _root.mc_filters.set_brightness_filter (mc_ref); + + pull_edit_panel (); + } + } + + // ****************** + // onrollout override + // ****************** + public function onRollOut () + { + // react only in edit mode + if (edit_mode == true) + { + _root.mc_filters.remove_filter (mc_ref); + } + } + + // *************** + // pull edit panel + // *************** + public function pull_edit_panel ():Void + { + var temp_x:Number; + var temp_y:Number; + + temp_x = mc_ref._x; + temp_y = mc_ref._y + mc_ref._height; + + _root.edit_panel_mc.set_target_ref (mc_ref); + _root.edit_panel_mc.set_position (temp_x, temp_y); + } + + // ***************** + // broadcaster event + // ***************** + public function broadcaster_event (o:Object):Void + { + edit_mode = new Boolean (o); + } +} diff --git a/src/as/page_content/LinkMC.as b/src/as/page_content/LinkMC.as new file mode 100644 index 0000000..23c146e --- /dev/null +++ b/src/as/page_content/LinkMC.as @@ -0,0 +1,191 @@ +// ************ +// LinkMC class +// ************ +class as.page_content.LinkMC extends MovieClip +{ + // private variables + private var mc_ref:MovieClip; // interface for the link mc + + private var link_type:Number; // internal link or external + private var link_url:String; // url of the link content + + private var content_mc_array:Array; // array storing all the content items + + private var file_name:String; // for tracer + + private var edit_mode:Boolean; // edit mode flag + + // *********** + // constructor + // *********** + public function LinkMC () + { + mc_ref = this; + + content_mc_array = new Array (); + + file_name = "(LinkMC.as)"; + + edit_mode = false; + } + + // *************** + // data_xml setter + // *************** + public function set_data_xml (x:XMLNode):Void + { + for (var i in x.childNodes) + { + var temp_node:XMLNode; + var temp_name:String; + var temp_value:String; + + temp_node = x.childNodes [i]; + temp_name = temp_node.nodeName; + temp_value = temp_node.firstChild.nodeValue; + + switch (temp_name) + { + // x position of the link + case "x": + { + mc_ref._x = parseInt (temp_value); + break; + } + // y position of the link + case "y": + { + mc_ref._y = parseInt (temp_value); + break; + } + // link type + case "type": + { + link_type = parseInt (temp_value); + break; + } + // link url + case "url": + { + link_url = temp_value; + break; + } + // textfield inside the link + case "TextFieldMC": + { + var temp_depth:Number; + var temp_name:String; + var lib_name:String; + + temp_depth = mc_ref.getNextHighestDepth (); + temp_name = "text_field_" + temp_depth; + lib_name = "lib_page_content_textfield"; + + content_mc_array [temp_depth] = mc_ref.attachMovie (lib_name, temp_name, temp_depth); + content_mc_array [temp_depth].set_data_xml (temp_node); + break; + } + // exception + default: + { + _root.status_mc.add_message (file_name + " node skipped with node name '" + temp_name + "'", "critical"); + break; + } + } + } + } + + // ****************** + // onrelease override + // ****************** + public function onRelease () + { + switch (link_type) + { + // internal link + case 0: + { + // loading new contents + _root.page_mc.load_root_xml (link_url); + break; + } + // external link + case 1: + { + // loading external content + _root.sys_func.build_popup (800, 600, "", link_url, 1); + break; + } + } + } + + // ******************* + // onrollover override + // ******************* + public function onRollOver () + { + // react as normal link in action mode + if (edit_mode == false) + { + var temp_string:String; + + switch (link_type) + { + case 0: + { + temp_string = "Internal link - " + link_url; + break; + } + case 1: + { + temp_string = "External link - " + link_url; + break; + } + } + + _root.status_mc.add_message (temp_string , "tooltip"); + } + // react differently in edit mode + else + { + _root.mc_filters.set_brightness_filter (mc_ref); + + pull_edit_panel (); + } + } + + // ****************** + // onrollout override + // ****************** + public function onRollOut () + { + // react only in edit mode + if (edit_mode == true) + { + _root.mc_filters.remove_filter (mc_ref); + } + } + + // *************** + // pull edit panel + // *************** + public function pull_edit_panel ():Void + { + var temp_x:Number; + var temp_y:Number; + + temp_x = mc_ref._x; + temp_y = mc_ref._y + mc_ref._height; + + _root.edit_panel_mc.set_target_ref (mc_ref); + _root.edit_panel_mc.set_position (temp_x, temp_y); + } + + // ***************** + // broadcaster event + // ***************** + public function broadcaster_event (o:Object):Void + { + edit_mode = new Boolean (o); + } +} \ No newline at end of file diff --git a/src/as/page_content/PageContentMC.as b/src/as/page_content/PageContentMC.as index 2f3c062..b301059 100644 --- a/src/as/page_content/PageContentMC.as +++ b/src/as/page_content/PageContentMC.as @@ -12,7 +12,8 @@ class as.page_content.PageContentMC extends MovieClip private var mc_ref:MovieClip; // reference back to the page content mc private var file_name:String; // for tracer - private var export_flag:Boolean; // state that this mc have to be exported + private var loaded_file:String; // loaded file name + // *********** // constructor @@ -24,7 +25,18 @@ class as.page_content.PageContentMC extends MovieClip content_mc_array = new Array (); file_name = "(PageContentMC.as)"; - export_flag = true; + } + + // ********** + // destructor + // ********** + public function destroy ():Void + { + for (var i in content_mc_array) + { + _root.mode_broadcaster.remove_observer (content_mc_array [i]); + content_mc_array [i].removeMovieClip (); + } } // ************* @@ -32,6 +44,11 @@ class as.page_content.PageContentMC extends MovieClip // ************* public function load_root_xml (s:String):Void { + loaded_file = s; + + // destroying old contents + destroy (); + // xml data loading var root_xml:XML; root_xml = new XML (); @@ -39,7 +56,6 @@ class as.page_content.PageContentMC extends MovieClip root_xml.ignoreWhite = true; root_xml ["break_cache"] = new Date ().getTime (); root_xml.sendAndLoad ("page/" + s, root_xml, "POST"); - // root_xml.load ("page/" + s + "?break_cache=" + new Date ().getTime ()); root_xml.onLoad = function (b:Boolean) { @@ -86,7 +102,7 @@ class as.page_content.PageContentMC extends MovieClip // exception default: { - _root.status_mc.add_message (file_name + " node skipped with node name '" + temp_node.nodeName + "'", "critical"); + _root.status_mc.add_message (file_name + " node skipped with node name '" + temp_name + "'", "critical"); } } } @@ -223,12 +239,39 @@ class as.page_content.PageContentMC extends MovieClip switch (temp_node.nodeName) { + // TextField case "TextFieldMC": { lib_name = "lib_page_content_textfield"; temp_name = "text_field_"; break; } + // Image + case "ImageMC": + { + lib_name = "lib_page_content_image"; + temp_name = "image_"; + break; + } + // Link + case "LinkMC": + { + lib_name = "lib_page_content_link"; + temp_name = "link_"; + break; + } + // Rectangle Shape + case "RectangleMC": + { + lib_name = "lib_shape_rectangle"; + temp_name = "rectangle_"; + break; + } + // exception + default: + { + _root.status_mc.add_message (file_name + " node skipped with node name '" + temp_node.nodeName + "'", "critical"); + } } var temp_id:Number; @@ -236,6 +279,8 @@ class as.page_content.PageContentMC extends MovieClip content_mc_array [temp_id] = mc_ref.attachMovie (lib_name, temp_name + temp_id, temp_id); content_mc_array [temp_id].set_data_xml (temp_node); + + _root.mode_broadcaster.add_observer (content_mc_array [temp_id]); } } @@ -244,8 +289,7 @@ class as.page_content.PageContentMC extends MovieClip // ********** public function export_xml ():Void { - /* - _root.status_mc.add_message ("Exporting navigation menu...", "normal"); + _root.status_mc.add_message ("Exporting page content...", "normal"); var out_xml:XML; var out_string:String; @@ -264,7 +308,7 @@ class as.page_content.PageContentMC extends MovieClip out_xml = new XML (); // building root node - root_node = out_xml.createElement ("NavigationMenu"); + root_node = out_xml.createElement ("PageContent"); root_node.attributes ["xmlns"] = "http://www.w3schools.com"; root_node.attributes ["xmlns:xsi"] ="http://www.w3.org/2001/XMLSchema-instance"; out_xml.appendChild (root_node); @@ -272,41 +316,51 @@ class as.page_content.PageContentMC extends MovieClip // building config node config_node = out_xml.createElement ("config"); - // x of navigation menu + // x of page content temp_node = out_xml.createElement ("x"); temp_node_2 = out_xml.createTextNode (mc_ref._x.toString ()); temp_node.appendChild (temp_node_2); config_node.appendChild (temp_node); - // y of navigation menu + // y of page content temp_node = out_xml.createElement ("y"); temp_node_2 = out_xml.createTextNode (mc_ref._y.toString ()); temp_node.appendChild (temp_node_2); config_node.appendChild (temp_node); - // menu style of navigation menu - temp_node = out_xml.createElement ("menu_style"); - for (var i in menu_style) - { - temp_node_2 = out_xml.createElement (i); - temp_node_3 = out_xml.createTextNode (menu_style [i]); - temp_node_2.appendChild (temp_node_3); - temp_node.appendChild (temp_node_2); - } + // bg color of page content + temp_node = out_xml.createElement ("bg_color"); + + var temp_color:Color; + temp_color = new Color (mc_ref.bg_color); + + temp_node_2 = out_xml.createTextNode ("0x" + temp_color.getRGB ().toString (16)); + temp_node.appendChild (temp_node_2); config_node.appendChild (temp_node); - // text format of navigation menu - temp_node = out_xml.createElement ("text_format"); - for (var i in text_format) - { - if (text_format [i] != null && i.indexOf ("getTextExtent") == -1) - { - temp_node_2 = out_xml.createElement (i); - temp_node_3 = out_xml.createTextNode (text_format [i]); - temp_node_2.appendChild (temp_node_3); - temp_node.appendChild (temp_node_2); - } - } + // bg image of navigation menu + temp_node = out_xml.createElement ("bg_image"); + + temp_node_2 = out_xml.createElement ("x"); + temp_node_3 = out_xml.createTextNode (mc_ref.bg_image._x); + temp_node_2.appendChild (temp_node_3); + temp_node.appendChild (temp_node_2); + + temp_node_2 = out_xml.createElement ("y"); + temp_node_3 = out_xml.createTextNode (mc_ref.bg_image._y); + temp_node_2.appendChild (temp_node_3); + temp_node.appendChild (temp_node_2); + + temp_node_2 = out_xml.createElement ("url"); + temp_node_3 = out_xml.createTextNode (mc_ref.bg_image._url); + temp_node_2.appendChild (temp_node_3); + temp_node.appendChild (temp_node_2); + + temp_node_2 = out_xml.createElement ("alpha"); + temp_node_3 = out_xml.createTextNode (mc_ref.bg_image._alpha); + temp_node_2.appendChild (temp_node_3); + temp_node.appendChild (temp_node_2); + config_node.appendChild (temp_node); root_node.appendChild (config_node); @@ -315,9 +369,9 @@ class as.page_content.PageContentMC extends MovieClip data_node = out_xml.createElement ("data"); // calling each navigation item instance to return their xml - for (var i in item_mc_array) + for (var i in content_mc_array) { - temp_node = item_mc_array [i].export_xml (); + temp_node = content_mc_array [i].export_xml (); data_node.appendChild (temp_node); } @@ -336,7 +390,7 @@ class as.page_content.PageContentMC extends MovieClip out_string = out_string + out_xml.toString (); out_xml = new XML (out_string); out_xml.contentType = "text/xml"; - out_xml.sendAndLoad ("update_xml.php?target_object=navigation_menu", return_xml); - */ + trace (out_xml); + // out_xml.sendAndLoad ("update_xml.php?target_file=" + loaded_file, return_xml); } } diff --git a/src/as/page_content/TextFieldMC.as b/src/as/page_content/TextFieldMC.as index dcac37f..7deb48e 100644 --- a/src/as/page_content/TextFieldMC.as +++ b/src/as/page_content/TextFieldMC.as @@ -7,15 +7,90 @@ class as.page_content.TextFieldMC extends MovieClip // Dynamic Text Field content_field // private variables - private var mc_ref:MovieClip; // interface for the navigation item mc + private var mc_ref:MovieClip; // interface for the textfield mc + private var edit_mode:Boolean; // edit mode flag + + // *********** // constructor + // *********** public function TextFieldMC () { mc_ref = this; mc_ref.content_field.html = true; mc_ref.content_field.multiline = true; mc_ref.content_field.wordWrap = true; + + edit_mode = false; + } + + // ******************* + // onrollover override + // ******************* + // because rollover will damage textfield anchor tag so need to hide out the event first + public function onRollOver_event () + { + // react only in edit mode + if (edit_mode == true) + { + _root.mc_filters.set_brightness_filter (mc_ref); + + pull_edit_panel (); + } + } + + // ****************** + // onrollout override + // ****************** + // because rollout will damage textfield anchor tag so need to hide out the event first + public function onRollOut_event () + { + // react only in edit mode + if (edit_mode == true) + { + _root.mc_filters.remove_filter (mc_ref); + } + } + + // *************** + // pull edit panel + // *************** + public function pull_edit_panel ():Void + { + var temp_x:Number; + var temp_y:Number; + + temp_x = mc_ref._x; + temp_y = mc_ref._y + mc_ref._height; + + _root.edit_panel_mc.set_target_ref (mc_ref); + _root.edit_panel_mc.set_position (temp_x, temp_y); + } + + // ***************** + // broadcaster event + // ***************** + public function broadcaster_event (o:Object):Void + { + edit_mode = new Boolean (o); + + if (edit_mode == true) + { + mc_ref.onRollOver = function () + { + onRollOver_event (); + } + + mc_ref.onRollOut = function () + { + onRollOut_event (); + } + } + else + { + delete mc_ref.onRollOver; + delete mc_ref.onRollOut; + } } // *************** @@ -62,7 +137,10 @@ class as.page_content.TextFieldMC extends MovieClip // content of the textfield case "text": { - mc_ref.content_field.htmlText = temp_node.childNodes.toString (); + for (var j in temp_node.childNodes) + { + mc_ref.content_field.htmlText = temp_node.childNodes [j].toString () + mc_ref.content_field.htmlText; + } break; } } @@ -75,4 +153,64 @@ class as.page_content.TextFieldMC extends MovieClip mc_ref.scroll_bar.set_scroll_ref (mc_ref.content_field); } } + + // ********** + // export xml + // ********** + public function export_xml ():XMLNode + { + var out_xml:XML; + + var root_node:XMLNode; + var temp_node:XMLNode; + var temp_node_2:XMLNode; + + out_xml = new XML (); + + // building root node + root_node = out_xml.createElement ("TextFieldMC"); + + // x of textfield + temp_node = out_xml.createElement ("x"); + temp_node_2 = out_xml.createTextNode (mc_ref._x.toString ()); + temp_node.appendChild (temp_node_2); + root_node.appendChild (temp_node); + + // y of textfield + temp_node = out_xml.createElement ("y"); + temp_node_2 = out_xml.createTextNode (mc_ref._y.toString ()); + temp_node.appendChild (temp_node_2); + root_node.appendChild (temp_node); + + // width of textfield + temp_node = out_xml.createElement ("width"); + temp_node_2 = out_xml.createTextNode (mc_ref._width.toString ()); + temp_node.appendChild (temp_node_2); + root_node.appendChild (temp_node); + + // height of textfield + temp_node = out_xml.createElement ("height"); + temp_node_2 = out_xml.createTextNode (mc_ref._height.toString ()); + temp_node.appendChild (temp_node_2); + root_node.appendChild (temp_node); + + // content of textfield + var temp_xml:XML; + temp_xml = new XML ("" + mc_ref.content_field.htmlText + ""); + + temp_node = out_xml.createElement ("text"); + + var temp_length:Number; + temp_length = temp_xml.firstChild.childNodes.length; + + for (var i = 0; i < temp_length; i++) + { + temp_node_2 = temp_xml.firstChild.childNodes [i]; + temp_node.appendChild (temp_node_2); + } + root_node.appendChild (temp_node); + + // export the xml node to whatever place need this + return (root_node); + } } diff --git a/src/as/shape/RectangleMC.as b/src/as/shape/RectangleMC.as index d27a1a2..bf6387a 100644 --- a/src/as/shape/RectangleMC.as +++ b/src/as/shape/RectangleMC.as @@ -11,14 +11,22 @@ class as.shape.RectangleMC extends MovieClip private var rect_height:Number; private var rect_corner:Number; private var fill_color:Number; + + private var edit_mode:Boolean; // edit mode flag + // *********** // constructor + // *********** public function RectangleMC () { mc_ref = this; + + edit_mode = false; } + // ******* // draw_it + // ******* public function draw_it ():Void { if (fill_color != null) @@ -36,24 +44,128 @@ class as.shape.RectangleMC extends MovieClip mc_ref.endFill (); } } - - // set_dimension - public function set_dimension (w:Number, h:Number, c:Number):Void + + // *************** + // data_xml setter + // *************** + public function set_data_xml (x:XMLNode):Void { - rect_width = w; - rect_height = h; - rect_corner = c; + for (var i in x.childNodes) + { + var temp_node:XMLNode; + var temp_name:String; + var temp_value:String; + + temp_node = x.childNodes [i]; + temp_name = temp_node.nodeName; + temp_value = temp_node.firstChild.nodeValue; + + switch (temp_name) + { + // x position of the rectangle mc + case "x": + { + mc_ref._x = parseInt (temp_value); + break; + } + // y position of the rectangle mc + case "y": + { + mc_ref._y = parseInt (temp_value); + break; + } + // width of the rectangle mc + case "width": + { + rect_width = parseInt (temp_value); + break; + } + // height of the rectangle mc + case "height": + { + rect_height = parseInt (temp_value); + break; + } + // corner radius of the rectangle mc + case "corner": + { + rect_corner = parseInt (temp_value); + break; + } + // line style of the line of rectangle + case "line_style": + { + var temp_style:Array; + temp_style = new Array (); + temp_style = temp_value.split ("|"); + + mc_ref.lineStyle (parseInt (temp_style [0]), parseInt (temp_style [1]), parseInt (temp_style [2])); + break; + } + // fill color of the rectangle mc + case "fill_color": + { + fill_color = parseInt (temp_value); + break; + } + // alpha of the whole rectangle mc + case "alpha": + { + mc_ref._alpha = parseInt (temp_value); + break; + } + } + + draw_it (); + } } - - // set_line_style - public function set_line_style (t:Number, r:Number, a:Number):Void + + // ******************* + // onrollover override + // ******************* + public function onRollOver () { - mc_ref.lineStyle (t, r, a); + // react only in edit mode + if (edit_mode == true) + { + _root.mc_filters.set_brightness_filter (mc_ref); + + pull_edit_panel (); + } } - - // set_fill_color - public function set_fill_color (c:Number):Void + + // ****************** + // onrollout override + // ****************** + public function onRollOut () + { + // react only in edit mode + if (edit_mode == true) + { + _root.mc_filters.remove_filter (mc_ref); + } + } + + // *************** + // pull edit panel + // *************** + public function pull_edit_panel ():Void + { + var temp_x:Number; + var temp_y:Number; + + temp_x = mc_ref._x; + temp_y = mc_ref._y + mc_ref._height; + + _root.edit_panel_mc.set_target_ref (mc_ref); + _root.edit_panel_mc.set_position (temp_x, temp_y); + } + + // ***************** + // broadcaster event + // ***************** + public function broadcaster_event (o:Object):Void { - fill_color = c; + edit_mode = new Boolean (o); } } \ No newline at end of file diff --git a/src/img/methodology.png b/src/img/methodology.png new file mode 100644 index 0000000..01c8745 Binary files /dev/null and b/src/img/methodology.png differ diff --git a/src/page/index.xml b/src/page/index.xml index a018cd4..42efdf8 100644 --- a/src/page/index.xml +++ b/src/page/index.xml @@ -19,29 +19,159 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 50 100 200 - 100 + 20

WELCOME TO FLABER

50 120 - 200 + 375 100 -

FLABER (FLAsh web BuildER) - As it's name, it is a pure Flash-based application which allows any people making their web pages in Flash format.

+ + +

+ FLABER (FLAsh web BuildER) - As it's name, it is a pure Flash-based application which allows any people making their web pages in Flash format.
+

+

+ Actually this is a Final Year Project for my university programme BSC Computer Science (City University of Hong Kong) which is supervised by Dr. Andy Chun, Hon Wai. +

+
+
- + + 45 + 245 + 410 + 240 + 0 + 2|0x666666|100 + 0xFFFFFF + 10 + + 50 250 200 - 100 -

UPDATE HISTORY

+ 20 + + +

+ + UPDATE HISTORY + +

+
+
- + 50 270 - 300 - 100 -

Prototype version 0.4 (Jan 22)
- Supporting text fields with text formats

+ 375 + 200 + +

Prototype version 0.4.7 (Jan 27)

- (New) Supports page background color and background image

- (New) Supports text fields with text formats

- (New) Supports images of JPEG, GIF, PNG formats

- (New) Supports media of SWF format

- (New) Supports internal Flash linkings

- (New) Supports external HTTP linkings with new browser window

- (New) Supports rectangles with different dimensions and colors

- (Fixed) Navigation menu design improved with better proformance and security

Prototype version 0.3.8 (Jan 16)

- (New) Message boxes to show system messages

- (New) Message field supports icon and coloring styles

- (Fixed) Scroll bar bug for extreme scrollings

+
+ + 500 + 245 + 250 + 240 + 0 + 2|0x666666|100 + 0xFFFFFF + 10 + + + 505 + 250 + 200 + 20 + + +

+ + USEFUL LINKS + +

+
+
+
+ + 505 + 270 + + 0 + 0 + 200 + 25 + + +

+ => Dr. Andy Chun's Web +

+
+
+
+ 1 + http://www.cs.cityu.edu.hk/~hwchun/ +
+ + 505 + 290 + + 0 + 0 + 200 + 25 + + +

+ => Vicker's FYP Blog +

+
+
+
+ 1 + http://www.flysforum.net/vicatfyp +
+ + 505 + 310 + + 0 + 0 + 200 + 25 + + +

+ => Fly's Forum +

+
+
+
+ 1 + http://www.flysforum.net +
+ + 505 + 330 + + 0 + 0 + 200 + 25 + + +

+ => City University of Hong Kong +

+
+
+
+ 1 + http://www.cityu.edu.hk +
\ No newline at end of file diff --git a/src/page/page2.xml b/src/page/page2.xml new file mode 100644 index 0000000..255c9a0 --- /dev/null +++ b/src/page/page2.xml @@ -0,0 +1,55 @@ + + + + + 0 + 0 + 0x99CCFF + + 0 + 0 + img/flyswsv3.jpg + 50 + + + + + 50 + 100 + 200 + 100 + + +

+ + TECHNOLOGIES BEHIND + +

+
+
+
+ + 50 + 130 + 200 + 350 + + +

+ FLABER basically works with the principle illustrated in the diagram besides. It involves a Flash administrative backend system to build some data in XML format or database format through the PHP Server. And then the Flash frontend will pull the data out to generate a Flash format website. Or a PHP frontend will pull the data out to generate a HTML format website.
+

+

+ The advantage of this mechanism is that, there is only one unique source while the user can enjoy the convenience having both HTML and FLASH version. And of course the user can have fun designing his / her own Flash website without knowing any Flash and ActionScript knowledge. +

+
+
+
+ + 300 + 130 + img/methodology.png + +
+
\ No newline at end of file diff --git a/src/prototype.fla b/src/prototype.fla index 9b8de3e..0a249fc 100644 Binary files a/src/prototype.fla and b/src/prototype.fla differ diff --git a/src/prototype.flp b/src/prototype.flp index 30ae4a1..2b931f3 100644 --- a/src/prototype.flp +++ b/src/prototype.flp @@ -3,6 +3,10 @@ + + + + @@ -12,18 +16,21 @@ + + - - - + + + + diff --git a/src/prototype.html b/src/prototype.html new file mode 100644 index 0000000..4458610 --- /dev/null +++ b/src/prototype.html @@ -0,0 +1,21 @@ + + + +prototype + + + + + + + + + + + + diff --git a/src/prototype.swd b/src/prototype.swd index 81b0884..4620d2f 100644 Binary files a/src/prototype.swd and b/src/prototype.swd differ diff --git a/src/prototype.swf b/src/prototype.swf index 3ee94b7..32521a9 100644 Binary files a/src/prototype.swf and b/src/prototype.swf differ diff --git a/src/update_xml.php b/src/update_xml.php index ab3a12b..cc98d9a 100644 --- a/src/update_xml.php +++ b/src/update_xml.php @@ -2,24 +2,9 @@ $file_name = "(update_xml.php)"; - // check if the target object is specified - if (isset ($_GET ["target_object"])) + // check if the target file is specified + if (isset ($_GET ["target_file"])) { - // for different target, update different xml file - switch ($_GET ["target_object"]) - { - case "navigation_menu": - { - $target_file = "NavigationMenu.xml"; - break; - } - default: - { - $target_file = ""; - break; - } - } - // if the target is well defined, update now... if ($target_file != "") {