Link to home
Start Free TrialLog in
Avatar of peter-h
peter-hFlag for New Zealand

asked on

How to create a bitmap symbol in Library with Linkage ID using AS2?

Using Actionscript 2, at runtime, how do I create a new bitmap symbol in the Library, complete with Linkage ID?

My aim is to change an icon on the tree component, but have the icon image dynamically created at runtime. Changing the icon is done using:

Tree.setStyle("defaultLeafIcon","linkageID")

So you see, I need to reference the new bitmap using the linkageID string.

Due to me using the pre-compiled Flash tree component within macromedia Director MX2004, I have no authoring-time ability to add graphics to the library, but I can pass in a bitmap datatype into the Flash object to modify a graphic. Alternatively, if I could specify an external bitmap when I create the Flash Library image, that would be even better.

Or, in the seemingly unlikely event that a Director developer knows a better way of adding a custom graphic to tree nodes, I'd love to be in on your secret. I've trawled the web for this, and haven't found an answer yet.

At the very least, I need to turn the leaf node icons off. If I use  Tree.setStyle("defaultLeafIcon","")  then no icon appears, but the indenting for that line item gets reset to 0. Using guesswork, I've tried "null", "nullicon", null, etc, but all have the same negative effect on indentation.
So far, all I know of for options for the LinkageID are:  "TreeNodeIcon","TreeFolderClosed" & "TreeFolderOpen". Do you know of any other possible values?

Thanks. Your expert advise is appreciated, as always. :)
Pete.

addtional keywords: customize customise adobe lingo
Avatar of Aneesh Chopra
Aneesh Chopra
Flag of India image

library item can't be created at runtime using actionscript

solution is, create a movieClip with linkageID at design time...
and add code inside that movieClip to load dynamically created bitmap inside..
Avatar of peter-h

ASKER

Therein lies the problem: I can't do anything at design time, so I need a runtime solution.

Knowing the already-existing linkage ID of a Library item, could I manipulate the existing bitmap?
And even if I could do this I still need at least one other known Library item (apart from  "TreeNodeIcon","TreeFolderClosed" & "TreeFolderOpen") to implement to requirements. Are there any others known for the tree component?
ASKER CERTIFIED SOLUTION
Avatar of peter-h
peter-h
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial