AS3 with Phigets problems

Legacy support with Phidget21
Flasher
Fresh meat
Posts: 1
Joined: Mon Mar 19, 2012 6:05 am
Contact:

AS3 with Phigets problems

Postby Flasher » Mon Mar 19, 2012 6:31 am

Hello,
Sorry for the bad English :( , but we try to tell our problem.

We have a school project with Phigets and Flash AS3, but we we have a problem. We hope someone can help us eoth this. The following things must still happen, but we do not understand this.

We want to replace the buttons on the screen for touch sensors. If you touch a sensor the functie have to start. We have a menu where you can browse through. There are 5 touch sensors and 5 LEDs. Each sensor has its own LED, it should turn on when the sensor is touched. We also want a function, which gives you a countdown clock, when you don't touch sensors for 5sec. If didn't touch a sensor within 30sec, you will be send to a black screen.

This is our code of our first screen for so far:
import com.phidgets.*;
import com.phidgets.events.*;
import flash.events.MouseEvent;
import flash.events.KeyboardEvent;

var myIFK:PhidgetInterfaceKit;
phid = new PhidgetInterfaceKit();

myIFK.addEventListener(PhidgetDataEvent.SENSOR_CHANGE, setstarten);

phid.open("localhost", 5001);

function functie1(evt:PhidgetEvent):void{
gotoAndStop ("menu1");
removeEventListener(MouseEvent.CLICK, setstarten);
}

midden.addEventListener(MouseEvent.CLICK, setstarten);
button3.addEventListener(MouseEvent.CLICK, setstarten);
button1.addEventListener(MouseEvent.CLICK, setstarten);
button2.addEventListener(MouseEvent.CLICK, setstarten);
terug.addEventListener(MouseEvent.CLICK, setstarten);

function setstarten(e:MouseEvent) : void {
gotoAndStop ("menu1");
removeEventListener(MouseEvent.CLICK, setstarten);
}

stop()


We hope someone will help us, we will be very grateful!

Return to “ActionScript 3.0 - Flash CS3 / Flex / AIR”

Who is online

Users browsing this forum: No registered users and 2 guests