Autor Zpráva
PCmaniak
Profil *
cauky lidicky mam mensi problem nasel jsem tento tutorial ale ubec nevim jak to obohatit o moznost kliknout na polozku v sub menu na hlavnim menu mi to jde ale ne v sub :( adresu sub polozce uspesne nactu(zjisteno pomoci debug) ale nevim jak ji proste ziskat po kliknuti na ten sub pro dalsi spracovani :( zde AS:
(layer jedna)
this._lockroot = true;

itemClass.prototype = new MovieClip();
Object.registerClass("item",itemClass);

function itemClass(){
this.open = false;
itemOpen = undefined;
}

itemClass.prototype.init = function(i){
this.mc = _root.menu.attachMovie("item","item"+i,10*i);

itemClass.prototype.onEnterFrame = function(){

if(this.quel() <= itemToOpen){
this.seek = this.park;
}else if(this.quel() > itemToOpen){
this.seek = this.park + distance;
}else{

}
this.goEase(this.seek,4);
}

itemClass.prototype.onRollOver = function(){

if(this.open){
itemToOpen = undefined;
itemToClose = this.quel();
}else{
itemToOpen = this.quel();
itemToClose = undefined;
}
distance = this.distance ;
}

itemClass.prototype.onRollOut = function(){
itemToOpen = Infinity;
}

itemClass.prototype.quel = function(){
return Number(this._name.slice(4));
}
//------- Odkaz , spusteni animace ---------//
itemClass.prototype.onRelease = function(){
getURL(nevim jak jsem dostat odkaz z te zmacnute sub :( );
}
//---------------!!!!!-----------------------//
itemClass.prototype.goEase = function(target,speed){
this._y = this._y + (target - this._y)/speed;
if(Math.abs(this._y-target) < 0.8)this._y = target;
}


(layer 2)
menuClass.prototype = new MovieClip();
function menuClass(){
this = _root.attachMovie("menu","menu",0);
this._visible = false;
this._data = new XML();
this._data._parent = this;
this._data.ignoreWhite = true;;
this._data.load("menu.xml");
this._data.onLoad = parseMenu;
this.init();
}

Object.registerClass("menu",menuClass);

parseMenu = function(){
nbChilds = this.firstChild.childNodes.length;
for(var i in this.firstChild.childNodes){
temp = new itemClass();
temp.init(i);
itemMc = temp.mc;
itemMc._y = 25*i;
itemMc.park = 25*i;
itemMc.label = this.firstChild.childNodes[i].attributes.label;


for(var j=0;j<this.firstChild.childNodes[i].childNodes.length;j++){
itemMc.attachMovie("sub","sub"+j,10*j);
itemMc["sub"+j]._y = 26 + 20*j;
itemMc["sub"+j].toto = this.firstChild.childNodes[i].childNodes[j].attributes.label;
// zde zapisu do subu odkaz..... dle debugu se to uspesne nahraje do kazdeho sub
itemMc["sub"+j].url = this.firstChild.childNodes[i].childNodes[j].attributes.data;
}
itemMc.distance = j*20;
}
var temp = new itemClass();
temp.init(this.firstChild.childNodes.length);
var itemMc = temp.mc;
itemMc._y = 15.5*this.firstChild.childNodes.length;
itemMc.park = 15.5*this.firstChild.childNodes.length;

this._parent._visible = true;
}

menuClass.prototype.init = function(){
this.attachMovie("mask","mask",300);
with(this.mask){
_y = -1
_height = _root.menu.item2._y;
_width = 101;
}

this.createEmptyMovieClip("topEdge",203);
with(this.topEdge){
lineStyle( 0.25, 0x000000, 100 );
moveTo( 0,0);
lineTo(100,0);
}
this.setMask(this.mask)
}

menuClass.prototype.onEnterFrame = function(){

this.mask._height = this.item2._y+2;

this.createEmptyMovieClip("leftEdge",200);
with(this.leftEdge){
lineStyle( 0.25, 0x000000, 100 );
moveTo( 0, 0 );
lineTo( 0,this.item2._y );
}

this.createEmptyMovieClip("rightEdge",201);
with(this.rightEdge){
lineStyle( 0.25, 0x000000, 100 );
moveTo( 100, 0 );
lineTo( 100,this.item2._y );
}

this.createEmptyMovieClip("bottomEdge",202);
with(this.bottomEdge){
lineStyle( 0.25, 0x000000, 100 );
moveTo( 0,this.item2._y );
lineTo( 100, this.item2._y);
}
}

myMenu = new menuClass();

predem dekuji za jaky koliv napad XML mi moc este nejde a tuto doopravdy netusim jak to muze bejt skousel sem snad uz vse dekuji moc
embee
Profil
no jsem zvedavej kdo ti ten kod bude lustit... good luck :D
kaym
Profil
zdravím, potrebujem pomoc alebo vysvetlit proč se mi nedaji isté obrázky které sem si vybral nastavit aby mi fungovali jako buton, resp. get url mi nechce fungovat....(sem taky zacatecnik) a kdyz dam action s levim tlacitkem, už mi zabranuje vyuzit tuhle možnost...proste mi neakceptuje tuhle funkci... mate nekdo nejaky napad???
XXX
Profil
Nevim, cim to je, ale embee vzdycky odpovi presne tak, jak bych odpovedel ja :-D
PCmaniak
Profil *
hm koukam ze tady mi asi fakt nekdo pomuze...
PCmaniak
Profil *
kaym
musis ten obrazek dat jako MC (MovieClip) a melo by to ficet ;)
a popripade si pak muzes dat action script na hlavni osu:
instance meno MC.onPress = function() {
getURL("bggfbfbgbbdf");// ztde muze bejt jaka koliv funkce...
};

instance meno MC nastavis tak ze ho oznacis a juknes na prioperations a tam je kolonka tam pisni ten nazev.... ;) kdyby este neco pisni ;)

Vaše odpověď

Mohlo by se hodit

Odkud se sem odkazuje


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0