Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New2flash -- button problems

Status
Not open for further replies.

TFfan

Programmer
Jan 18, 2002
192
CA
I have standard rollover buttons on the my site arranged in a semi-circle around a logo (which is part of a movie).

When the page loads up, the logo slides down into the center of the semi-circle and rests there.

What I want to do is when the user passes over a button, say the news button, the logo dissappears and it is replaced by a newspaper sliding into the place where the logo was.

I've tried many different things and I can't quite get it. What I'm trying currently is having the logo and the button movie rollover (eg newspaper)in the same movie (with stops after each). My thinking is that I could use a gotoAndPlay and direct the movie to the desired frame.

Will this method work? Is there a better way?
 
I should probably add that my buttons and rollover movies (eg newspaper) are on different layers.
 
Create a movie clip with several frames and 2 layers...

frame 1 has the logo(I assume this is also a mc since it slides down into place) and a stop() action...

frame 2 has the newspaper you mentioned for news and a stop() action as well...

you would continue creating frames for however many buttons you have each one containing a stop() action

you simply name the mc in the instance panel and call that mc with its frame number(or label if you wish) on rollover.

If you really want to do it right... create a 3rd layer in your mc and label all the frames in the frames panel. Then you simply call the _root.mc or whatever with its label instead of its frame number.

Holer if you need more help or more explanation. Ya' Gotta Love It!
sleepyangelsBW.jpg
 
here is the actions you would place on the buttons to call a frame in an mc called "rollovers_in":

Code:
on (rollOver) {
    _root.rollovers_in.gotoAndStop(2);
}

One other thing... you will have to also have an action which takes the mc "rollover_in" back to frame 1(the logo) on rollout.

hope this helps...
Ya' Gotta Love It!
sleepyangelsBW.jpg
 
Like I said I'm new to flash so I'll tell you what I've done and what it's not doing.

I have a layer with my logo on it and I named it rd. To name it I selected the frame, right-clicked, chose
panels -> frame and in the frame menu entered the name. When I go to the instance tab it is grayed out and I can't enter anything.

I also have another MC (newspaper), in its own layer and named it "all".

On the stage I right-clicked my news button and selected actions and this is my code:

on (rollOver) {
_root.all.gotoAndStop(1);
}

on (rollOut) {
_root.rd.gotoAndStop(1);
}

Nothing happens. My buttons roll over, but the images don't switch. I've changed the numbers to names (all and rd) and nothing happens.

If I put my newspaper layer on the button timeline in its own layer on the "over" frame, the images slide in as desired; however, I can't swap to my logo after it's done (used the code from above) nor can I put the logo there before the mouse goes to a button (if I do, it stays on screen and my button rollovers slide in on top of it.
 
Trying to figure out exactly what you are doing here...

I would almost need to see your .fla file to see what it is you are doing.

You could try using the example above... instead of putting "all" and "rd" on the main timeline, create a mc called rollovers and as I stated above... place the logo mc("rd") on frame 1 and the newspaper logo("all") on frame 2 with stop actions...

the code would be:

Code:
on (rollOver) {
    _root.rollovers.gotoAndStop(2);
}

on (rollOut) {
    _root.rollovers.gotoAndStop(1);
}

should work great


just send the .fla file or post it somewhere and give us the link if possible. Much easier. Ya' Gotta Love It!
sleepyangelsBW.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top