[QUOTE=ausart;2342044]Hey first part of my problem is describing/finding the right search criteria.
Basically, if this makes sense, I would like to know how a rollover works, lets say a pop up box, according to where it is in the containing miovie. So for instance on a scrolling timeline, how would the rollover know to make the pop up box appear so that it fits correctly in the content area whether its to the far right or the far left. If its a static rollover function I would assume a rollover in the far right corner might end up disappearing off screen. Am I making sense? Apologies for the long winded attempt to describe this.
Second part being, having problems trying to find a tutorial that covers this.
Any help with this would be appreciated.
Cheers[/QUOTE]
The trick is to target the coordinate space in which an object exists.
For example, the coordinate space for a set of buttons within a movieclip container, is different than the coordinate space for the container itself on the stage.
ie: object translations should be scripted relative to the space in which they exist, not relative to the main timeline. (unless of course, the targeted object is on the stage)
Here’s a script that illustrates this to some extent.
example site:[COLOR=“Blue”]http://www.byrographics.com/AS3/popUp/popUp.html[/COLOR]
stop();
import gs.TweenMax;
import fl.motion.easing.*;
import flash.display.StageScaleMode;
import flash.display.StageAlign;
import flash.events.Event;
buttonGroup.mouseEnabled = false;
buttonGroup.buttonMode = true;
buttonGroup.btn1.btnText.text = "popUp 1";
buttonGroup.btn2.btnText.text = "popUp 2";
buttonGroup.btn3.btnText.text = "popUp 3";
TweenMax.to(buttonGroup.popUp, 0, {autoAlpha:0, overwrite:false});
/*
the "popUp" movieclip is contained within the "buttonGroup" container.
"popUp" will therefore share the same coordinate space as other objects within "buttonGroup".
it is then a simple matter to accurately script the position of "popUp" relative to other objects within "buttonGroup".
ie: buttongroup.popUp.y = event.target.y; This will align the vertical center of popUp with the mouse event target.
Notes:
in the actions layer within "buttonGroup" movieclip, mouse events are disabled for "popUp".
in the actions layer within "btn" movieclip, mouse events are disabled for textfield "btnText".
*/
buttonGroup.addEventListener(MouseEvent.CLICK, action, false, 0, true);
buttonGroup.addEventListener(MouseEvent.MOUSE_OVER, action, false, 0, true);
buttonGroup.addEventListener(MouseEvent.MOUSE_OUT, action, false, 0, true);
var button:String = "";
function action(event:MouseEvent):void {
button = event.target.name;
switch (event.type) {
case MouseEvent.MOUSE_OVER :
TweenMax.to(event.target, .2, {scaleX:1.1, scaleY:1.1, dropShadowFilter:{color:0x000000, alpha:0.5, blurX:4, blurY:4, angle:45, distance:4}});
TweenMax.to(buttonGroup.popUp, .4,{autoAlpha:1, y:event.target.y, ease:Exponential.easeOut});
break;
case MouseEvent.MOUSE_OUT :
TweenMax.to(event.target, .2, {scaleX:1, scaleY:1, dropShadowFilter:{color:0x000000, alpha:0, blurX:0, blurY:0, angle:45, distance:0}});
TweenMax.to(buttonGroup.popUp, .4,{delay:.4, autoAlpha:0, y:event.target.y, ease:Exponential.easeOut});
break;
case MouseEvent.CLICK :
TweenMax.to(event.target, .2, {scaleX:1, scaleY:1, dropShadowFilter:{color:0x000000, alpha:0, blurX:0, blurY:0, angle:45, distance:0}});
TweenMax.to(buttonGroup.popUp, .4,{autoAlpha:0, y:event.target.y, ease:Exponential.easeOut});
trace(button);
break;
}
}