|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Infinate Menu Problems
Can anyone help, I looked at this tutorial on making an infinite menu and found it to be very useful:
http://www.kirupa.com/developer/mx/infinite.htm the menu scrolls backward and forward following your mouse. I only want the menu to move when the mouse is over the menu. I have changed the script so the menu is activated on(rollOver) but need help in telling the menu to stop when the mouse is not over it. The script I am using at the moment is: on(rollOver) { xcenter=150; speed=1/10; } onClipEvent (enterFrame) { var distance=_root._xmouse-xcenter; _x+=(distance*speed); if (_x > 0) _x=-300; if (_x < -300) _x=0; } Any suggestions?? |
|
#2
|
|||
|
|||
|
Hi, try this out:
on(rollOver) { xcenter=150; speed=1/10; } onClipEvent (enterFrame) { if(_ymouse > _y && _ymouse < _height) { var distance=_root._xmouse-xcenter; _x+=(distance*speed); if (_x > 0) _x=-300; if (_x < -300) _x=0; } } You may need to flip the < and > depending on your movie alignment. See which works. -Tann |
|
#3
|
|||
|
|||
|
Hi again, this may be better suited:
on(load) { mouseOn = false; xcenter=150; speed=1/10; } on(rollOver) { mouseOn = true; } on(rollOut) { mouseOn = false; } onClipEvent (enterFrame) { if(mouseOn) { var distance=_root._xmouse-xcenter; _x+=(distance*speed); if (_x > 0) _x=-300; if (_x < -300) _x=0; } } This version means you dont have to worry about the _y co-ord's at all, which is better if you have complex animations. -Tann |
|
#4
|
|||
|
|||
|
Got it working thanks, although it needed the first line:
on(load) { to be changed to onClipEvent (load) { Thanks loads, you saved me some right work. ![]() |
|
#5
|
|||
|
|||
|
Infinate Menu Button Problems
The menu's working sweet as a nut now but for some reason I cant get the buttons to do anything.
I want to add a command to the menu buttons so it plays scene 15 on the main timeline but when ever I try to add any command to any of the buttons nothing seams to work. I think it might be a problem with my targeting, the script is on button 02 and attached the file www.serioussounds.net/temp/infinate_menu.fla HELP!!!!! |
|
#6
|
|||
|
|||
|
Sorry the correct URL is www.serioussounds.net/test/infinate_menu.fla
|
|
#7
|
|||
|
|||
|
Hi,
Swapped layers around in menu (text and button). Moved and updated the button code. You had applied the button code to the movie clip and not the actual buttons. Yer I kinda figured that was my fault from my earlier post. Anyhow, I sorted it all out. Here ya go -Tann |
|
#8
|
|||
|
|||
|
You beauty, I’d been driving my self mad wondering why the script wouldn’t work. Its always best to let a fresh set of eyes (with more experience) look over something.
Thanks |
|
#9
|
|||
|
|||
|
Hi all
I've been playing round with this code for most of the day and wonder if anybody out there can help. My problem is that I want to load images into the slide bar [data from a xml file], which when clicked will change the state of a main image above the slide bar. I've been playing round for the last 6 hours trying to get the loaded images into buttons but can't seem to get it to work, know any tips that could help me out? Thanks in advance |
|
#10
|
|||
|
|||
|
Hi, how and where are you loading the images?
If your using the modified fla I posted why not try putting the image in the clip called menu, or at least the blank movies your going to load the images into. You can manually or dynamically position them there. Make the buttons alpha 0 and place its layer above the new image layer. If your doing everything with AS i.e. making blank movies and loading the images just make the new movies depth something high like 25, 26, 27 etc and then swap each with the relevant button via swapDepths. That way you can dynamically place the image under the button (so the button will still work). Are you positive that the image name's are being read correctly i.e. got all the quotes sorted out, flash can be funny that way. |
|
#11
|
|||
|
|||
|
Hi Tann.
Posted a long reply this morning, but have made some good progress so I've edited..... I'm getting my data from an xml file PHP Code:
Then I'm doing the follwoing to put the images into the movie clip. Instance Names: menu_general instance name: WholeMenu menu_general.menu [left] instance name: ImgClips menu_general.menu [Right] instance name: ImgClips2 I've placed a empty movie into the menu called I now duplicate ImgClip for each image by PHP Code:
This works great, a image is loaded into the clip and moves with the mouseover action. The only problem is that it only loads one image. I would have thought that it would load all the images [into img1, img2, img3 etc.], and space them at 60px intervals. Any idea why it's only loading one image? Here's my fla of progress so far: http://www.anchovie.net/infinate_menu.trail.fla Thanks in advance.... Last edited by orange.man : December 16th, 2003 at 06:40 AM. |
|
#12
|
|||
|
|||
|
Hi, try this out. ill check back in a few hours
_root.WholeMenu.ImgClips.duplicateMovieClip(ImgClip, "img"+Num, Num); _root.WholeMenu.ImgClips2.duplicateMovieClip(ImgClip, "img"+Num+Num, Num); imagePath2 = NewSlideNode.attributes.imgSML; clip1 = eval("_root.WholeMenu.ImgClips.img"+Num); clip1.loadMovie(imagePath2); clip2 = eval("_root.WholeMenu.ImgClips2.img"+Num+Num); clip2.loadMovie(imagePath2); Last edited by Tann San : December 16th, 2003 at 10:55 AM. |
|
|