Jump to content

Get the state of timelines playing or not in Flash AS3


fdoeve

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...