Solved

Rotate a List component AND STILL view the data.

Posted on 2010-09-22
12
391 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
  • 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
 

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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Viewers will learn how to include realistic velocity sensitivity to their Sampler instruments. Set the Vol<Vel parameter in the Filter/Global tab to your desired setting: Gather samples of hits of various intensity, and drag/drop into Velocity zon…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

914 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now