主题:  flashmx中组件collapsible menu的使用

hsx7263955

职务:普通成员
等级:1
金币:0.0
发贴:113
注册:2002/2/17 10:54:17
#12002/10/20 20:25:13

图片如下:

我想把图1和图2的菜单内容改成我自己的,不知在flashmx中怎么实现???



5D限制级

职务:普通成员
等级:6
金币:10.0
发贴:4970
注册:2001/8/16 14:52:34
#22002/10/20 20:29:25
在它的属性里没有吗



hsx7263955

职务:普通成员
等级:1
金币:0.0
发贴:113
注册:2002/2/17 10:54:17
#32002/10/20 20:37:49
属性里只能设置颜色,距离等等,没有菜单内容的改变
那个兄弟知道讲详细点,我从来没用过组件这个东东



foxet

职务:普通成员
等级:1
金币:1.0
发贴:163
注册:2001/11/10 21:28:33
#42002/10/20 20:47:57
看看他的HELP



厚土

职务:普通成员
等级:1
金币:0.0
发贴:103
注册:2002/10/11 11:03:01
#52002/10/20 21:07:04
楼主,help是人看的吗?我装组件出现一个对话框,什么意思呢,不懂,指点,原文
如下


the extension package is invalid 。 the extension will not be installed


(本来也想贴一张图片,不知怎么贴上去,哈哈)

就让她成为我梦中的一把吉他
用我的生命去轻抚她
就让这若隐的琴音穿越四季
让所有石化的思想都发芽



foxet

职务:普通成员
等级:1
金币:1.0
发贴:163
注册:2001/11/10 21:28:33
#62002/10/20 21:40:37
Collapsible Menu Component
Build 1.0.2

Uses XML source file (Maintain node structure for correct parsing
Customisable Button Colours
NEW, Uses setInterval to emulate onEnterFrame events with decreased CPU usage
NEW, Tweening equations optimised to be more accurate, less CPU intensive
NEW, Button animation controlled via a "Listeners" approach
NEW, Support for an "action" argument to be passed to primary buttons so that they too can be made to load/goto etc. onMouseUp.
NEW, supports sounds to be attached from the library to play on primary and secondary button presses.
Learn more about components visit flashcomponents.net

You can access the installed components through the components panel in flash menu -> windows -> components. The component panel features a dropdown list select

我不知道你是那里DOWN的,是怎么装 的,上面是我看到的REFERENCE,而且它在FLASH里还有HELP,看来是要用XML OBJECT
这里有作者的稿
flashcomponents.net/tutorials/collmenu/menu.htm



hsx7263955

职务:普通成员
等级:1
金币:0.0
发贴:113
注册:2002/2/17 10:54:17
#72002/10/20 22:21:19
没有人回答吗?高手呢?



厚土

职务:普通成员
等级:1
金币:0.0
发贴:103
注册:2002/10/11 11:03:01
#82002/10/21 7:05:42
按ctrl+l键调出以下
#initclip 2
function CollapseMenuClass() {
this.init();
}
CollapseMenuClass.prototype = new MovieClip();
Object.registerClass("CollapseMenu", CollapseMenuClass);
CollapseMenuClass.prototype.init = function() {
this.menuItems = [{name:'parent1', sub:[{name:'parent1child1'}, {name:'parent1child2'}]}, {name:'parent2', sub:[{name:'parent2child1'}, {name:'parent2child2'}]}, {name:'parent3', sub:[{name:'parent3child1'}, {name:'parent3child2'}]}, {name:'parent4', sub:[{name:'parent4child1'}, {name:'parent4child2'}]}, {name:'parent5', sub:[{name:'parent5child1'}, {name:'parent5child2'}]}];
this.len = this.menuItems.length;
this.xtarget = 0;
this.ytarget = 0;
this.icount = 0;
this.addItems(this.menuItems, this.ytarget);
this.enabled = true;
};
CollapseMenuClass.prototype.getNewDepth = function() {
return (!this.depth ? (this.depth=1) : ++this.depth);
};
CollapseMenuClass.prototype.addItems = function(arr, yStart) {
var len = arr.length;
this.ytarget = ystart;
this.iid = setInterval(this, "attachOverTime", this.delay, arr, len);
};
CollapseMenuClass.prototype.attachOverTime = function(arr, len) {
if (this.icount // ---check if primary button
if (arr[this.icount]['sub']) {
var subItemsLen = arr[this.icount]['sub'].length;
var yOffset = (subItemsLen*25)+(this.yincrement*subItemsLen);
var newName = arr[this.icount]['name'];
var whichBut = 'primary';
var setUid = this.icount;
} else {
var whichBut = 'secondary';
var newName = arr[this.icount]['name'];
// var passAction = arr[this.icount]['action'];
var yOffset = 0;
}
this.attachObjParams = {_x:this.xtarget, _y:this.ytarget, parent:this, uid:setUid, yactive:yOffset, butType:whichBut};
this.id = this.attachMovie("CollapseButton", newName, this.getNewDepth(), this.attachObjParams);
this.ytarget += this.id._height+this.yincrement;
this.icount++;
} else {
this.resetInterval(this.iid);
}
};
CollapseMenuClass.prototype.resetInterval = function(intObj) {
this.icount = 0;
this.xtarget = 0;
this.ytarget = 0;
clearInterval(intObj);
};
CollapseMenuClass.prototype.activateObj = function(uid) {
// ---activated item
var newObj = this[this.menuItems[uid]['name']];
// ---check if item is already open
if (newObj.active == true) {
newObj.active = false;
this.collapse(uid);
} else {
// ---close all items
for (var i = 0; i var tempObj = this[this.menuItems[i]['name']];
if (tempObj.active) {
var puid = i;
}
tempObj.active = false;
}
this.collapse(puid);
newObj.active = true;
// ---if submenu exists
if (this.menuItems[uid]['sub'].length>0) {
// ---expand item
this.expand(uid);
}
}
};
CollapseMenuClass.prototype.expand = function(uid) {
var activeObj = this.menuItems[uid];
var subLen = activeObj['sub'].length;
var yStart = this[activeObj['name']].yinactive+this[activeObj['name']]._height+this.yincrement;
for (var i = ++uid; i var tempObj = this[this.menuItems[i]['name']];
tempObj.y += this[activeObj['name']].yactive;
}
this.addItems(activeObj['sub'], yStart);
};
CollapseMenuClass.prototype.collapse = function(uid) {
var id = uid;
if (id != undefined) {
var activeObj = this.menuItems[id];
var activeSubLen = activeObj['sub'].length;
for (var i = 0; i var activeSubObj = this[activeObj['sub'][i]['name']];
removeMovieClip(activeSubObj);
}
id = undefined;
}
for (var i = (uid == undefined) ? 0 : ++uid; i var tempObj = this[this.menuItems[i]['name']];
tempObj.y = tempObj.yinactive;
}
};
#endinitclip

改这里
this.menuItems = [{name:'parent1', sub:[{name:'parent1child1'}, {name:'parent1child2'}]}, {name:'parent2', sub:[{name:'parent2child1'}, {name:'parent2child2'}]}, {name:'parent3', sub:[{name:'parent3child1'}, {name:'parent3child2'}]}, {name:'parent4', sub:[{name:'parent4child1'}, {name:'parent4child2'}]}, {name:'parent5', sub:[{name:'parent5child1'}, {name:'parent5child2'}]}];
好像效果不大理想
高手指点吧


我寻遍了海角和天涯
却找不到梦中的玫瑰花
我望穿了四季的天空
却看不见真正的她

就让她成为我梦中的一把吉他
用我的生命去轻抚她
就让这若隐的琴音穿越四季
让所有石化的思想都发芽



Mozier

职务:管理员
等级:5
金币:11.0
发贴:2994
注册:2004/1/12 17:26:30
#92002/10/21 8:59:41
以后看清版块再发贴!
转flash dev !