PDA

View Full Version : [AS3] How to programatically add tree to stage?


pixelmech
01-08-2009, 08:14 PM
I'm trying to programatically add the YDN Tree to the stage via my document class. I'm clearly doing something wrong but I be stumped. This is what I am trying:

package {
import flash.display.MovieClip;
import com.yahoo.astra.fl.controls.List;
import com.yahoo.astra.fl.controls.treeClasses.*;
import com.yahoo.astra.fl.controls.Tree;

public class Main extends MovieClip {

public function Main() {

var myTree = new Tree();
this.addChild(myTree);

}

}
}

I'm getting the errors

1017: The definition of base class List was not found.

and a bunch more like

1020: Method marked override must override another method.

I assume this is because List isn't found - and it doesn't appear to be in the Astra package I downloaded (http://developer.yahoo.com/flash/astra-flash/) - looking in the controls directory, it isn't there. Is this something I can import via flash instead?

CyanBlue
01-08-2009, 08:34 PM
Howdy and Welcome... :)

Why are you importing the List class??? I don't think that class even exists... Comment out that line and see if you are getting it further...

Here is the YDN page for the Astra Tree component...
http://developer.yahoo.com/flash/astra-flash/tree/

Oh, I moved this thread to the Components forum... Please find the most appropriate forum and post your question... ;)

pixelmech
01-08-2009, 08:37 PM
Hello, and thanks - didn't see the component forum :o

I was only trying to import the List class, because without it I get:

1017: The definition of base class List was not found.

And this error is actually pointing to line 37 in the Tree class, not in my Main document class... so I assumed it needed to be imported, but I agree - there doesn't seem to be one. Thus my confusion...:confused:

(Also I am aware of the YDN page, I've been using the examples in the last couple days playing around with their stuff.)

CyanBlue
01-08-2009, 08:43 PM
Well... Let me ask you this way... Do you have the List.as file existing in the com/yahoo/astra/fl/controls directory???

pixelmech
01-08-2009, 08:54 PM
Nope - so I realize it's going to bust anyway... I'm just confused on why Tree is referencing it, or wondering if I am doing something else wrong, or dowloaded the wrong package? (I downloaded the lastest one)