Can't add a child
I'm trying to use a class from inside another class, but I
cannot make the content of the second class display. My problem is
with the line: square2.addShape(150,150)
How do I add square2 to my display? Please let me know if
this is unclear and I will elaborate.
Thanks for looking at this!
yeas I forgot about that, as I recall , Sprite can not
(directly) be used within hierarchy of DisplayList Objects ..
Lang Ref:
Note (Sprite): While the child argument to the method is
specified as of type DisplayObject, the argument must implement the
IUIComponent interface to be added as a child of a container. All
Flex components implement this interface.
also this :
http://userflex.wordpress.com/2008/06/12/sprite-uicomponent/
Similar Messages
-
HI Can I add a child node to an Element Node with a name that exists
HI,
Can I add a child node to an Element Node with a name that is already existing in the Element Node.
Let me explain what I need exactly.
My Existing element Node looks like this:
<form>
<name>
<FirstName></FirstName>
<LastName></LastName>
</name>
</form>
Can I add another child node with hte name 'FirstName' to the 'name' node ..?
I want to put a attribute rvsn with a value 1 for the original 'FirstName' element Node.
so the new Element Node should look like the foloowing:
<form>
<name>
<FirstName rvsn="1"></FirstName>
<FirstName></FirstName>
<LastName></LastName>
</name>
</form>
Hopefully this is valid XML !!
when I tried to use appendChild, it removed the previous node and put the new one. Thats what is the documentation also said.. I read it after I tried it :(
Anyway, ther should be another way to add a node like that.
Any hints, ideas will be of great help.
-Thanks in advance !!
Murthy// this method will start marking the old values with a revision number.
private void saveNodeDetails (Node node) {
String Content = "";
String nodeName = "";
int rvsn = getRvsn();
int type = node.getNodeType();
int tempRvsn = 0;
String tempNodeName = "";
String tempParentNodeName = "";
Node tempParentNode = null;
// check if element
if (type == Node.ELEMENT_NODE) {
Node traverseNode = node;
nodeName = getNodeName(traverseNode);
if (nodeName != null && nodeName.trim().length() > 1)
nodeName = nodeName.substring(0, nodeName.length() - 1);
if (_debug)
System.out.print("2. ELEMENT_NODE name## " + nodeName);
// if the element has no children, its leaf node.
// if its there in the Hashtble, then update the value from the hashtable.
if (reqParams.containsKey(nodeName)) {
if (_debug) System.out.println("3. Hash Value = " + reqParams.get(nodeName).toString());
if (traverseNode == null)
if (_debug) System.out.println("3A. traverseNode == null ");
if (node == null)
if (_debug) System.out.println("3B. node == null ::(((((");
// get the node children
NodeList children = node.getChildNodes();
// end of getting children for the Node.
if (_debug) System.out.println("4. Got ChildNodes ");
if (children != null) {
int length = 0;
length = children.getLength();
if (_debug) System.out.println("5. Got children Length = " + length);
if( ((Element) node).hasAttribute("rvsn") ){
System.out.println(" node has Attribute(rvsn) ");
tempRvsn = Integer.parseInt( ((Element) node).getAttribute("rvsn") );
if( tempRvsn == rvsn){
// user is changing the same data again and again.
// so remove the text node and append the new value as text node finally
for (int index = 0; index < length; index++) {
if (_debug) System.out.println("6. index = " + index);
if (_debug) System.out.println(index + ": children.item( index )@saveNodeDetails@ContainerDoc = " + children.item(index).getNodeType() + " -- " + children.item(index).getNodeValue());
if (children.item(index).getNodeType() == Node.TEXT_NODE)
node.removeChild(children.item(index));
}else{
int l= 0; // do not do any thing if the current node rvsn is different from the rvsn of the DOM
// programme logic could enter this part when ther are multiple revisions of the NODe in the DOM,
// and we are traversing through the previous versions of it.
} else{
System.out.println(" node has no Attribute(rvsn) ");
// the node has no rvsn attribute.
// it is the initial version of the dom.
// add the rvsn from the DOM to this NODE for the first time.
((Element) node).setAttribute("rvsn", (new Integer(rvsn)).toString() );
// get parent node and add a new child node with the same name as current node.
// so parent node will have the previous node with a rvsn and a new node without the rvsn !!
tempNodeName = node.getNodeName();
tempParentNode = node.getParentNode();
tempParentNodeName = tempParentNode.getNodeName();
System.out.println(" adding node: " + tempNodeName + " to : " + tempParentNodeName);
node = addNode(tempParentNode, tempNodeName, "");
getNodeName(node); // print the name of the node after modifying it !!!
printSiblings(node);
//System.out.println(" After adding the node : " + getNodeName(node));
} else if (_debug) {
System.out.println("7. Node name exist in the Hash but has no children to be removed..!!:: @saveNodeDetails ");
if (_debug) System.out.println("7B. Update the dom from the hash value " + nodeName + ", " + reqParams.get(nodeName).toString());
node.appendChild(document.createTextNode(reqParams.get(nodeName).toString()));
if (node != null) {
if ( ( (Element) node).hasAttribute("rvw"))
( (Element) node).removeAttribute("rvw");
if ( ( (Element) node).hasAttribute("msg"))
( (Element) node).removeAttribute("msg");
if ( ( (Element) node).hasAttribute("dor"))
( (Element) node).removeAttribute("dor");
}// end of if (type == Node.ELEMENT_NODE)
NodeList children = node.getChildNodes();
if (children != null) {
for (int i = 0; i < children.getLength(); i++) {
saveNodeDetails(children.item(i));
} // end of saveNodeDetails method
public Node addNode(Node parentNode, String nodeName, String value){
Node newNode = null;
try{
newNode = parentNode.appendChild( document.createElement(nodeName) );
newNode.appendChild( document.createTextNode( value ) );
}catch(Exception Ex){
System.out.println("2. Exception@addNode@ContainerDoc = " + Ex);
return newNode ;
} // end of addNode method -
Can't add second child to StackPane repeatedly
Hi,
I have a StackPane array, which is filled up with two ImageViews. First ImageView is an unique picture, second ImageView is the same for every StackPane:
StackPane[] cards = new StackPane[gisView.length];
for (int i = 0; i < cards.length; i++) {
cards[i] = new StackPane();
System.out.println(cards.getChildren().add(gisView[i]));
System.out.println(cards[i].getChildren().add(topCard));
System.out.println(cards[i].isManaged());
System.out.println(cards[i].getChildren());
The problem is, that the second ImageView - topCard, is added only to first/last StackPane even I added it to every StackPane in cards.
- both add() methods return true, as well as isManaged() method.
- addAll(E...) doesn't work either even it returns true too.
- I checked the errorProperty for every Image and there's no problem with loading the images.
- both ImageViews do get added to StackPane inside the for loop, but there's only one ImageView in StackPane outside the for loop.
I hope it's some trivial issue that I just can't spot.
Edited by: user10869786 on May 24, 2012 6:10 AMA node can only be the child of one node at a time.
-
I'm trying to add another child to my contact info and can't find the place to do it. Went to add field but there wasn't any choice for adding another person. This is my first Apple product and I must say I'm not very impressed.
Hey Memeyork,
Within the Contacts app, you would want to press the + sign at the top right to add a new contact. Here are some other ways you can add contacts to your iPhone:
iPhone - Add contacts
http://help.apple.com/iphone/7/#/iph14a87326
Have a good one,
Delgadoh -
AS3.0: Can't add child and access subchildren timelines?
I have the following code:
var myParent:Parent = new Parent();
var mySymbol_01:Symbol01 = new Symbol01();
var mySymbol_02:Symbol02 = new Symbol02();
myParent.x=100;
myParent.y=100;
addChild(myParent);
myParent.gotoAndStop(1);
button.addEventListener(MouseEvent.CLICK, buttonPressed);
function buttonPressed(e:Event):void{
removeChild(myParent);
playCopy();
function playCopy():void{
addChild(myParent);
myParent.gotoAndPlay(2);
myParent.x=100;
myParent.y=100;
//myParent.rects.width=200;
//myParent.circ.width=300;
If I take
//myParent.rects.width=200;
//myParent.circ.width=300;
and remove the comments, the file breaks and no Movie Clips appear on the stage. Does this have to do with casting the Children as Movie Clips, which I may not have done here?No error codes Ned, it just adds the Child at the last frame in the timeline which happens to be frame 60 (I have a
n animation in the y direction just for kicks to see if I can get the animation to play and have the object move down
ward vertically but it just "pops" into place without any animation.
And no, it's not a sound animation. -
Can't add a family member to family share on icloud?
I Successfully added one child to family share but when I went to add second child it gets hung up on the screen where you type family members email. I type it in or select child's name from my list of contacts and then select NEXT. Nothing Happens. the blue letters of next fade to the light blue then the circle thing spins and the NEXT pops back up in blue and nothing happens. Can someone please help me figure out why I can't add a second child. Yes, they have an icloud account, I turned phone off and back on. Not sure what the problem is.
See if you can go to your Calendars App and select a previous event to see what Calendar the event was added to (iCloud or Yahoo). After that is determined you can go to www.iCloud.com or calendar.yahoo.com and add the event there to see if it will populate on your device. Another troubleshooting step is deleting the iCloud account from your device and also deleting the Yahoo account. Then check to see if you can add an event without it syncing to a email. If you can then it may have just been a bug and you can add both accounts back and try adding the event again. I would also recommend only using one service to sync your Contacts, Calendars, Reminders, etc. Such as either iCloud only or Yahoo only, as using multiple accounts means your data is spread around and can be hard to isolate when something goes wrong.
-
How can I add additional submenu items to Spry Menu Bar?
The drop down header only allows for for 2 submenus - ie. child and grandchild pages
How can I add a third or fourth submenu - ie great grandchild and great great grandchild pages?Its OK! I've just found an answer:
http://forums.adobe.com/message/1049136#1049136
PS. I did searching before I posted - but I didn't spot this till afterward -
JS -- XML Question - Can I add attributes using Javascript?
I want to add an attribute to an element tag, but I don't see how to do it programmatically. Is it possible? Also, is there a way to name an element tag dynamically? For example:
The way to add a child element is to either use the appendChild method like this:
XMLObject.appendChild(<childElement/>);
XMLObject.childElement= "something";
or just add it like this:
XMLObject.childElement = "something";
Right? (Side Question: Is there a difference between these two methods?).
What I want to do is to either add a dynamic attribute to a statically named child, or to create a dynamically named child.
I haven't been able to figure this out myself. Any ideas?Maybe have a look at Mozilla's E4X tutorial: https://developer.mozilla.org/en/E4X_Tutorial/
There's no need for eval() here. (There usually isn't.) Use:
XMLObject.appendChild(<{nameReference}/>);
To add an attribute, you can just use:
XMLObject.@new_att = "the value";
Jeff -
How Can I add a object to the scene Graph ??
Hi all!
I have set up a 3d scene Graph. Now I want to add a object (for example,a cone) to the scene Graph. How can I do ???
thanks in advance!Hi,
if you want to add your cone to a branchgroup "mainbranchgroup", you have to set mainbranchgroup.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE) while creating this branchgroup (and before compiling the scene).
Then, when you want to add the cone, you just have to add a child to the mainbranchgroup.
I hope that helps. -
Can i assign a child state to a movie clip that is already placed on stage
Hello
Is it possible to add a child state to a movie clip that is
already placed on stage,
i need to do this so i can move the movieclip to the top of
the display list.
thanks for the help
mt"The objects i want it to appear above are loaded swf's onto
the same main stage."
Aha, this is where things can get confusing. The terminology
between the Flash Authoring tool and ActionScript is not
consistent.
In ActionScript, the Stage is the top most DisplayObject. You
probably get that.
In Flash, the canvas that is often referred to as "the stage"
is not the Stage object of ActionScript, rather the Flash stage is
a DisplayObject class called MainTimeline (or if you assign a
document class, it's that class), which is the first and only child
of the ActionScript Stage object. It's the only child unless, of
course, you add something else to the ActionScript Stage object at
runtime... like a loaded swf. ;)
So in other words, if you are doing anything like this:
stage.addChild(myLoadedSWF)
You are actually putting myLoadedSWF above the MainTimeline
object, which is the entire Flash timeline. There's nothing wrong
with that, but in this case it means changing the depth of things
inside the MainTimeline is not going to change the fact that the
MainTimeline itself is below myLoadedSWF.
Most likely the simplest solution is to add your loaded SWFs
to the property "root", not stage. root can refer to different
things in different places, but most of the time it refers to the
MainTimeline, and if I had to guess I would say it almost certainly
does in your case. Note that the "root" property is typed as a
DisplayObject, not a DisplayObjectContainer, so addChild (which is
a DisplayObjectContainer method) will not be recognized unless you
typecast to DisplayObjectContainer or a subclass of
DisplayObjectContainer, like Sprite or MovieClip:
MovieClip(root).addChild(myLoadedSWF)
Also note that, unlike AS2, in AS3 it's very easy to simply
add your loaded SWF below existing objects you create in Flash. You
can use addChildAt(obj,0) for instance to add it to the very
bottom. -
Can't add friends in Game Center
HI! Our doughter has iPod touch 5th gen. She has a child Apple ID account which we used to sing in to Game Center. She can use multiplayer option but can't add friends from her contacts. When we go to friends button she gets message: allow iCloud contacts in settings. In restrictions adding friends is allowed and on iCloud contacts are on. Tryed to turn off the iPod several times. Please help!
I've just realised that before getting your reply, but thanks for the confirmation!
It's strange how all these people on Facebook say "add me!" but they don't give you their Game Center name and so you can't add them! -
Can i monitor my childs messages on my own device
Can I monitor my childs messages on my own device?
If you go to settings, messages, send and receive than choose add email. Add an email for your kid and only active this email with iMessage on there device. Then go into there restrictions under settings, general and Choose accounts and lock it out. After go on to your device and active the same email on yours under messages. You will also have to choose your device for txt message forwarding from there device so you can receive those silly green txt too. As long as you have there restrictions set up right they can't tamper with it. I use to run something similar at one point.
-
i need to add bpm to my songs but in some of them i just can't add/modify any info. it seems like it happens only with the verified songs (the ones i download from souncloud work for example) probably verified trough gracenote..is there anything i can do?
this is what happens when i try to add/modify the infos and it doesn't work, i'm even unable to click in the spaces
thanks for your attention,sorry for the bad englishRight-click on your main iTunes folder and click Properties, then go to the Security tab and click Advanced. If necessary grant your account and system full control to this folder, subfolders and files, then tick the option to replace permissions on child objects which will repair permissions throughout the library. This is the XP dialog but Windows 7 shouldn't be too different.
tt2 -
Load Rule (Dimension Build) using "Add as Child of"
I have a dimension file that contains Level0 Members, Aliases and Agg Signs. When I use the Build Method of "Add as Child Of", I appears that I cannot add the Alias in the same Load rule. On the first field, I select the Dimension with no Field Type or Number. On the next field, I select Alias and the Dimension, however, when I put a level number of 0, the load rule does not verify and if I try to leave the Number blank then I I get an error the error message of "You must specify a valid number for this field type".How do you add aliases, properties, etc when using the Dimension build with the build method of "Add as child of" in the same load rule? I cannot find anything in the DBAG.Thanks.....
As your post seems to indicate, there is no way to do it in one pass. There are a few things that you can't do the way you should be able to - like, say updating two alias tables at once... Regards,Jade------------------------------------Jade ColeSenior Business Intelligence ConsultantClarity [email protected]
-
How can I add more than one same spry menu (eg. collapsible menu) with in different styles (font size, color, background, etc) on current page?
Hi Nancy,
This screenshot was only for imagination. A part of the code (not all) is below. In the code there are some background images but they are not seem in live mode.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="css/my_site.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css"/>
<link href="SpryAssets/SpryCollapsiblePanel.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<script src="SpryAssets/SpryCollapsiblePanel.js" type="text/javascript"></script>
<style>
#CollapsiblePanel1 .CollapsiblePanelOpen .CollapsiblePanelTab {
background-color: #003366;
font-size: 18px;
line-height: 52px;
color: #FFF;
#CollapsiblePanel1 .CollapsiblePanelTabHover .CollapsiblePanelTab {
background-color: #003366;
color: #FFF;
text-shadow: 1px 1px #000;
font-weight: bold;
line-height: 52px;
#CollapsiblePanel1 .CollapsiblePanelClosed .CollapsiblePanelTab {
background-color: #C3CFDF;
border-radius: 5px 5px 0px 0px;
color: #999
text-shadow: 1px 1px #000;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 18px;
font-weight: bold;
line-height: 52px;
#CollapsiblePanel2 .CollapsiblePanelOpen .CollapsiblePanelTab {
background-image: url(images/international.jpg);
background-repeat: no-repeat;
font-size: 18px;
line-height: 52px;
color: #FFF;
#CollapsiblePanel2 .CollapsiblePanelTabHover .CollapsiblePanelTab {
background-color: #003366;
color: #FFF;
text-shadow: 1px 1px #000;
font-weight: bold;
background-image: url(images/TR_Col-WEB.png);
background-repeat: no-repeat;
line-height: 52px;
#CollapsiblePanel2 .CollapsiblePanelClosed .CollapsiblePanelTab {
background-color: #C3CFDF;
border-radius: 5px 5px 0px 0px;
color: #999
text-shadow: 1px 1px #000;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 18px;
font-weight: bold;
background-image: url(images/TR_Gray2-WEB.png);
background-repeat: no-repeat;
line-height: 52px;
#CollapsiblePanel2 .CollapsiblePanelContent {
background-color: blue;
#CollapsiblePanel3 .CollapsiblePanelOpen .CollapsiblePanelTab {
background-image: url(images/TR_Col-WEB.png);
background-repeat: no-repeat;
font-size: 18px;
line-height: 52px;
color: #FFF;
#CollapsiblePanel3 .CollapsiblePanelTabHover .CollapsiblePanelTab {
background-color: #003366;
color: #FFF;
text-shadow: 1px 1px #000;
font-weight: bold;
background-image: url(images/TR_Col-WEB.png);
background-repeat: no-repeat;
line-height: 52px;
#CollapsiblePanel3 .CollapsiblePanelClosed .CollapsiblePanelTab {
background-color: #C3CFDF;
border-radius: 5px 5px 0px 0px;
color: #999
text-shadow: 1px 1px #000;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 18px;
font-weight: bold;
background-image: url(images/TR_Gray2-WEB.png);
background-repeat: no-repeat;
line-height: 52px;
#CollapsiblePanel4 .CollapsiblePanelOpen .CollapsiblePanelTab {
background-image: url(images/TR_Col-WEB.png);
background-repeat: no-repeat;
font-size: 18px;
line-height: 52px;
color: #FFF;
#CollapsiblePanel4 .CollapsiblePanelTabHover .CollapsiblePanelTab {
background-color: #003366;
color: #FFF;
text-shadow: 1px 1px #000;
font-weight: bold;
background-image: url(images/TR_Col-WEB.png);
background-repeat: no-repeat;
line-height: 52px;
#CollapsiblePanel4 .CollapsiblePanelClosed .CollapsiblePanelTab {
background-color: #C3CFDF;
border-radius: 5px 5px 0px 0px;
color: #999
text-shadow: 1px 1px #000;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 18px;
font-weight: bold;
background-image: url(images/TR_Gray2-WEB.png);
background-repeat: no-repeat;
line-height: 52px;
#CollapsiblePanel5 .CollapsiblePanelOpen .CollapsiblePanelTab {
background-image: url(images/TR_Col-WEB.png);
background-repeat: no-repeat;
font-size: 18px;
line-height: 52px;
color: #FFF;
#CollapsiblePanel5 .CollapsiblePanelTabHover .CollapsiblePanelTab {
background-color: #003366;
color: #FFF;
text-shadow: 1px 1px #000;
font-weight: bold;
background-image: url(images/TR_Col-WEB.png);
background-repeat: no-repeat;
line-height: 52px;
#CollapsiblePanel5 .CollapsiblePanelClosed .CollapsiblePanelTab {
background-color: #C3CFDF;
border-radius: 5px 5px 0px 0px;
color: #999
text-shadow: 1px 1px #000;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 18px;
font-weight: bold;
background-image: url(images/TR_Gray2-WEB.png);
background-repeat: no-repeat;
line-height: 52px;
</style>
Maybe you are looking for
-
Airport Express as ethernet - Airport bridge
I just bought an Express thinking it would be easy to configure to bridge my existing DSL -> wifi connection to a new wireless LAN. Before I open the box I would like to know for sure that this will work. If the Express can't do this, I'll order a Li
-
My macbook pro is very very slowly
I've got a problem here with my MACBOOK PRO MA896,it took about 10 mins to start up the newly-built system and it only manifests the sound effect without the welcome scene ,plus,drive-division operation is needed evey time the system is rebuilt and i
-
Can't create new files in curlftpfs mounted directory
Hi All. I'm trying to mount an FTP directory locally so I can use it as a local directory. I have this in my fstab: curlftpfs#USERNAME:[email protected] /media/ftp fuse rw,allow_other,proxy=,uid=500,user 0 0 now, here's the weird thing. I can edit fi
-
Oracle Service Bus 11g (11.1.1.3.0) failing to start
I have installed Oracle Weblogic 10.3.3 (11g with Patch Set2) on a Windows XP SP2 32-bit machine. I was able to configure and start the AdminServer without any issues. Next, I installed Oracle Service Bus 11g (11.1.1.3.0) on top of WLS 10.3.3 (11g) o
-
Looking for a third party 'job system/job scheduler'
Hello, We have tried using OEM Job and now want to also look at third party Job Scheduling applications. Please advice of such other products. Was thinking of AppWorks. Thank you.