Jump to content
Search Community

GoTo - supressEvents?

rodoneill test
Moderator Tag

Recommended Posts

I've already figured my problem out, but I'd just like this question answered - I have a timelinemax instance that consists of just addCallbacks(), I was getting stumped why it wouldn't playback correctly when I called timelinemax.gotoAndPlay(1) - until I realised the default paramater 'supressEvents' is true, setting this to false solved my problem. However, if I set suppressEvents to true, and call restart() or gotoAndPlay(0), only the first addCallback() is suppressed, all others play fine - is this a bug?

 

My other question would be, what's the reason for setting suppressEvents to true by default?

 

Thanks :D

Link to comment
Share on other sites

However, if I set suppressEvents to true, and call restart() or gotoAndPlay(0), only the first addCallback() is suppressed, all others play fine - is this a bug?

 

I think you might be misunderstanding the whole "suppressEvents" thing. Think of the timeline like a record player. As it plays, the needle travels across it, but if you want to skip to another portion of the timeline, you can either pick the needle up and drop it into its new position (suppressEvents = true) or drag the needle there (suppressEvents = false). Dragging it there would cause it to fire all the events/callbacks between the old and new position. If you still think it's not functioning as it's supposed to, please post an example FLA that demonstrates the issue.

 

My other question would be, what's the reason for setting suppressEvents to true by default?

 

Because it's much more intuitive. It's also the way MovieClip timelines function in Flash. For example, let's say you've got a MovieClip that has labels at various spots and each label has ActionScripts on keyframes, etc. Then let's suppose you're on frame 1 and you gotoAndStop(100) - you normally wouldn't want Flash to execute all the actions inbetween - you'd want it to just go to frame 100 and start from there. Originally I didn't even offer the option of suppressing events (in early beta versions) but it quickly became obvious that it would be an important feature to add.

 

if I have an addCallback in my timeline at 3 seconds, and I call restart(false, false) or gotoAndPlay( (anything less than 3), false ) - the addCallback at 3 seconds gets called immediately and then again at it's correct time...?

 

Again, I think this question came from you misunderstanding the suppressEvents thing. When you suppress events, it's just for that one move as it picks the virtual playhead up and puts it in the new position - it does NOT permanently suppress all events forever after on that timeline.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...