Hover Caption?

Just wondering, can u have moce then one movie follow the mouse?

Anyway…


startDrag(_root.caption, true);
startDrag(_root.captiontr, true);

I am trying to get more then 1 different style hover caption over a button using the tutorial found on this site…any help would be nice…thxs.

You can’t. Use something like this instead:

theClip.onEnterFrame=function(){
  this._x=_xmouse;
  this._y=_ymouse;
}

pom :crazy:

thank you, works nice now…

best use is


myClip.onMouseMove = function(){
	this._x = this._parent._xmouse;
	this._y = this._parent._ymouse;
	updateAfterEvent();
}

and there are easy ways to add hover caption functionality to buttons like re-routing the onRollOver through a call which can for all buttons display the associated hover caption… I cant get into that now but if you’re interested, I can post it later :slight_smile:

What makes your usage better senocular?

I mean, they both work the same way, so I don’t really understand why adding the extra locators and an updateAfterEvent() makes a difference.

If I may answer your question, Lost.

Sen’s method is more efficient because it uses the mouseMove event handler instead of the enterFrame one. This means it only triggers events when the mouse moves (and that’s the only time it’s needed…u don’t need to keep triggering the event every frame).

Also the updateAfterEvent() method keeps the caption smoothly following the mouse by updating the display immediately after the caption is positioned.

-Al

::EDIT:: Oh, and the extra locators are necessary to get the x and y mouse positions relative to the parent coordinate system, not the system of the caption clip.

Well I just re-read the posts now I have another problem…the windows drag fine on rollover, but now the 1 hover that I needed to change, the text in the box is expanded and akward. Here is the file to take a look. I am confused…

Ah, I didn’t take notice to the onMouseMove event in there, that is why it wasn’t making any sense to me.

here is the same fla just with sen’s method…still same problem with text.

I don’t think it is the script causing the problem.

It looks to me like you stretched that caption textbox with the free transform tool so that it became bigger than its actual size, this called the stretching of your text.

Yep, thats the problem.

I deleted the original wordstr textbox, and created a whole new one where I used the text tool and created the textbox the size I wanted, then gave it the var name wordstr, and tested the movie, worked great.

DOH!!! I guess this is what happens when you dont get much sleep…:sleep: As soon as you mentioned it, I found it too. Flash its so picky the littlest things are overlooked…

Well it is picky sometimes, but scaling your clip does of course cause the scaling of the clip, which also effects textboxes as well :wink:

:stuck_out_tongue: I kno… I blame it all on the sleep…4 hrs in the past 3 days sure did it.

Yeah, I know what that is like… trust me, so I understand :slight_smile:

didnt mean to undermine you there ilyaslamasse :wink: but alethos nailed the reasoning. Its also maintains functionality in an onClipEvent(mouseMove) handler (which relates to alethos EDIT addition)

but back to the to the hover captioning(ie tool tip ). This is a method for making this work a little easier for you

concept:
add a constant functionality to all buttons, namely caption display.

Now what this does is adds something which will effect ALL buttons. May not be your cup of tea, but if you have a lot of caprions and a lot of buttons with captions, it could make things easier for you, especially when you dont have to add a specific display caption function call to each button you want to use it. with, not to mention it can be easily changed from one event to another without having to re-position all the ‘show caption’ calls in the new events.

anywho, its achieved by using addProperty to intercept an object (in our case Button) event call and secretly include in it an action to be present in all object calls of the event.

code like so


getROver = function(){
	_root.caption.gotoAndStop(this._name);	
	return this.$onRollOver;
}
setROver = function(func){
	this.$onRollOver = func;
}
getROut = function(){
	_root.caption.gotoAndStop(1);	
	return this.$onRollOut;
}
setROut = function(func){
	this.$onRollOut = func;
}
Button.prototype.addProperty("onRollOver", getROver, setROver);
Button.prototype.addProperty("onRollOut", getROut, setROut);

so what this does is intercepts every onRollOver and onRollOut call any button makes, keeps its actual set function in a function named $onRollOver or $onRollOut respectively and inserts the _root.caption script before returning (and in essence calling) the actual saved/set onRollOver/out scripts. What the caption scipt is doing is simply (on roll over) telling the caption clip in root to goto and stop at a frame with the label of the same name of the button name. If the button doesnt have a name, no frame is derived and it stays put. and (on roll out) telling the clip to return to frame 1 where its blank and has no tool tip.

So with this code installed, all you would have to do is make a caption clip and label frames which coorelate to their respective button instances (frame one clear (or default) of course). For the buttons that dont use it, you dont have to worry about since they do nothing anyway.

But like I said before, you can easily convert these tips to be on a press and release basis by just changing the addProperty lines to use them instead of onRollOver and onRollOut, among other things…

so I thought Id throw that out there. Nice to know even if not in this context…

despite the fact that Im “back” I have to go yet again :\

:slight_smile:

http://www.apocalypseclan.net/wonder/index.htm

Mouseover the names…there dead sexy. Final project.