ActiveDen

Detect is a SWF is playing or stopped?

836 posts
  • Has been a member for 3-4 years
  • Won a Competition
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Exclusive Author
  • Sold between 50 000 and 100 000 dollars
  • Elite Author
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
marcfolio says

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?

7 months ago
1448 posts
  • Has been a member for 3-4 years
  • Won a Competition
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Contributed a Tutorial to a Tuts+ Site
  • Community Superstar
  • Beta Tester
  • Exclusive Author
  • Sold between 5 000 and 10 000 dollars
  • Bought between 10 and 49 items
  • United States
  • Referred between 1 and 9 users
DaniMun says

I’m not sure but maybe the Signals would be a viable solution for you :)

7 months ago
1301 posts
  • Has been a member for 2-3 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Author had a Free File of the Month
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 1 and 9 items
  • Croatia
  • Referred between 1 and 9 users
6471 posts
  • Has been a member for 4-5 years
  • Won a Competition
  • Contributed a Tutorial to a Tuts+ Site
  • Contributed a Blog Post
  • Grew a moustache for the Envato Movember competition
  • Community Moderator
  • Beta Tester
  • Exclusive Author
  • Sold between 1 000 and 5 000 dollars
  • Bought between 50 and 99 items
  • United Kingdom
  • Referred between 10 and 49 users
MSFX says

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…

7 months ago
MSFX is a moderator
6471 posts
  • Has been a member for 4-5 years
  • Won a Competition
  • Contributed a Tutorial to a Tuts+ Site
  • Contributed a Blog Post
  • Grew a moustache for the Envato Movember competition
  • Community Moderator
  • Beta Tester
  • Exclusive Author
  • Sold between 1 000 and 5 000 dollars
  • Bought between 50 and 99 items
  • United Kingdom
  • Referred between 10 and 49 users
MSFX says
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"}
7 months ago
MSFX is a moderator
1623 posts
  • Has been a member for 3-4 years
  • Won a Competition
  • Author had a File in an Envato Bundle
  • Interviewed on the Envato Notes blog
  • Author had a Free File of the Month
  • Exclusive Author
  • Sold between 50 000 and 100 000 dollars
  • Bought between 10 and 49 items
  • Italy
  • Referred between 50 and 99 users
bitfade says

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

7 months ago
836 posts
  • Has been a member for 3-4 years
  • Won a Competition
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Exclusive Author
  • Sold between 50 000 and 100 000 dollars
  • Elite Author
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
marcfolio says

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.

7 months ago
1022 posts
  • Has been a member for 3-4 years
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Referred between 10 and 49 users
FlashTang says

AIR3 .0 – MovieClip.isPlaying :)

New MovieClip property
A new MovieClip.isPlaying property returns the MovieClip’s current playing state.

7 months ago
by
by
by
by
by