PDA

View Full Version : Flash OnMouseOver Problem



digimar
December 28, 2004, 06:17 PM
Hi,

I am creating a navigation bar and i used an OnMouseOver effect to display the options under each button option. My issue is while the options do appear how do i get them to stay there so i can mouse over them so they can be selected? Everytime i move the cursor away from the the main options the bus options disappear.

This must be quite simple but i'm comletely new to flash and so bear with me plz.

The effect i would like is similar to the navigation bar at the top of the Macromedia site.. www.macromedia.com

Anyone who wants to check the source code can send me a private message. Please help, i need to get this figured out fast!

GodKid
December 28, 2004, 06:22 PM
you most likely have a OnMouseOut option set... remove it and you should be good to go.

GodKid
December 28, 2004, 06:28 PM
ooops... sorry... i looked back and saw you were talking about flash not dreamweaver.... (got mixed up cause of the function name)

hmmm... it's actually not hat simple and not a newbie trick as it has to do with nesting movie clips or attaching/removing movie clips on button rollover. I'd suggest that unless absoultely necessary use a conmbination of javascript and CSS to achieve the same thing in DW

digimar
December 28, 2004, 06:29 PM
OK. if i do that in Dreamweaver can i accomplish the exact same effect i do in Flash? Like the macromedia.com site?

digimar
December 28, 2004, 06:34 PM
Would this be easier? Plus I would need to use images since the fonts i use arent exactly common on the average user's computer. I had to install them on mine specifically as well. Would this make a difference?

Xenocrates
December 28, 2004, 08:21 PM
When you do the on (mouseOver), do you start another movie animation? If so, you need to call this.gotoAndStop(1) on the movie that you called by trapping it inside a: on (load) { } event. That's how they got the option to "stay" after it becomes visible. For example, on your button:



on (mouseOver){
moviename.gotoAndPlay(1)
}

On your movie symbol that shows the option:



on (load) {
this.gotoAndStop(1)
}

...provided that your movie symbol animates and disappears. This will prevent your movie symbol from disappearing as it won't play to completion.

GodKid
December 28, 2004, 10:20 PM
- das only one half xen, the unload or disappearing is more complicated than it first seems.. that is if you want to duplicate what is happening at the flash site.

- yeh digimar, if you use the DW route you'll have to create small images to show your special text/font.

- the EXACT effect is more complex than you think Digimar as they seem to be using some mouse position conditions or complex target areas. hmmmm.... they may actually be using complex target areas rather than anything else... thinking..

digimar
December 29, 2004, 07:55 AM
OK then WOW.

This seems to be more trouble than its worth. But heck, i'll give it a try anyways. Couldnt hurt. Thanks guys.

Xenocrates
December 30, 2004, 12:09 AM
Now that I looked at the website, it's actually not that difficult:

If done entirely in Flash:

- An entire graphic of the menu bar was created in a separate program and imported into Flash

- Cut outs of the graphic were converted to button symbols, complete with roll over graphic modifications etc.

- The menu items shown below the main bar are actually 1 embedded movie

- In this embedded movie, 10 frames are dedicated to each set of menu items. If there are 5 menu items, then the movie will have 50 frames.

- In each set of 10 frames, the graphic is different (representing each menu item). It fades in for the first 4 frames, stops on the 5th frame, and fades out on the 6th - 10th frame.

Let's say we call the submenu items symbol subMovie

For the first button on the main menu graphic that has sub options:



on (rollOver){
subMovie.gotoAndPlay(1)
}


For the second button which has sub options, the subMovie gotoAndPlays frame 11, frame 21 for button 3 and so on. subMovie will play and stop at frame 5 for the first button, frame 15 for the second button, frame 25 for the third button, and so on. You have to attach:


this.stop()

...on the 5th frame of every 10 frame segment in subMovie. That way, the on (rollOver) can start at the first frame for each segment and reliably expect it to stop at the 5th frame in the segment.

Now for the first button on the main graphic, also attach:



on (rollOut){
subMovie.gotoAndPlay(6)
}


For each subsequent button, the subMovie would gotoAndPlay the 6th frame of each segment (16 for the second button, 26 for the third button and so on...) because frames 6 - 10 fades out the graphic slowly.

On the 10th frame of each segment, the movie stops:


this.stop()

Now while subMovie has mouse focus, it will remain visible:



on (rollOver){
subMovie.gotoAndStop(5)
}


When it looses mouse focus, it fades out:



on (rollOut){
subMovie.gotoAndPlay(6)
}


...frame 16 for the third button, 26 for the third, and so on. See how easy that was? If you want to get creative, you can add a timer delay to the embedded movie before it fades out. Happy coding.

GodKid
December 30, 2004, 11:36 PM
the onrollout will activate once you're outside of the main button target area Xeno... that's the complex part... of course I haven't tried your suggestion, but from my Flash days doing menus was never that easy.

from what I remember you the mouse MUST be within the target/hit area in order for the button to continue be active... that's how the rollover and rollout states are determined.

Another way of getting sub-menus would simply be to attach the movie clip to the over state.

digimar
December 31, 2004, 06:10 AM
Actually i think both of your ideas will work equally as well. They both sound feasible. And GodKid i think he is loading a movie so it should stay there i think. But i'm jus a newbie so i really wont know until i try.

digimar
December 31, 2004, 07:11 AM
This may sound retarded but how exactly do i ensure that the submovie(s) appear under the main bar when i load them. I really have NO clue! And how do i exactly create a sub menu, create a new movie and then add it how exactly? I really have no idea.