Groups | Blog | Home
all groups > flash actionscript > january 2004 >

flash actionscript : Getting back to Original Frame after Rollover



heidiho
1/23/2004 6:00:42 PM
I am trying to create a navigation bar in Flash and am having some problems with the actionscript that I need to use to create an effect. My actionscript skills are rudimentary and I have referenced my books and tutorials and just can't seem to find the answer. So, I throw myself on the mercy of you smart Flash folks for help.

Here's what I am trying to do.

The navigation bar has 3 hotspots on Frame 1. On the first hotspot, I wrote the following actionscript:
on (rollOver) {
gotoAndStop(2);
}
When the mouse rolls over the hotspot, it goes to Frame 2.

On Frame 2, I deleted the other two hotspots (I want the second and third hotspots to disappear on the rollover of the first hotspot) and created two buttons as submenus of the first hotspot.

All this is working fine as I had hoped. But my problem is that I don't know how to get back to Frame 1 if the user decides not to select anything from the submenu in Frame 2.

Incidentally, I need to figure out how to make this work so I can do the same thing for the second and third hotspots.

I hope I have explained this in a fashion that makes sense. Any help would be greatly appreciated.

heidi

kglad
1/24/2004 4:54:50 PM
you could leave your other 2 hotspots in place but use rollover code attached to them directing your movie back to frame1 where those hotspots are defined to direct your movie to the frame displaying their submenus. or you could just short-circuit this unnecessary diversion and go to the other submenu frames directly.

heidiho
1/26/2004 3:08:44 PM
Thanks for answering my post kglad!

After I posted that message, I continue to try different things and I did something similar to what you posted . . . . I created an invisble button, by putting a rectangle in the hit frame in symbol editing mode. It was a huge button that covered everthing on the navigation bar but the submenu and the corresponding hotspot. Then I wrote the actionscript for the invisible button:

on (rollOver) {
gotoAndStop(1);

It seems to work pretty well, except when I publish the movie, there's delay the mouseover . . . when I roll the mouse over where I KNOW I put the invisible buttons, it doesn't automatically go to frame 1. I wonder why that is. I am going to continue to fiddle with it and maybe I can come up with the answer.

Again, thanks for helping me out kglad!

Heidi

kglad
1/27/2004 2:17:49 AM
there shouldn't be any delay from that code.

heidiho
1/27/2004 2:39:22 PM
kglad,

Again, thanks for responding to me . . .

I think I figured out the problem regarding the delay . . . and it's a computer problem and I thought I'd share it on the forum because it often affects how I work with my Macromedia products.

I am using a Windows ME platform . . . I have a RAM monitoring program installed on my machine and I've noticed that whenever I have more than one Macromedia program open (I use Studio MX), my RAM reduces to like 150. I have had more memory installed, (almost the maximum I have room for) but my computer tech has pointed out to me that Windows ME is dreadful with memory.

So, I believe that when I was testing the flash navigation bar I created, the delay was not caused by what I scripted, but by the crappiness of the ME platform system. When I closed everything out and rebooted my computer, the navigation bar worked fine.

Again, I thought I would share this with the forum because my experience with ME and Macromedia (particularly Fireworks) has been arbitrary at best. Has anyone else experienced anything similar?
Not to upset any of you PC lovers out there, but I keep begging my boss for a MAC to do this stuff, but he will not bend. I guess the only thing left is to upgrade to Windows XP.

Well kglad, thanks again. You've been most helpful!

Heidi

kglad
1/27/2004 2:55:53 PM
you're welcome heidi. and good luck getting a new computer or operating system.

AddThis Social Bookmark Button