Sections
You are here: Home Forum Flash controlling quicktime movies in flash using PIR sensor - can anyone please help!!?!

controlling quicktime movies in flash using PIR sensor - can anyone please help!!?!

Up to Flash

controlling quicktime movies in flash using PIR sensor - can anyone please help!!?!

Posted by Joaquim de Brito at April 29. 2008

Complete newbie.

Hoping to control a movie with a sensor in Flash, but I'm having a problem with understanding  how... :(

Have been trying to use the Analogin.fla example as a starting point (the boxtext variable seemed to be the easiest way, using some kind of 'if then' statement.

I have experience of this kind in Director, but the Actionscript is completely throwing me...

Can anyone help please?

Re: controlling quicktime movies in flash using PIR sensor - can anyone please help!!?!

Posted by Liam Staskawicz at April 29. 2008
I think you need to provide more info before people can help you :) Can you describe in more detail your setup, what you've tried, what you expected to happen, and what you observed?

Re: controlling quicktime movies in flash using PIR sensor - can anyone please help!!?!

Posted by Joaquim de Brito at April 29. 2008
Thanks for your reply...you're right, more info is needed, so here goes: I am trying to get a movie in flash to play and pause in response to a PIR sensor. As a starting point, I used the Analogin.fla example file. This works fine, and I am receiving input from the controller. (When off, my sensor gives a reading between 1 and 2, and when on, the reading changes to 1023). My problem is that now I have this input data I don't know how to use it for controlling the movie. I thought that the easiest way to set the controls would be to use an 'if then else' statement, using 'greater than'. I thought that I could use the data from the dynamic text boxes for this. I have used IO boards for this before, but was using Director and a Fischertechnik IO - At that time, I simply used the information in dynamic text box and an 'if then else' statement. I have very little experience of Actionscript and would appreciate some pointers regarding how to use the input values to actually DO something!!! I seem to have drawn a blank... please help!

Re: controlling quicktime movies in flash using PIR sensor - can anyone please help!!?!

Posted by Liam Staskawicz at April 29. 2008
You can create a variable that stores the last value from the sensor, then each time you read the sensor, check to see if that value changed. If it changed, you can trigger whatever you like and then store the value in your variable for next time. if(newValue != oldValue) { doSomething(); oldValue = newValue; }

Re: controlling quicktime movies in flash using PIR sensor - can anyone please help!!?!

Posted by UNISUN at July 29. 2008

Hi Liam,


Could you elaborate with a full actionscript example for a simple analog in controlling an out? A lot of us just want an input value on a sensor to trigger an mcsend output command.

I would love a practical example like that!


Thanks so much!!!!


Previously Liam Staskawicz wrote:

You can create a variable that stores the last value from the sensor, then each time you read the sensor, check to see if that value changed. If it changed, you can trigger whatever you like and then store the value in your variable for next time.

if(newValue != oldValue)
{
doSomething();
oldValue = newValue;
}

Re: controlling quicktime movies in flash using PIR sensor - can anyone please help!!?!

Posted by Liam Staskawicz at July 29. 2008
Hi - I think you can pretty easily modify the existing Analog In example to do this. When you've received a new Analog In value, you can send that right back out to the board with a /servo/0/position 'newvalue' kind of message. I won't be able to write out a full example right now, but will try to include one in a future release of ActionScript code.

Re: controlling quicktime movies in flash using PIR sensor - can anyone please help!!?!

Posted by UNISUN at August 05. 2008

Hi Liam,

I was hoping you would reply to the other thread I started.

I am convincing my clients to buy your products. I think a simple "if analogin/x/ is blah, then mcsend blah" piece of actionscript to make the product do what most people need to would take you about 1 minute to copy/paste here for us all. It would also be immensely appreciated!


Thanks so much in advance!



Re: controlling quicktime movies in flash using PIR sensor - can anyone please help!!?!

Posted by Forrest Maready at September 01. 2008

On the Flash AS3 side of things...

To get decent control over the video, you're going to need to turn it into a .FLV. Also, to be able to manipulate the video player position, you should probably start looking into this blog posting:

http://mrdoob.com/blog/post/504/

http://code.google.com/p/mrdoob/source/browse/trunk/libs/net/hires/utils/display/BitmapDataSequence.as


Let me know if you need any clarification. Hope that gets you started. Go ahead and plan on it being a little tricky. I've been trying to get dynamic control of video (not involving the Make controller).

Powered by Ploneboard
Document Actions