- Author had a File in an Envato Bundle
- Author had a Free File of the Month
- Author was Featured
- Bought between 10 and 49 items
- Exclusive Author
- Has been a member for 4-5 years
- Item was Featured
- Referred between 50 and 99 users
Is there a way to determine is a timeline is playing or stopped?
Say I have a SWF being loaded in. In that sub SWF there are several stops on the timeline animation. Is there a way to detect if that sub SWF is playing or if it’s stopped? Without dispatching an event?
- Author had a Free File of the Month
- Microlancer Beta Tester
- Beta Tester
- Contributed a Tutorial to a Tuts+ Site
- Won a Competition
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Item was Featured
- Author was Featured
- Referred between 1 and 9 users
- Author was Featured
- Sold between 50 000 and 100 000 dollars
- Author had a Free File of the Month
- Bought between 1 and 9 items
- Exclusive Author
- Europe
- Has been a member for 3-4 years
- Referred between 10 and 49 users
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Attended a Community Meetup
- Community Moderator
- Has been a member for 5-6 years
- United Kingdom
- Contributed a Tutorial to a Tuts+ Site
- Won a Competition
- Contributed a Blog Post
- Beta Tester
- Bought between 50 and 99 items
why do you not want to use events? You’re otherwise going to have to test a boolean value every frame which is totally uncool…
- Attended a Community Meetup
- Community Moderator
- Has been a member for 5-6 years
- United Kingdom
- Contributed a Tutorial to a Tuts+ Site
- Won a Competition
- Contributed a Blog Post
- Beta Tester
- Bought between 50 and 99 items
MSFX said
why do you not want to use events? You’re otherwise going to have to test a boolean value every frame which is totally uncool…
what am I talking about?! Ignore me.
You could use a callback function which is fired everytime the timeline stops… so something like this should do it… this is also actually far faster than using events too
// loaded swf public var callbackFunction:Function; // la la la stop(); callbackFunction();
//main swf
loadedSwf.callbackFunction = cb;
function cb() {trace("loaded swf stopped"}
- Sold between 100 000 and 250 000 dollars
- Author had a File in an Envato Bundle
- Has been a member for 4-5 years
- Author had a Free File of the Month
- Won a Competition
- Author was Featured
- Item was Featured
- Bought between 10 and 49 items
my guess is he has no control on the loaded swf.
you could monitor frame changes but it would work with timeline based animations only
- Author had a File in an Envato Bundle
- Author had a Free File of the Month
- Author was Featured
- Bought between 10 and 49 items
- Exclusive Author
- Has been a member for 4-5 years
- Item was Featured
- Referred between 50 and 99 users
Turns out FP11 has a new value you can test isPlaying(). It works, but it’s a pain in the A$$ to publish to FP11 and you can’t test it in the IDE flash player. Bummer.
I think I’ll give the kirupa sinoclar method a try.
I don’t want to dispatch an event because in the sub loaded swf is going to have a lot of stops and writing stop() is much easier than dispatch event.
And it’s more universally compatible (or so I’m thinking).
Thank you everyone for your help! This is the smartest, best, Flash community on the planet.
AIR3 .0 – MovieClip.isPlaying
New MovieClip property
A new MovieClip.isPlaying property returns the MovieClip’s current playing state.
