Questions about AS2 Tree Component (Flash CS3)

I have Flash application with a Tree component on the Stage. I'm using an XML file to create the structure of the Tree component.
Each entry on my XML has the attributes id, label, heading, desc, and icon.
My problem is that I can't seem to be able to set the Tree to default with the first node open.
My code is:
var xmlTreeData:XML = new XML();
xmlTreeData.onLoad = function() {
mTree.dataProvider = this.firstChild;
xmlTreeData.ignoreWhite = true;
xmlTreeData.load("xml/treeValues1.xml");
mTree.setStyle("fontSize","11");
mTree.setStyle("selectionColor","0xE0E0E0");
mTree.setStyle("useRollOver",false);
mTree.setIsOpen(mTree.getTreeNodeAt(0), true);
My tree populates fine, and the handler I retrieve whatever item is clicked works great. However, the tree refuses to default to having that first node open.
I'm also interested in placing custom icons into certain nodes via the icon attribute I've set in the XML, but that will have to come later I guess.

I've never used the Tree component, so I'm just guessing here....
There is a slight delay before the xml file loads and your tree has its data provider.
Perhaps during that time there is no node at mTree.getTreeNodeAt(0) to open? Try adding this just before the last line of your code:
trace("the node is: "+mTree.getTreeNodeAt(0));
What do you get?
You might need to move that code inside the xml's load event handler.
Another thing is that the Flash components tend to work on an invalidate-then-wait-one-frame-to-redraw kind of model. So it is possible you will need to wait one frame after the xml has loaded and then tell it to open that node.
The doLater method might help with that.
var home:MovieClip=this;
var xmlTreeData:XML = new XML();
xmlTreeData.onLoad = function() {
mTree.dataProvider = this.firstChild;
mTree.doLater(home,"delay");
xmlTreeData.ignoreWhite = true;
xmlTreeData.load("xml/treeValues1.xml");
mTree.setStyle("fontSize","11");
mTree.setStyle("selectionColor","0xE0E0E0");
mTree.setStyle("useRollOver",false);
function delay(){ 

Similar Messages

  • Custom icon per entry in the AS2 Tree Component (using CS3)

    I have a tree component that loads its data from an XML file and I wonder if I can customize every entry to have its own icon by adding an icon attribute to every entry in the XML and giving the tree an action to read that icon (which would exist in the library of the Flash file). My goal is to reproduce a tree within an application that my company is developing (it's for a training tool related to that application).
    My XML says something like <node label = 'Label' heading = 'LABEL' desc = 'Description' icon = 'icon1' />
    My label is what the tree displays, the heading is what the information dialog in the training tool displays as a title bar, the desc is what the training tool displays within the body of the text for the function description and the icon is what I want to be a reference to the graphic in the library to place as an icon in front of the item rather than use setStyle with the properties for disclosure, leaf, and folder icons.
    Is that possible? I haven't found a solution for it yet.

    I've never used the Tree component, so I'm just guessing here....
    There is a slight delay before the xml file loads and your tree has its data provider.
    Perhaps during that time there is no node at mTree.getTreeNodeAt(0) to open? Try adding this just before the last line of your code:
    trace("the node is: "+mTree.getTreeNodeAt(0));
    What do you get?
    You might need to move that code inside the xml's load event handler.
    Another thing is that the Flash components tend to work on an invalidate-then-wait-one-frame-to-redraw kind of model. So it is possible you will need to wait one frame after the xml has loaded and then tell it to open that node.
    The doLater method might help with that.
    var home:MovieClip=this;
    var xmlTreeData:XML = new XML();
    xmlTreeData.onLoad = function() {
    mTree.dataProvider = this.firstChild;
    mTree.doLater(home,"delay");
    xmlTreeData.ignoreWhite = true;
    xmlTreeData.load("xml/treeValues1.xml");
    mTree.setStyle("fontSize","11");
    mTree.setStyle("selectionColor","0xE0E0E0");
    mTree.setStyle("useRollOver",false);
    function delay(){ 

  • A question about the Tree Component

    I have try to use the tree component i a flash page, and
    it´s going allright until I´ll want to link the content
    to a page... WHY??
    I have tried a lot of different codes here are those I tried:
    <tree>
    <folder label="Mine own">
    <link label="My page" url="
    http://www.mickesei.se" />
    </folder>
    </tree>
    Nr2:
    <tree>
    <folder label="Mine own">
    <link label="My page" link="
    http://www.mickesei.se" />
    </folder>
    </tree>
    nr3:
    <tree>
    <folder label="Mine own">
    <link label="My page" href="
    http://www.mickesei.se" />
    </folder>
    </tree>
    nr4:
    <tree>
    <folder label="Mine own">
    <link label="My page" get URL="
    http://www.mickesei.se" />
    </folder>
    </tree>
    But nothing seems to work, when I go mouse over it still a
    arrow should it?
    HELP ME PLEASE!!! Micke

    Thanx Jeanne,
    You brought me on a idea with the UIX Developer's Guide and EXPANDABLE_EXPANDED value.
    I couldn't figure out how the expand property was filled, because it wasn't done in the ADF BC ViewObject. We have a Utility class that creates a DataObject from the ViewObject Data and here the expand property was set.
    Now it was easy to build a ExpandAll option. It is possible to access the HttpServletRequest object were the DataObject is created. By setting a attribute in the request I could react on that and give the expand property indeed the value EXPANDABLE_EXPANDED.
    Dennis

  • Tree component flash cs3 multiline/wordwrap

    Hi All,
    I have a tree component customized ..now i am stuck at the
    length of the text ..i need to have the text in the tree node to
    word warp for lengthy text..
    thank you for the help in advance..
    kakas

    nothing so far..really needed it very urgently!
    thx again
    kakas

  • Question about creating tree

    Hi, when I created a tree with an employees table, I created an entity object, association about manager foreign key, view object, and view link. There is a recursive tree to be created.
    But when I just created a view object and view link to create a tree. There is just two layer. Why I can't create a recursive tree with a view object?

    http://technology.amis.nl/2006/08/07/creating-multi-type-node-children-and-child-node-labels-in-adf-faces-tree-component/

  • Problems With List Component Flash Cs3

    Hello Friends,
    I am working in Flash Cs3.
    I am having a List component in my application.
    I added 10 items into my list component. Now out of those 10 items, i want to disable particular list items like Item 4, Item 8, Item 9. How to do this using flash cs3 or flash 8.0.
    Item1   --  Enabled state
    Item2   --  Enabled state
    Item3   --  Enabled state
    Item4   --  Disabled state
    Item5   --  Enabled state
    Item6   --  Enabled state
    Item7   --  Enabled state
    Item8   --  Disabled state
    Item9   --  Disabled state
    Item10 --  Enabled state
    Any suggestions/ideas would be really appreciated.
    Regards,
    Rajesh

    Hello Friends,
    I got a partial solution for this. Now i can able to disable a particular list item using flash cs3. I achived this. But it was happening only after clicking the item values....
    But i need in a diff way like, as soon as you run the flash file it has to disable. how is this possible in flash cs3.
    this is the code :
        import fl.controls.List;
        import fl.controls.listClasses.CellRenderer;
        import fl.controls.listClasses.ListData;
        import fl.events.ListEvent;
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.text.TextField;
            var sampleItem1:Object = { label:"John Alpha" };
            var sampleItem2:Object = { label:"Mary Bravo" };
            var sampleItem3:Object = { label:"Trevor Gamma" };
            var sampleItem4:Object = { label:"Susan Delta" };       
            var myList:List;
            var tf:TextField;
      ListDataExample()
             function ListDataExample() {
                createList();
                tf = new TextField();
                tf.x = 10;
                tf.y = 125;
                addChild(tf);
             function createList():void {
                myList = new List();
                myList.move(10,10);
                myList.addItem(sampleItem1);
                myList.addItem(sampleItem2);
                myList.addItem(sampleItem3);
                myList.addItem(sampleItem4);
                myList.rowCount = 4;
                myList.addEventListener(ListEvent.ITEM_CLICK,listItemSelected);
                addChild(myList);
             function listItemSelected(e:ListEvent):void {
                var cr:CellRenderer = myList.itemToCellRenderer(e.item) as CellRenderer;
                var listData:ListData = cr.listData;
       if(cr.listData.row == 2) {
        cr.enabled  = false
                tf.text = "Row selected: " + listData.row;
    waiting for your replies.
    Regards,
    Rajesh

  • About af:tree component

    ......... I use JDeveloper 11g TP4 .............
    I use tree component to desplay a recursion relationship as the relation between Employee and Manager in HR schema (Manager is an Employee)
    I want the tree to desplay manager and it's employee as Children and Children(a manager to another employee) may have a subchildren and so on.
    I make a tree and it desplay the data correctly but I want when I press to any node I show the data of its child in a table. the problem when I press to any node it return the id of the first node (root) I want when I press a child it return its Id not The root Id.
    tree code:
    <af:tree value="#{bindings.EmployeesView1.treeModel}" var="node"
    selectionListener="#{bindings.EmployeesView1.treeModel.makeCurrent}"
    rowSelection="single" binding="#{backing_untitled1.tree1}"
    id="tree1">
    <f:facet name="nodeStamp">
    <af:outputText value="#{node}"
    binding="#{backing_untitled1.outputText1}"
    id="outputText1"/>
    </f:facet>
    </af:tree>
    I construct it from wizerd I did not write any code.....
    Thank You

    I have the same problem in the <t:tree2> component. If any clues, please let us know.

  • Question about insertitem in component interface

    Hi:
    I'm using component interface in my work and face a question. When I use InsertItem function in peoplecode, I'm confused about its relationship with ActiveRowCount property of Row class. I need to check the data inserted in the record, so I put logic in component fieldchange event, uses ActiveRowCount to loop in the record to check every one row .
    In the PIA, if we insert one row(by click add button) for some record, ActiveRowCount seems include the row you just insert even if you have not click save button. But when I use InsertItem and triggered a FieldChange event, ActiveRowCount in this event seems not include the new row inserted by InsertItem function. It is quite different from inserting in PIA. I'm not sure whether I uses InsertItem in a wrong way or it is just a mechanism that component interface implemented to exclude InsertItem inserted row in ActiveRowCount ? Hope someone can help me. Thanks a lot.

    That doesn't make sense to me. Regardless of whether you are going through the PIA or through a Component Interface, your ActiveRowCount should increment the same.
    Is it possible that maybe your CI code is inserting into a different RowSet than what you are doing online through the PIA?
    I don't know if this terminology helps --
    Online via PIA | Component Interface
    RowSet = Collection
    ActiveRowCount = Count
    Row = Collection
    Field = Property
    Also be sure that your FieldChange is getting triggered after you insert the row. I am not sure how you are viewing the ActiveRowcount. If it is a message, I would assume that shows up in the message collection. The message collection will just queue the messages and you can check them at the end. So, what could happen is that your field change is getting triggered first and the message gets added to the collection. Then, you could insert the row. Then, you could check messages and see the count from before the row insert yet it looks like after the row insert. You might consider printing all your messages from the collection right before the row insert and deleting any pending messages.
    If you would like to post some of your code, maybe we can help more. Hope that much helps.

  • [Question] accessing frames Tree component CollapseAll property?

    i have frames on my Jspx pages .
    1: header (Top)
    2: Tree at the Left side (Left)
    3: Page to show (Right)
    4 Footer (Bottom)
    In the header frame i have button/ image/ or any other component to Go to home page ( pressing on 'Home' button it should Collapse the Tree).
    My Tree is in left frame and i need to call its callapse all function to collapse the tree on pressing HOME button which is at the top frame. kindly help me as to how i can do that.
    My tree tag looks like this
    <af:tree id="ProductCatalogueTree" value="#{bindings.ProductCatalogueTree.treeModel}" var="node"
    binding="#{ProductCatalogueTree.tree}" styleClass="bgs"
    focusRowKey="#{ProductCatalogueTree.focusRowKey}" varStatus="nodeStatus">

    Hi,
    all you can do from one frame to another is to refresh its content by re-loading the page displayed in it. There is no shared context that allows you to programmatically access the displayed page content. So in your case you would need to refresh the content of the tree page and pass a request parameter about the state. This parameter then should be evaluated by the tree initialization (e.g. a managed bean reference or a pagedef reference)
    Frank

  • Question about project manager on Flash CS4

    1 It seems that CS4 can not open flp, so how can I use CS4 to manager a project builded by CS3?
    2 if you choose a folder to found a new project in CS4, when you want to publish the whole project, you need to choose all the fla of that project...that will cost a lot of time if the project includes hundreds of files. But I didn't find out any quicker solution except check every fla by manpower. Is there any solution to publish a project faster?
    I am beginner of both CS3 and CS4, and thank you for anyone who can answer my questions.

    I'm planning on burning 1 master to a Taiyo Yuden White Inkjet Hub Printable 16X DVD-R disc.
    Make a disk image instead. It will be faster than a disc to disc copy.
    I have burnt tons of discs with the setting on "As fast as possible" with a 16x drive and discs. Never a problem. Some say that burning at a lower speed will increase reliability and decrease the chance of turning out a dud. Can't say that I have seen a difference.
    does it matter if I burn first and then print or should I print first and then burn?
    I would burn, check the disc and then print. If you do happen to get a bad batch, that's a lot of wasted time and ink if the discs don't work.

  • Question about frame rates in Flash

    If I create a Flash animation using 12 frames per second set in the Flash properties and I then export the timeline as a quicktime movie at PAL settings (25 frames per second) so that I can use it in a Premiere Pro timeline with other PAL video clips shot with a camcorder, does that affect the speed at which the original Flash timeline will play when converted to a quicktime movie?
    I don't want to have to animate the Flash clip at 25 frames per second in Flash because it requires about twice as much drawing, but I also want to preserve whatever sense of action timing there is in the Flash action and not have it play too fast or too slow when incorporated into a video project.
    Thanks for any advice on how best to do this.

    For what you show so far, you can probably create it all in Flash without concern for slicing and whatnot..  For starters....
    First create the buttons... select Insert -> New Symbol -> Button.  Buttons have 3 visual frames... one for Up, one for Over, and one for Down.  The 4th frame is useful for defining a larger Hit area for small items.  So create a new button symbol and draw the different views you want for the button.  When you are done you should be able to make the button work visually without the need for any code.  You will want to add code to control the feature displays.

  • Question about file previewing in Bridge CS3

    Does anyone know if it's possible to preview a Corel Painter file in Bridge? I'm running CS3 Bridge on a Windows XP machine. Currently, each Painter file is represented by the program's default icon. I'd love to actually see a real preview of each file!
    Thanks!

    crowedesigns wrote:
    The files I'm referring to end in the extension .RIF
    If it's not possible with the standard Bridge program, does anyone know of an addon that would allow this to work?
    When in Correl Paint use "save as" to save as jpeg or some other format supported in PhotoShop.  That is easier than trying to convert it outside of the program.
    You can keep the original .rif file in case you want to go back and work on it.

  • The question about HTML ENtities in flash

    Hello guys. Some problems with &laquo; entities. My movie
    extracts data from XML. HTML data im my XML converted to html
    entities format so I use this piece of code do decode them:
    intro_txt.htmlText=_root.suek_framework.peoplexml.firstChild.childNodes[1].firstChild;
    intro_txt.htmlText=intro_txt.text;
    It works fine for < > symbols. But it don't work for
    another entities like quotes. So in the output i have valid html
    code but with & l a q u o ; symbols instead of simple quote ".
    Maybe im doing somethin wrong? Maybe some one have idea how to
    decode this & l a q u o ; too?
    Thanks to all and sorry for my broken english!

    For what you show so far, you can probably create it all in Flash without concern for slicing and whatnot..  For starters....
    First create the buttons... select Insert -> New Symbol -> Button.  Buttons have 3 visual frames... one for Up, one for Over, and one for Down.  The 4th frame is useful for defining a larger Hit area for small items.  So create a new button symbol and draw the different views you want for the button.  When you are done you should be able to make the button work visually without the need for any code.  You will want to add code to control the feature displays.

  • Simple question about pen tool in Flash vs Photoshop

    Hi,
    After years of fumbling with the pen tool, I devoted my holiday weekend to mastering the pen tool in Photoshop. Though not necessarily a grand master of the pen tool, I'm happy to report that I've turned a corner and have transformed my pen tool feelings from fear/anger/hate into love/happiness/accomplishment. At long last, it all makes sense.
    I think.
    Today, I zipped into Flash to experiment with a tracing assignment I'm giving to my students in an upcoming Flash class. As I started to trace the path with the pen tool, I realized that it was behaving differently than it does in Photoshop. My specific problem is this:
    I place an anchor point and draw a line. Then I draw another line. Then I draw another line. Then, I decide to adjust one of the handles and try to draw another line. But it won't let me just go back to adding things to the path with the pen tool if any part of the process is disrupted.
    This seems like pretty basic functionality! What am I doing wrong?
    To make sure that I wasn't crazy, I went back to Photoshop and tried to do the same thing. It works just fine in Photoshop. At any time, I can hop away from the pen path and then back over to the pen tool. All I need to do to extend the path with the pen tool in Photoshop is to click on the last anchor point in the path. Surely, this must also be possible in Flash.
    I would be grateful for any advice!
    Aaron

    both in flash authoring tool not flash player.

  • Question about operating systems and flash storage

    im looking to buy an 11 mac air and would like to know what the difference between 2.ghz,i7,128 flash storage,4000 graphics and the 1.3 ghz,i5,256 flash storage, 5000 graphics. ??

    Go to Apple's website and study the specs.

Maybe you are looking for

  • How to find out who is owner of existing workspace?

    Hello, I would like to create Workspace. But this WS name is already exist. Can I find out who is owner of this WS? Thank you, Tomas

  • Report for cost of Attrition

    Dear Gurus, I have to design a report to calculate the cost of attrition in SAP. I understand that there is no standard build up for it in SAP, and a BI report to be developed. Being a functional consultant need to give inputs for the report to BI co

  • Skype not recognising web camera

    I have tried everything to get skype to recognise my web cam again. It used to work fine in a previous version of skype but now nothing seems to work. I have tried reverting back to an earlier version and only get the message "page not found". Skype

  • Gst-register and gst-plugins-gnomevfs [Solved]

    One of the dependencies for rhythmbox, gst-plugins-gnomevfs-0.8.10-1, causes gst-register to fail with message: (process:8613): libgnomevfs-WARNING **: Cannot load module `/opt/gnome/lib/gnome-vfs-2.0/modules/libhttp.so' (libdb-4.3.so: cannot open sh

  • Speedgrade won't launch  - Splash Window then nothing!

    Hello, I have had an issue with Adobe Speedgrade CC 2014 not launching either stand-alone (just launching the app) or by using the Direct Link from Premiere Pro. The Splash screen appears, then vanishes without showing the software. Basically, it loo