status.text = this.data.data.@name as String;
if ( status.text == "Maximizer CRM" as String)
{ var vnode:IVisualNode=graph.nodeByStringId("2").vnode;
vnode.data.@nodeColor = 0xff0d00;
}
doesnt work either! :(
On Dec 12, 6:01 am, Jane <minute_of_de...@web.de> wrote:
> This could help:http://groups.google.com/group/flexvizgraphlib/browse_thread/thread/2...
What doesn't work exactly? Can you get into the if-condition?
If not try it like in my example...your code don't look like example
above.
It works pretty fine for me...and I think it can work pretty fine for
you too.
If you give the me more code of yours, I might help you with this
issue.
By the way: The Link I posted works as well...but I don't know how to
get the vnodes without saying the StringId.
The If condition always worked. The problem I am facing is the same as
you do. I would want to compare a string (status.text or
combobox.selecteditem) with a node name or node description. If it
matches, then the node should change its color. So far I am not able
to match the selecteditem with the node name and I instead use a text
and then try to update the color of the node ( which I am not able to
do again).
Hence, I am facing 2 issues here.
1.Comparing the selecteditem with a node name
2. Updating the color of the node.
I think we both are facing similar issues.
In the previous post I sent, I tried comparing the selecteditem
( which is stored in a variable status.text) with a text and it would
enter the if condition. Then I tried getting the node , var
vnode:IVisualNode=graph.nodeByStringId("2").vnode , having the name
"Maximizer CRM" to update its color. Now thats the part that did not
work. Though comparing the selecteditem with a text is not an
efficient way as I am hard coding the name and is a manual way of
doing it leading to many if conditions, I was trying to check if the
way I mentioned would update the node color.
I hope it is more clearer now.
Thank you.
Sharada
I've fixed the problem almost.
my Code for issue 1:
private function changeUser():void{
//TODO: delete previous selection
for(var j:int = 0; j < user.length; j++)
{ //
user names I have, stored in array
if((String(createdBy.selectedItem)) == user[j])
{ //
select one user name
for (var i:int = 0; i < ids.length; i++)
{ //
all nodes I have
if (createdByUser[i] == (String(createdBy.selectedItem)))
{ //if selected user name == username in node
var vnode:IVisualNode = vgraph.graph.nodeById(ids
[i]).vnode; // get this node
vnode.changeColor
(0xFFFFFF); //
change color of node
}
}
}
}
}
for issue 2: I already posted a link, which deals with that problem.
And could solve my problem in this way. But I don't know if you have
the same settings...
Thanks for the help. Issue 1 seems to be resolved with your
suggestion. Issue 2, I will see what works out as the structure of my
project seems different.
Regards,
Sharada
Regarding the second issue, changeName() , I think, is part of
IVisualNode.as file. So I created a file and added a function
changeColor() to it. Is that what it means?
Thank you.
Best regards
Sharada