pyspilf
Senior Member
Senior Member
Posts: 133
Joined: Wed Jul 09, 2008 6:35 am
Location: Madrid, Spain
Contact: Send private message

Flash ActionScript 2 Error

Wed Apr 29, 2009 12:03 pm

Guys,

I've been doing lots of reading on this forum about creating custom flash objects for use in ML, and have managed to get a dynamic text containing a value, like for example: _root.MLHSPlugin_]53_value

However, and I thought I understood this would work equally well in ActionScript, I get a syntax error for this statement.

var power = _root.MLHSPlugin_]53_value;

Can anyone understand why? Is is to do with the "]" symbol? Any idea how to get around this?

Thanks a lot!

Sandro
There is a thin line between exposure and visibility...

mcascio

Wed Apr 29, 2009 12:08 pm

I would start there. Try using variables without the bracket and see how things go.

pyspilf
Senior Member
Senior Member
Posts: 133
Joined: Wed Jul 09, 2008 6:35 am
Location: Madrid, Spain
Contact: Send private message

Thu Apr 30, 2009 2:22 am

Mario,

I have tried and I believe the issue is that ActionScript considers the ] symbol as a part of an array delimiter... I have found one workaround but it seems a bit cumbersome:

I assign the MLHS variable that contains the ] character to a dynamic text object, say myText, and then in ActionScript I use myText.text to retrieve the value... it works, BUT it would mean if I need to use 10 of these variables for example, I will need 10 hidden dynamic text objects to get the value. Doesn't seem very efficient, does it?

There must be another way to do this... I was hoping some Flash expert may have some suggestions. Unfortunately, these variables come from HomeSeer and I cannot change the ] character. It is a virtual device identifier assigned by HomeSeer and not available for the user to modify.

I suppose I could also create lots of shadow ML server variables with more ActionScript friendly names by copying all of the ones that come in via MLHS... again, a bit cumbersome.

Cheers

Sandro
There is a thin line between exposure and visibility...

mcascio

Thu Apr 30, 2009 7:02 am

Hi Sandro,

I know this has been an issue for other HS users. I know there is a workaround. I would search this forum and the HS/Mainlobby forum for the answer.

pyspilf
Senior Member
Senior Member
Posts: 133
Joined: Wed Jul 09, 2008 6:35 am
Location: Madrid, Spain
Contact: Send private message

Thu Apr 30, 2009 7:55 am

Mario,

thanks for the suggestion. I searched this forum and could not find anything. I have cross-posted in the HS forum (http://board.homeseer.com/showthread.ph ... post869864) - maybe Krumpy or someone who has had this issue will pick it up

Cheers

Sandro
There is a thin line between exposure and visibility...

mcascio

Thu Apr 30, 2009 8:12 am

If I remember correctly, you would remove the current device using the ], then add another device as a placeholder to take that position. Then re-add your original device, so it uses the next character in HomeSeer's lineup.

pyspilf
Senior Member
Senior Member
Posts: 133
Joined: Wed Jul 09, 2008 6:35 am
Location: Madrid, Spain
Contact: Send private message

Thu Apr 30, 2009 8:20 am

Mario,

I wish I could... I have tons of physical and virtual devices that use [, ], \, etc.... all the most code-unfriendly IDs!!!!! It would take forever to re-assign all the IDs

What a pain. But, apart from this, I am really enjoying ML and HS, and getting good value out of MLHS, so I am happy all the same :-)
There is a thin line between exposure and visibility...

User avatar
Krumpy
Developer
Developer
Posts: 1410
Joined: Thu Sep 04, 2003 11:17 pm
Location: Minneapolis, Mn
Contact: Send private message

Fri May 01, 2009 2:49 am

New beta of MLHSPlugin that now can use device names in addition to x10 house/unit codes.

This will resolve your issue - hopefully - it's beta!

http://board.homeseer.com/showthread.php?t=135709

pyspilf
Senior Member
Senior Member
Posts: 133
Joined: Wed Jul 09, 2008 6:35 am
Location: Madrid, Spain
Contact: Send private message

Fri May 01, 2009 5:59 am

Krumpy, thanks, this is much appreciated!!! I will give it a spin and let you know!

Cheers
There is a thin line between exposure and visibility...

wireless
Senior Member
Senior Member
Posts: 210
Joined: Wed Mar 24, 2004 10:44 am
Location: East Tennessee
Contact: Send private message

Fri May 01, 2009 10:07 am

Can you actually use device names in a command? ex: ToggleDevoce:Foyer Lamp

Doesn't seem to work. MLServer log shows the command but HS doesn't

Return to “MLS files/Buttons/Icons/Backgrounds/SWF/3rd Party Apps/Device Files”

Who is online

Users browsing this forum: No registered users and 1 guest