View Full Version : kewl bouncy menu-but how the hell...
jain
June 26th, 2003, 06:43 AM
Hey guys,
I found this great bouncy menu, did the tutorial and all that, but I don't know how to make the duplicated instance of the button item actually link to different SWF's or URL's??? At the moment because an instance of a button is being duplicated via AS I can only make the whole nav link to one place! so what AS do I insert to make each instance link to different place??
hope this makes sense....but either way, its a lovely nav and if anyone can get it to actually work it would be great ;-)))
cheers in advance
oh and here is the link to the original tutorial ;-)
http://www.newarchitectmag.com/archives/2001/08/hall/
I have attached the Fla
Jain
cool blue
June 26th, 2003, 07:20 AM
HEY!! jain
the tutorials are out there i guess the link expains it all......
but yes!!! for a new starter like me i guess....we need a layman explaination
chal then...
jain
June 26th, 2003, 07:40 AM
hey ;-)
I know, but I spent over a day trying out different ways to get it to work and did the tutorial twice over, but ...... oh well, just hoping that some lurvvvvvvvvvely guru will come to our aid ;-))))
laters....J.
cool blue
June 26th, 2003, 07:45 AM
HEY!!! do u know the fundas fo elasticity...
if no then follow this link
www.bit-101.com
in that tutorials...u have a wounderfull explaination about elasticity.
Later ....C.B.
jain
June 26th, 2003, 07:55 AM
thanks ;-)...that tutorial is based on the original one I posted up...call me dumber and dumberer but I still don't get how to link the seperate menu items via AS?
ANYONE ANY IDEAS????
kO2n
June 26th, 2003, 08:08 AM
Do you just want to know how you can make the buttons work so that the actually link to something?
Viru.
jain
June 26th, 2003, 08:15 AM
yes ;-) because the menu uses only one button duplicated many times in AS I can only get it to link to one place as there is effectively only one physical button on the the stage, I just dont know how to go into the code to make the instances of the button link to URL's or call in SWF's.....
can you help?
kode
June 26th, 2003, 08:15 AM
you could store the url's in an array... something like this:
onClipEvent (load) {
numItems = 8;
friction = .6;
speedratio = .3;
boost = 20;
invboost = -boost/(numItems-1);
base = 60;
urls = ["http://kirupa.com", "http://bit-101.com", "http://ultrashock.com", etc, etc];
for (var i = 0; i<numItems; ++i) {
this.attachMovie("item", "item"+i, i);
this["item"+i]._x = i*60;
this["item"+i].text = "Item "+i;
this["item"+i].speed = 0;
this["item"+i].i = i;
this["item"+i].onRelease = function() {
getURL(urls[this.i], "_blank");
};
}
}
jain
June 26th, 2003, 08:27 AM
thanx Kax, ;-) I am no AS guru, so forgive me if I ask stupid questions....but is that the exact code that I would place into the existing code?
I did try placing it in as is, but it doesnt seem to work?
kO2n
June 26th, 2003, 08:27 AM
Hmm, i dunno looking at that script doesnt make me think it'll work, i'll try that out now,
Viru.
kO2n
June 26th, 2003, 08:29 AM
just tried it out with the trace method, no go, good try though mate.
Viru.
jain
June 26th, 2003, 08:34 AM
hmmmmm....bummer! :(
kode
June 26th, 2003, 08:38 AM
it works... :sigh:
jain
June 26th, 2003, 09:01 AM
you rock!!!!!! hmm, wonder why it didnt work when I pasted it in....but deadly thanx Kax.....
another question if you have time? the same problem applies to the nav text, they are all duplicates.....how do you change the nav text ' item 0' 'item 1' etc etc to whatever text you actually want it to say......like ' about me' or 'whatever link'.....
sorry for being a pain...
:-\
kode
June 26th, 2003, 09:04 AM
more arrays... ;)
onClipEvent (load) {
numItems = 8;
friction = .6;
speedratio = .3;
boost = 20;
invboost = -boost/(numItems-1);
base = 60;
urls = ["http://kirupa.com", "http://bit-101.com", etc, etc];
labels = ["about me", "whatever link", etc, etc];
for (var i = 0; i<numItems; ++i) {
this.attachMovie("item", "item"+i, i);
this["item"+i]._x = i*60;
this["item"+i].text = labels[i];
this["item"+i].speed = 0;
this["item"+i].i = i;
this["item"+i].onRelease = function() {
getURL(urls[this.i], "_blank");
};
}
}
jain
June 26th, 2003, 09:08 AM
PS - I know you can change this part in the code(below) but once again it just duplicates whatever text you place in there....
onClipEvent (load) {
numItems = 8;
friction = .6;
speedratio = .3;
boost = 20;
invboost = -boost/(numItems-1);
base = 60;
urls = ["http://kirupa.com", "http://bit-101.com", "http://ultrashock.com", etc, etc];
for (var i = 0; i<numItems; ++i) {
this.attachMovie("item", "item"+i, i);
this["item"+i]._x = i*60;
this["item"+i].text = "whatever! "+i;
this["item"+i].speed = 0;
this["item"+i].i = i;
this["item"+i].onRelease = function() {
getURL(urls[this.i], "_blank");
};
}
kode
June 26th, 2003, 09:11 AM
again... :P
jain
June 26th, 2003, 09:25 AM
I love you! :love:
I am going to ask you one more teeny, teeny, teeny weeny question and I promise to give you a back rub if I am ever in Mexico (jauna la loca ;-))) )
what if you wanted to call in swf's instead of URL's ...
remember I love you.... (LOL) :P
kode
June 26th, 2003, 09:30 AM
assuming that you want to load the SWF's into a MovieClip called container...
onClipEvent (load) {
numItems = 8;
friction = .6;
speedratio = .3;
boost = 20;
invboost = -boost/(numItems-1);
base = 60;
swfs = ["aboutMe.swf", "whateverLink.swf", etc, etc];
labels = ["about me", "whatever link", etc, etc];
for (var i = 0; i<numItems; ++i) {
this.attachMovie("item", "item"+i, i);
this["item"+i]._x = i*60;
this["item"+i].text = labels[i];
this["item"+i].speed = 0;
this["item"+i].i = i;
this["item"+i].onRelease = function() {
_parent.container.loadMovie(swfs[this.i]);
};
}
}
by the way, i wouldn't love me if i were you... :P
jain
June 26th, 2003, 09:37 AM
cheers kax! and remember, spread the love! thats what I'm talking about.....spread the love! (LOL)
:love:
thank-you, thank-you, thank-you!
kode
June 26th, 2003, 09:39 AM
:P
you're welcome, you're welcome, you're welcome. ;)
jain
June 26th, 2003, 09:56 AM
;-) Kax is there any reason why the rollover on the button isnt working now?
kode
June 26th, 2003, 10:09 AM
replace the onRelease handler with this code...
this["item"+i].onMouseDown = function() {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
_parent.container.loadMovie(swfs[this.i]);
}
};
i believe you could also fix it by setting its trackAsMenu property to true, but it didn't work when i tested it and i'm kinda busy now. :-\
jain
June 26th, 2003, 10:11 AM
kewl :)
kode
June 26th, 2003, 10:12 AM
yup. ;)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.