AS3.0 help
- Started
- Last post
- 7 Responses
- Elfangio
hello,
Yes, i know this isn't a Flash forum, but there are a lot of people here that can help me...
I have a MC with a AfterEffects animation (just to make a point whay I am not using Tween animation here) with 20 frames then I have 5 Frame Labels:
Frame 1 = "start"
Frame 2 = "open"
Frame 10 = "pause"
Frame 11 = "close"
Frame 20 = "end"Then in my class method I want to dispach an Event on currentFramLabel:
private function showToolTip(tip:String):void
{
addChild(tool_tip);
tool_tip.toolText.visible = false;
tool_tip.startDrag(false);
tool_tip.x = mouseX;
tool_tip.y = mouseY - (tool_tip.height - 10);
tool_tip.gotoAndPlay("open");
tool_tip.toolText.text = tip;
trace(tool_tip.currentFrameLabel...if(tool_tip.currentFrameLabel == "pause")
{
tool_tip.toolText.visible = true;
}Not working like this!!! If I trace currentFrameLabel I keep getting the label "open" I never get the pause!!!
Why is this happening!?
Thanks
- FixMiller0
and when do you call the showToolTip function ?
- Elfangio0
I call it from here:
private function gaivotaOver (evt:MouseEvent):void
{
container_mc.removeEventListener... scrollcontainer_mc);
container_mc.gaivota_mc.gotoAndS...
showToolTip("My tip text");}
- FixMiller0
well this part of code:
"
if(tool_tip.currentFrameLabel == "pause")
{
tool_tip.toolText.visible = true;
}"
gets called immediately after "tool_tip.gotoAndPlay("open");"if you want to know when it reaches the end you should add a enterFrame event Listener and have that condition checked every frame. Otherwise it gets checked only once, just after it stated playing.
- Elfangio0
Hey FixMiller, thanks for your help. I am trying to think like you but I am not getting there so easy. What would you put on an EnterFrame event Listener, the showToolTip function, or another function just to check the currentFrameLabel?
- designasaurus0
Are you creating an instance of the tool_tip class before you add it to the stage? var myToolTip:tool_tip = new tool_tip;
BTW: proper class naming should use caps "ToolTip"
- designasaurus0
Make sure to create an "ENTER_FRAME" listener once you add the tool tip that includes the x and y position of the tool tip in the function. When you want the tool tip to go away, make sure to remove it. You don't want to be creating enterframe listeners every time, it will cause bad things to happen. If you need help making the rollover rolloff look be less reactive (sometimes it can happen too fast and be too sensitive) i like to make a checkRollover function and put that in a slower timer, so it checks maybe every 400miliseconds or so, that way there's a slight delay in case they rollover and off really quickly.
- Elfangio0
thanks guys :)
QBN is much better than AS forums...