[mx] menu button issues - i have searched i promise!

hey everyone,

I am working on a photo gallery type thing and i decided to use the infinite menu idea posted in kirupa.

Wanted it vertical, so made a couple of changes, no problem!

i want the picture buttons to be clickable to load larger images. To test, i just added a text box called “words” to just see if the numbers changed ok when i clicked the various buttons.

It all seemed to work fine, but now there is an amazingly strange problem.

the buttons become dysfunctional if you try to mouse over the first image (which is tinted green), and then randomly become active again. I know it sounds odd but i have debugged and can’t figure out any reason why!

so i have this code on a layer:

_root.slider.cc2.onPress = function() {
_root.words = 2;
};
_root.slider.cc3.onPress = function() {
_root.words = 3;
};
_root.slider.cc4.onPress = function() {
_root.words = 4;
};
_root.slider.cc5.onPress = function() {
_root.words = 5;
};
_root.slider.cc6.onPress = function() {
_root.words = 6;
};
_root.slider.cc7.onPress = function() {
_root.words = 7;
};
_root.slider.cc8.onPress = function() {
_root.words = 8;
};
_root.slider.cc9.onPress = function() {
_root.words = 9;
};
_root.slider.cc10.onPress = function() {
_root.words = 10;
};

ycenter = 175;
speed = 1/40;

this.onEnterFrame = function() {
var distance = _root._ymouse-ycenter;
_root.slider._y -= (distance*speed);
if (_root.slider._y>0) {
_root.slider._y = -630;
}
if (_root.slider._y<-630) {
_root.slider._y = 0;
}
};

Is this some strange bug with the infinite menu? Please have a look at the fla as it becomes completely obvious.

If anyone can help, or at least come up with a work around, i would appreciate it very much.

thanks!
kd

Two objects with the same instance name may cause some conflicts. :-\

I grouped your Buttons in a MovieClip and placed two instances, aButtons and bButtons. =)

I also removed this code:
[AS]_root.slider.cc2.onPress = function() {
_root.words = 2;
};
_root.slider.cc3.onPress = function() {
_root.words = 3;
};
_root.slider.cc4.onPress = function() {
_root.words = 4;
};
_root.slider.cc5.onPress = function() {
_root.words = 5;
};
_root.slider.cc6.onPress = function() {
_root.words = 6;
};
_root.slider.cc7.onPress = function() {
_root.words = 7;
};
_root.slider.cc8.onPress = function() {
_root.words = 8;
};
_root.slider.cc9.onPress = function() {
_root.words = 9;
};
_root.slider.cc10.onPress = function() {
_root.words = 10;
};[/AS]
Instead, I used a for action to assign the onPress handlers. :wink:

hey that’s brilliant, thanks!:slight_smile:

If you could help me a tiny bit more, it would be really great!

I always have problems with this.

So instead of changing the text in words, i want to load the relevant large image.

Now i would always do this:

_root.holder.loadMovie (“thumbs” + i + “.jpg”);

Now this obviously doesn’t work as it always returns i = 11 (the highest number for i in the for loop).

But what is the right way to concatenate this? If i see the code done right just once, i will finally get it (i hope)!

If you could do me this courtesy, i would be really greateful.

Thanks so much!

kd

[AS]_root.holder.loadMovie(“thumbs”+this.i+".jpg");[/AS]
Done. :wink:

arghhh!

Was that it!!!

thanks so much, you’ve helped me more than you know.

I won’t forget this,

Thanks mate
kd

:stuck_out_tongue:

No problem. =)

Kode,

sorry to bother you, but i’ve been debugging and the problem is still there!

i added the loadmovie and everything was fine, then when i tested online, some buttons didn’t load the movie at all (although now all the buttons DO have the little hand onRollover). But then if you clicked those same buttons another time, they loaded fine! I don’t get it!

what do you think it can be? i can post something online if that helps you see the problem. i’ll keep testing and try and figure it out.

thanks,

kd

Originally posted by kdzines
i can post something online if that helps you see the problem.

Yup… that could be useful. :wink:

http://www.kdzines.com/buba/website2003/

this is the development site i am working on.

click collections.

it’s very wierd…

Honestly, I have no idea… :-\

May I take a look at both FLA’s? :slight_smile:

hey kax (or is it kode?),

Sorry i haven’t posted any flas, i have been working 15 hour days!
gonna find some time over the weekend, and if i still have the problem, i will post something.

thanks man

kd

OK! Hope you can solve this problem. =)

[SIZE=1]PS. It used to be kax, then I changed it to kode, but now it’s kax again. :P[/SIZE]

hey kax,

just to let you know, i re did the menu with the proper content, and all is working great now! Really wierd what happened, but i’m glad its sorted.

On a related note, i was wondering if you had any ideas for this.

When i click the section in which the menu is loaded, i was wondering what the easiest way would be to have the menu move at afixed speed when the mouse is NOT over the area. And then move as normal when the mouse is over the masked area.

Any ideas? i thought of using a hittest type thing, but maybe you know of a better way to constrain?

I guess i could add an if statement that checks where the _root.xmouse and ymouse are, but that’s not so portable.

Any cool tricks or ideas would as always be appreciated.

thanks mate,

kd

Sorry… I kinda missed this thread. :-\

And honestly, I’d simply use a hitTest. If you’re concerned about CPU usage, I think it shouldn’t be much of a problem. :slight_smile:

thanks for all the help!

i ended up using:

if(_root.content.holder._ymouse&lt;350 && _root.content.holder._ymouse&gt;0){
	if(_root.content.holder._xmouse&lt;70 && _root.content.holder._xmouse&gt;0){
	
_root.content.holder.slider._y -= (distance*speed);
	}
	else{
	_root.content.holder.slider._y += 3;
	}
}

works pretty well.

thanks again

kd