I discovered that your code didn’t work correctly, sometimes you have to click 2 times before something moves. I want that, if you click bio pics,mail and links will move to the right and then if you click bio again OR if you click for example mail from the menu pics and mail go back to their original place and links stays at the right side. Do you know what i mean and do you think that is possible without rewriting the whole code?
(Everybody is welcome to help, not only stringy!!)
yes i know, but if you label them like i said, it is easier to loop through them and also easier to follow what is going on if you put them in an array.
for example
6 movieclips labelled btn0,btn1,btn2…
numbbut = 6
for (var i = 0; i<numbbut; i++) {
this[“btn”+i].onPress = function() {
this.pressed = true;
trace(this.pressed);
};
}
if you click on a button the buttons goes to the right aswell, i dont know if that was what you wanted, but i changed (a little tiny bit) of your code, so it looks like i want it to look. i’ve changed this
if (this._x == this.startX) {
for (var j = this.ivar; j<startArray.length; j++) {
move(startArray[j], startArray[j].endX);
}
to
if (this._x == this.startX) {
for (var j = this.ivar+1; j<startArray.length; j++) {
move(startArray[j], startArray[j].endX);
}
so if you click know, the clicked button won’t go to the right, but i guess you could figured this out by yourself. But thanks for all this scripting again!
no, as you can see the main timeline has two layers, 1 layer with the menu and the other menu with the submenu (forgot to turn _alpha to 100, so that’s why you can’t see the submenu), this submenu is called PICS. Now i’ll explain pieces of my code:
startArray*.onPress = function() {
// so now you're in the mc you clicked
subhide(placeold);
// hides the previous submenu
place = this.txt;
// this indicates the movieclip you clicked,
// inside the btns (btn0, btn1 etc) is txt
// the title of the btn (PICS, HOME etc)
submenu(place);
//does the function submenu, if you clicked PICS, place = PICS
placeold = this.txt;
// sets the mc you clicked to oldplace for the next time you click a button
now the function that isnt working
function submenu(loc) {
// loc = place = mcyouclicked.txt = (PICS/HOME etc)
setProperty(loc, _visible, true);
// sets the visibility of the submenu true
loc.onEnterFrame = function() {
// submenu.onEnterFrame
trace("boe");
this._alpha = this._alpha + 2;
// lets the mc fade in from 0 to 100
if (this._alpha>=100) {
delete this.onEnterFrame;
// when mc is fully visible, delete this.onEnterFrame
}
};
}
i’ll hope you do know what i mean now… i think its difficult to explain problems well ;(
No i’m sorry, because the other buttons (BIO, MAIL) will have submenu’s too, and you’ve only fixed it for pics. It want the submenu to fade in depends on the button you’ve clicked… maybe it’s to complicated…
it is getting a bit messy but you can still make it work.
Give each submenu a seperate instance name, pics0,pics1,pics2 so we can use ivar to reference again. Just done it quickly here with 3, you`ll have to positionthem correctly
Thanks! Do you know a way to change the gap, because i want the gap to be as big as the submenu, and the submenu’s will change from size… Thanks for putting so much time in my projects! I’ve learned a lot the past days! About your script… could you tell me why you use createEmptyMovieClip? Because thats the only part i dont understand about the code…
created empty movieclip because it worked better for the onEnterFrame(“loc”)
Im pretty sure we can use the submenus_width to vary the spacing. If you get your submenus in place, ill have a try because i`m still not sure where they are going.