Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Thread Tools Rate Thread Display Modes
Old 11-03-2009, 03:35 AM   #1
Registered User
Join Date: Aug 2005
Posts: 14
Default [AS3] Dynamically instanciating an Astra Tree Component via AS3

The Astra Tree Component (from developer.yahoo.com/flash/astra-flash/tree/) works great when I just drop it on the stage and give it an instance name and use it when Flash creates its definition.

Now I would like to be able to conditionally create an instance of the component via AS3, but when I say:

public var newTree:Tree;

I receive the following error:
1046: Type was not found or was not a compile-time constant: Tree.

I am importing com.yahoo.astra.fl.controls.treeClasses.*

If I change the declaration to

public var newTree:List;

Then I can use put the tree component on the stage and populate it, but I don't have access to the Tree methods like openAllNodes.

Would appreciate any suggestions.

DeJarnett is offline   Reply With Quote
Old 11-18-2009, 05:04 PM   #2
Registered User
Join Date: Oct 2007
Posts: 22

you need to import the Tree classes in your AS

ActionScript Code:
import com.yahoo.astra.fl.controls.Tree; import com.yahoo.astra.fl.controls.treeClasses.*;

And make sure you have the Tree in your Library.
camdagr8 is offline   Reply With Quote
Old 11-20-2009, 05:07 AM   #3
Registered User
theAgonizer's Avatar
Join Date: Aug 2004
Posts: 41

Here is a quick tutorial on customizing the Astra Tree component. Astra Actionscript 3 Tree Component
theAgonizer is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 04:40 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.