onAttach event never triggered - Servo-full

Legacy support with Phidget21
User avatar
Patrick
Lead Developer
Posts: 3078
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: onAttach event never triggered - Servo-full

Postby Patrick » Wed Mar 18, 2009 12:36 pm

Hi,

It's a problem with the flash library on our end. We'll have an update out later today - sorry about that.

-Patrick

samcreate

Re: onAttach event never triggered - Servo-full

Postby samcreate » Wed Mar 18, 2009 1:01 pm

Awesome, Thanks so much for looking into it. Can you post a message here when the said library is updated?

Thanks!

User avatar
Patrick
Lead Developer
Posts: 3078
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: onAttach event never triggered - Servo-full

Postby Patrick » Wed Mar 18, 2009 1:37 pm

It's updated.

piolo96

Re: onAttach event never triggered - Servo-full

Postby piolo96 » Tue Apr 28, 2009 11:10 am

Hi, like samcreate, I am having problems with the PhidgetAdvancedServo, mainly because when I type:

var advancedServoPhidget:PhidgetAdvancedServo;
advancedServoPhidget = new PhidgetAdvancedServo();

I get the following error
1046: Type was not found or was not a compile-time constant: PhidgetAdvancedServo.

Yes I have the PhidgetAdvancedServo 8-Motor. and what do you mean by I need to enable the servo before I can use it?

Is there anyone that could help me with this? I tried to contact the support email of phidgets but no solution.

thank you

User avatar
Patrick
Lead Developer
Posts: 3078
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: onAttach event never triggered - Servo-full

Postby Patrick » Tue Apr 28, 2009 11:33 am

Are you importing com.phidget.* and adding the com folder to your project directory?

-Patrick

piolo96

Re: onAttach event never triggered - Servo-full

Postby piolo96 » Tue Apr 28, 2009 12:05 pm

Yes I am doing everything you just mentioned. I am currently working in Flash.

This is my code for InterfaceKit and it works properly:

import com.phidgets.*;
import com.phidgets.events.*;

configUI();

function configUI():void {
trace("configUI");

var phid:PhidgetInterfaceKit = new PhidgetInterfaceKit();
phid.addEventListener(PhidgetEvent.CONNECT, onPhidgetConnect);
phid.addEventListener(PhidgetEvent.ATTACH, onPhidgetAttach);
phid.addEventListener(PhidgetDataEvent.SENSOR_CHANGE, onPhidgetSensorChange);
phid.open("localhost", 5001);
}

function onPhidgetConnect(p_event:PhidgetEvent):void {
trace(p_event);
}

function onPhidgetAttach(p_event:PhidgetEvent):void {
trace(p_event);
}

function onPhidgetSensorChange(p_event:PhidgetEvent):void {
trace(p_event);
}


and this is my Output Panel
configUI
[ Phidget Event: connect ]
[ Phidget Event: attach ]
[ Phidget Data Event: sensorChange 6 to 448 ]
[ Phidget Data Event: sensorChange 6 to 433 ]


This is my code for the PhidgetAdvancedServo:

import com.phidgets.*;
import com.phidgets.events.*;

configUI();

function configUI():void {
trace("configUI");

var phid:PhidgetAdvancedServo = new PhidgetAdvancedServo();
phid.addEventListener(PhidgetEvent.CONNECT, onPhidgetConnect);
phid.addEventListener(PhidgetEvent.ATTACH, onPhidgetAttach);
phid.open("localhost", 5001);
}

function onPhidgetConnect(p_event:PhidgetEvent):void {
trace(p_event);
}

function onPhidgetAttach(p_event:PhidgetEvent):void {
trace(p_event);
}

and this is my compiled errors:
1046: Type was not found or was not a compile-time constant: PhidgetAdvancedServo.
1180: Call to a possibly undefined method PhidgetAdvancedServo.


thank you for all the help

piolo96

Re: onAttach event never triggered - Servo-full

Postby piolo96 » Tue Apr 28, 2009 1:29 pm

Turns out your swc library was incomplete. I was working with Flex the whole time and when I downloaded the source for Flex I never found a com folder. I only found a "Phidget21Library.swc" and it worked for me until I had to work with the PhidgetAdvancedServo, I could not find the class in it. I downloaded the files for Flash, specifically "Flash_2.1.6.20090417.zip" and this one contained the com folder and now I have all classes with source. You guys should update both, (com source and swc libraries) for people not to get confused.

thanks for all the help.

User avatar
Patrick
Lead Developer
Posts: 3078
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: onAttach event never triggered - Servo-full

Postby Patrick » Tue Apr 28, 2009 3:39 pm

Ah, I see the problem.. thanks for pointing this out, I will fix it.

-Patrick


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

Who is online

Users browsing this forum: No registered users and 1 guest