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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flash movie rollover

Status
Not open for further replies.

rissac

Technical User
May 9, 2003
79
IN
I'd like to put a flash movie on my site, but only as a rollover'ed image. So there's a graphic(standard jpg) that when rolled over, invokes the SWF file. Does anyone know how to do this? I tried to implement the code from the link below but it doesn't work for me. Thanks.

Serge Eustache


Serge Eustache
 
Wow what a lot of code to do something so very simple!

Basically you would do the whole rollover action within the flash file. The still frame is part of the flash file, when you mouseover it plays a movieclip within itself.

It's very easy to do in Flash but you would be better off asking in the Flash forum (forum:250)

Foamcow Heavy Industries - Web design and ranting
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
I wonder what possesses people to make those animated gifs. Do you just get up in the morning and think, "You know what web design r
 
Thanks for your help.

Serge Eustache
 
I got some help from the Dreamweaver guys and it looks like working with the show/hide behavior works fine. Thanks for your help.

Serge Eustache
 
Sorry, I didn't mean to imply that you were adding to the complexity.
Rather that it seems an awfully over engineered way to do something quite simple.

If you are using Flash for the "buttons" then why do you need to employ Javascript to hide/unhide layers?

Why not simply do the hiding/unhiding within the flash movie?
For that matter, add the link there too with a getURL Actionscript command.

I will confess I didn't probe that site too deeply, basically I just rolled over the link to see what it did and took a very quick squint at the code. So perhaps I'm missing something.

Foamcow Heavy Industries - Web design and ranting
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
I wonder what possesses people to make those animated gifs. Do you just get up in the morning and think, "You know what web design r
 
To tell you the truth the flash movie was made in a 2D software and exported as a swf file. So flash was not used to create the moving pics. I needed to be able to loop seemlessly for the end of the frame to the start of the first frame. It was easyer for me to accomplish this in my 2D app then to start coding if flash. If I could attach a url script to the layer that the swf movie was in of the swf itself that would accomplish all my goals.

Serge Eustache
 
I would wholeheartedly agree with Foamcow. First of all, DW does not have any internal behaviours, that is just plain JS added. So Foamcow is correct in saying that you added to the complexity. The full flash solution would be simpler and nicer. As is, my Mozilla struggles terribly with rollovers and the effect is less than attractive.
 
Let me ask you this. Do you know of any good resource that would allow me to achieve the same effect by using Flash. Maybe a tutorial.

Serge Eustache
 
It's not that hard.
1.) Start Flash
2.) Create new Symbol->Movie (this will be your animation on roll over)
4.) Create new button, there will be 4 frames to a button,
The first is the static image (just import it, or make a new one)
The second happens on mouse over (put your movie from 2 here)
The third is shown when the mouse is clicked, this should be the movie, the original image or something new
The last is just to define the "hit area" make this a solid sqaure the size of the other frames of the movie.
5.) Place your button in the main frame of the main scene of the movie file, and then add the actionscript (if you don't know actionscript use the easy selection interface) [red]onButtonRelease{ goToURL("[/red] (or whatever the equivelent is now) to the button.


The real question is why not export the roll over image as a JPEG and leave it a CSS rollover.

[plug=shameless]
[/plug]
 
Yes, I did end up doing it in Flash and it really wasn't that bad. But let me ask you this. What I want to be able to do is when the user rolls on and off the image the movie clip continues playing from where it last played. The way it works now is the movie clip starts from the begining of the movie everytime the mouse rolls over the clip. Is there a way to make this happen? Example below.
The code I have is as follows.

on(rollOver) {_root.loop1.gotoAndPlay(2);}

on(release) {geturl"http:...";}

on(rollOut) {_root.loop1.gotoAndPlay(1);}



Serge Eustache
 
Just have a loop with the scrolling clip playing all the time and put something over the top of it to hide it, then remove the "thing" to reveal the scroller.

Same principle that was being employed, just more contained and less over engineered.

Foamcow Heavy Industries - Web design and ranting
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
I wonder what possesses people to make those animated gifs. Do you just get up in the morning and think, "You know what web design r
 
I'll seet about implementing that. Thanks.

Serge Eustache
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top