Jump to content


Photo

Get the state of timelines playing or not in Flash AS3

Flash remote control interactivity AS3

  • Please log in to reply
6 replies to this topic

#1 fdoeve

fdoeve
  • Member
  • PipPipPip
  • 38 posts
  • LocationNetherlands

Posted 17 February 2017 - 01:35 PM

Hey guys!

 

I use Flash a lot to create remote apps to control my watchout shows, using them on windows tablets or android tablets.

I manage to do the basics (starting/stopping stuff) but i'm puzzled how i can get the state of a timeline into flash.

 

I would like to be able to have a button change when a timeline is done playing or maybe get the time info to show next to the button, just to be able to show more information in the app.

Would also be nice to be able to show if the app is still connected to Watchout..

 

I have read the API info, but it's just a bit out of my league for now to understand on my own.

I hope someone can show me how i would be able to get this to work, would be so cool!

 

 

Thanks in advance!

 

Frank Doeve

The Netherlands



#2 Mike Fahl

Mike Fahl

     

  • Dataton Partner
  • PipPipPip
  • 589 posts

Posted 17 February 2017 - 08:44 PM

The Flash (AS3) API is probably the easiest route if you want to build something in Flash/AIR. It's fairly well documented with ASDoc files, assuming you have the complete SDK. Here's the docs:

 

   http://academy.dataton.com/sites/default/files/docs/WATCHMan/AS3/index.html

 

I'm not sure the rest of the SDK it's still available on the web, though, but you may have a copy since before.

 

To work with Aux Timelines, call GetAuxTimeline to get access to the desired timeline, then use the methods on the returned AuxTimeline object to control or obtain info on the aux timeline. There may still be some sample code ont eh academy site that shows how to use thie API from flash.

 

Mike



#3 fdoeve

fdoeve
  • Member
  • PipPipPip
  • 38 posts
  • LocationNetherlands

Posted 18 February 2017 - 07:40 AM

Hi Mike!

Thanks for your answer. Again, I should say, because I just remembered I already asked a similar question a long time ago and then, too you were the one to answer me
I decided to try and pick up where I left off, doing everything the same for the AuxTimelines as I did for the main, but I get nothing back from the auxes... Main works though. So there must be a different approach needed for aux timelines I guess.

#4 fdoeve

fdoeve
  • Member
  • PipPipPip
  • 38 posts
  • LocationNetherlands

Posted 20 February 2017 - 09:38 AM

Here's what i'm trying:

 

the "led" and "led2" are small movieclips of a little led that's red on frame 1-9 and green on frame 10, so i want it to change from red to green when a certain aux timeline is playing.

The part for the main wo works, the movieclip changes when wo is connected or when the main timeline is playing, just nothing happens when i try the same for Aux Timelines...

import com.dataton.watchout.*;
import flash.events.MouseEvent;
import flash.events.KeyboardEvent;
import flash.events.EventDispatcher;
import flash.utils.Timer;
import flash.net.SharedObject;
import flash.display.DisplayObject;


import flash.display.StageDisplayState;




var wo : WATCHMan = new WATCHMan("192.168.2.222");
var auxTL : AuxTimeline = wo.GetAuxTimeline("Theater_PPT");

wo.addEventListener(WATCHMan.KEvt_ConnectedChanged, function(evt : Event) {
 
if (wo.Connected)
led.gotoAndStop(10);
else
led.gotoAndStop(1);
});


auxTL.addEventListener(AuxTimeline.KEvt_PlayingChanged, function(evt : Event) {
  if (auxTL.Playing)
    led2.gotoAndStop(10);
  else
    led2.gotoAndStop(1);
});
 

Anyone have any idea where my approach is wrong?

 

Thanks!



#5 Mike Fahl

Mike Fahl

     

  • Dataton Partner
  • PipPipPip
  • 589 posts

Posted 20 February 2017 - 10:13 PM

It may be necessary to wait for the connect event from the aux timeline before attempting to subscribe to its "playing" status.

 

Mike



#6 fdoeve

fdoeve
  • Member
  • PipPipPip
  • 38 posts
  • LocationNetherlands

Posted 22 February 2017 - 05:32 PM

ok ill try to figure out how to do that the proper way..

 

Thanks Mike!



#7 fdoeve

fdoeve
  • Member
  • PipPipPip
  • 38 posts
  • LocationNetherlands

Posted 23 February 2017 - 11:05 AM

ok, i'm gonna need someone's help...

Is there anyone with AS3 knowledge who could help me out?







Also tagged with one or more of these keywords: Flash, remote control, interactivity, AS3