joshtynjala / flextreemap

TreeMap data visualization component for Adobe Flex
https://github.com/joshtynjala/flextreemap/wiki
Other
24 stars 9 forks source link

TreeMap issue in Flash 4.6 #12

Open sreekumar1267 opened 9 years ago

sreekumar1267 commented 9 years ago

I had used the Treemap in Flash 3.2 code and it worked fine. Now we migrated the code to Flash 4.6 and after that we are getting the below error:

TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.flextoolbox.controls.treeMapClasses::TreeMapLeafRenderer/updateBackgroundSkin() at com.flextoolbox.controls.treeMapClasses::TreeMapLeafRenderer/createChildren() at mx.core::UIComponent/initialize() at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded() at mx.core::UIComponent/addChild() at com.flextoolbox.controls::TreeMap/getLeafRenderer() at com.flextoolbox.controls::TreeMap/refreshBranchChildRenderers() at com.flextoolbox.controls::TreeMap/refreshBranchChildRenderers() at com.flextoolbox.controls::TreeMap/commitProperties() at mx.core::UIComponent/validateProperties()

Any pointers would help!!

joshtynjala commented 9 years ago

See the note in the readme about defaults.css. If I remember correctly, the version that was compatible with Flex 3 didn't need this file. However, for proper compatibility with Flex 4, it had to be added. If you aren't including this file when you compile, the TreeMap component won't have default styles. If you use the SWC file, defaults.css will be included automatically.

sreekumar1267 commented 9 years ago

Where exactly should i add the default.css file? I am using your code inside a library project which has this structure -- LibProjectMain --> com --> flextoolbox. Inside flextoolbox i have all the other folders. Should i place the default.css inside com directory? Just creating a file alone is enough or do i need to load the css anywhere in your code? Please let me know

joshtynjala commented 9 years ago

The build script uses the following command line arguments to include defaults.css in the SWC:

--include-stylesheet defaults.css source/defaults.css

defaults.css is in the same folder as the com folder. Your project may have a slightly different folder structure, so that exact set of arguments may not be the same for your project. For instance, if defaults.css and the com folder code were in a folder named src instead of source, you would change the command like this:

--include-stylesheet defaults.css src/defaults.css
sreekumar1267 commented 9 years ago

Thanks! I added the default.css file in the source path. But still i face the issue. What should be the contents inside the css file?

joshtynjala commented 9 years ago

What do you mean? Use the existing file that comes with the project.

sreekumar1267 commented 9 years ago

I do not have any existing css files in that project. I have created a library project which has your code for TreeMap. I am including this library project in my main project.

joshtynjala commented 9 years ago

The code for TreeMap comes with a defaults.css file. Use that file.