Solved

Rotate a List component AND STILL view the data.

Posted on 2010-09-22
12
396 Views
Last Modified: 2012-05-10
Hey all,

I have a populated list component in Flash CS5.  I want to rotate it 90-degrees.  But when I rotate it at all, the labels no longer display in the list component.

Any fixes?

Thanks in advance.
0
Comment
Question by:ModifyMe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 4
12 Comments
 
LVL 8

Expert Comment

by:ActionScript_Helper
ID: 33742660
You'll need embedded font for your list to display labels even after rotation.

You can embed a font in library and can set font style of your list component using

yourlist.setStyle("fontFamily", "embeddedfontname");
Or may be you can set font property from properties bar.

Alternatively as per my knowledge, publishing your SWF on Flash player 10 can solve this, as FP10 can show non-embedded rotated text.
0
 

Author Comment

by:ModifyMe
ID: 33745979
Hmmmm, well I tried this:

test_lb.setStyle("fontFamily", "Font 1");

...and it did not work. I am testing a new list component with hardcoded data and manually rotating it 90-degrees, then testing with no luck

Flash CS5-AS3
0
 

Author Comment

by:ModifyMe
ID: 33750642
Well, I've searched quite a bit w/no luck.  I do hope someone can help me resolve this soon.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ModifyMe
ID: 33766900
The attached screenshot is the process that I am doing, with no luck still.
embed.jpg
0
 
LVL 8

Expert Comment

by:ActionScript_Helper
ID: 33767567
Inverse to my expectation list styling works really differently, I did some research and found the following solution.
Try to implement it, it may take some communication to make it to work for you, so feel free to shoot any question.


Here's the process how you'll get embedded font to work with list, and make list rotated:

1. First part is to embed the font (Referring your screenshot):
- In your step 2 (Font Embedding), go to "ActionScript" tab and select the check box saying "Export for ActionScript"
doing this allows your embedded font to be accessible via ActionScript.

2. Second part is to create a custom cellRenderer for your List cell renderer which will use embedded font:
- Create an ActionScript class named "CustomCellRenderer" (At same place as your FLA), and put the following code in it:
=========================
package {
    import fl.controls.listClasses.CellRenderer;
    import flash.text.TextFormat;
    public class CustomCellRenderer extends CellRenderer {
        public function CustomCellRenderer() {
            var format:TextFormat = new TextFormat("Verdana Regular", 12);
                  setStyle("embedFonts", "true");
            setStyle("textFormat", format);
        }
    }
}
=========================

Please note that the font name should be your Embedded font name + Style name (Actual font name + Font Style name)
See this line:
---
var format:TextFormat = new TextFormat("Verdana Regular", 12);
---
"Verdana" is name of your embedded font, concat it with font style mentioned in your step 2 i.e. "Normal", so it should be "Verdana Regular"


3. Now the 3rd step is to use this custom cell renderer for your list component, in your FLA put this code line:
- my_lb.setStyle("cellRenderer", CustomCellRenderer);

4. And now you can rotate the list box :)
0
 

Author Comment

by:ModifyMe
ID: 33773140
I am trying to upload my .fla and .as files onto this post, but I keep getting an error.  I did try what you suggested, but now I get a blinking list component...still no labels.
0
 
LVL 8

Accepted Solution

by:
ActionScript_Helper earned 500 total points
ID: 33776190
Blinking list means.. code has some error..

are you publishing the SWF with AS3?

May be try to upload FLA and AS file on some different location and than share the link here..
0
 

Author Comment

by:ModifyMe
ID: 33782300
Here is the location for the .zip file.

http://jumbofiles.com/fk5agcj6xutm

0
 

Author Comment

by:ModifyMe
ID: 33795045
Please disregard that link I posted just above this post, that site is no good.

Here is where you can get the download of the files I am trying to get to work.

http://www.4shared.com/file/kvaU_IdQ/CustomList.html

0
 
LVL 8

Expert Comment

by:ActionScript_Helper
ID: 33795913
I'll try and let you know the results soon..
0
 

Author Comment

by:ModifyMe
ID: 33805001
I just noticed my .as file was not included in the .zip file...sorry for my disorganization.  Here is that file.
CustomCellRenderer.as
0
 

Author Closing Comment

by:ModifyMe
ID: 33850497
Thank you.
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question