-
1. Re: Animate hotspot position in Flash
Ned Murphy Jan 27, 2011 5:30 AM (in response to Andy Bay)What do you mean when you say "keyframe the hotspot position"? You can use actionscript to move things around (allows for more random positioning) or you can build the changes in position into the timeline (no random positioning).
-
2. Re: Animate hotspot position in Flash
Andy Bay Jan 27, 2011 7:30 AM (in response to Ned Murphy)Sorry not to make myself clear in the beginning. Im pretty new to Flash so I might be asking a stupid question.
What I mean is that if I animate the position of an invisible button with keyframes, will the mouseover events that I need to attach to it still work normally? Or will animating the hotspot position with keyframes require complex actionscript to be written in order for the button functionality to remain?
-
3. Re: Animate hotspot position in Flash
Ned Murphy Jan 27, 2011 7:49 AM (in response to Andy Bay)If you create new keyframe instances, you need to add event listener code for each keyframe instance in the frame where the new instance exists. They can share the same event handler function (put it on a separate layer that extends the length of the timeline). So...
insisbleBtn.addEventListener(MouseEvent.CLICK, clickFunction)
needs to accompany each new instance, but...
function clickFunction(evt.... ){
// do stuff
}
can be shared as long as it is accessible along the timeline, which you can achieve by placing it in the first frame of an actions layer that extends the full length of the timeline.
-
4. Re: Animate hotspot position in Flash
Andy Bay Jan 27, 2011 9:40 AM (in response to Ned Murphy)Thanks for clearing that out!
So is it correct to summarize: for each new keyframe, I need a separate listener. But the "in between" states (between the different x and y positions of two keyframes) will be handled correctly. In other words flash is checking the keyframed position of the hotspot layer first before determining if a mouseover event should take place?
-
5. Re: Animate hotspot position in Flash
Ned Murphy Jan 27, 2011 10:28 AM (in response to Andy Bay)I think you are summarizing the idea fine, though I don't have a clue what flash is doing/checking. If you have an instance with a listener assigned, that listener will stick along the timeline until a new keyframe interupts it.



