Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 2nd, 2012, 12:26 PM
storemike storemike is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 158 storemike User rank is Lance Corporal (50 - 100 Reputation Level)storemike User rank is Lance Corporal (50 - 100 Reputation Level)storemike User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 10 h 15 sec
Reputation Power: 10
ActionScript 3 - Set javascript var when playing or stopped/paused

Hello,

I'm using SWFObject 2.2 and neeed to set a javascript variable when the swf is playing or stopped/paused, but can't find how to do that.

I looked into using callbackFn and ExternalInterface.addCallback, as well as the SWFObject docs.

I'm trying to avoid having to create a function with a timeout or interval that checks the swf's isPlaying status. Is there a feature/function in Flash like whilePlaying or onTime, onStop, etc. that I can leverage? I couldn't find anything in the SWFObject docs, bit I could have just missed it.

Unfortunately, I don't have access to the flash source, otherwise the options may be different.

Thank you. This is the final thing I need to finish a new feature.

Sincerely,
Mike

Reply With Quote
  #2  
Old April 4th, 2012, 05:07 AM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 6,663 Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)  Folding Points: 14767 Folding Title: Novice Folder
Time spent in forums: 1 Month 1 Week 3 Days 20 h 10 m
Reputation Power: 3163
Facebook MySpace
Hi, whilst there are some more JS functions there is nothing that will help you besides as you said, polling the isPlaying property.

Since you don't have access to the source, maybe you can cheat and make a wrapper around your original swf. So you could have another swf file that loads in your original. The wrapper could inspect the child (original) clip and see what its current play state is and then call your JS function via ExternalInterface. You will simply be moving the polling from JS<->SWF to be SWF<->SWF but it will probably give you a more accurate play/stop state change.
__________________
Quis custodiet ipsos custodes?

Reply With Quote
  #3  
Old April 4th, 2012, 08:18 AM
storemike storemike is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 158 storemike User rank is Lance Corporal (50 - 100 Reputation Level)storemike User rank is Lance Corporal (50 - 100 Reputation Level)storemike User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 10 h 15 sec
Reputation Power: 10
thanks, Tann San. That's what I was afraid of. As it turns out, the Flash objects I need to monitor are apparently single frame, so isPlaying is always returning false.

Thanks again.

Reply With Quote
  #4  
Old April 4th, 2012, 11:31 AM
Tann San Tann San is offline
Gotta get to the next screen..
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 6,663 Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)Tann San User rank is General 33rd Grade (Above 100000 Reputation Level)  Folding Points: 14767 Folding Title: Novice Folder
Time spent in forums: 1 Month 1 Week 3 Days 20 h 10 m
Reputation Power: 3163
Facebook MySpace
Well using the wrapper method you might be able to read variables from the original file. I'd say the simplest thing to try out is create a new FLA, create a Loader instance that loads in your original swf file. Then do a debug run on that and see what variables/events you can read from it.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > ActionScript 3 - Set javascript var when playing or stopped/paused

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap