Solved

Rotate a List component AND STILL view the data.

Posted on 2010-09-22
12
390 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
The attached screenshot is the process that I am doing, with no luck still.
embed.jpg
0
 
LVL 8

Expert Comment

by:ActionScript_Helper
Comment Utility
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
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 8

Accepted Solution

by:
ActionScript_Helper earned 500 total points
Comment Utility
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
Comment Utility
Here is the location for the .zip file.

http://jumbofiles.com/fk5agcj6xutm

0
 

Author Comment

by:ModifyMe
Comment Utility
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
Comment Utility
I'll try and let you know the results soon..
0
 

Author Comment

by:ModifyMe
Comment Utility
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
Comment Utility
Thank you.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I have a Synology DS212+ NAS.  These are not only great for backup and normal NAS stuff, but also for delivering media throughout your home or LAN via DLNA.  I copied my whole audio collection from iTunes over to the box, but couldn't figure out how…
This article will show, step by step, how to integrate R code into a R Sweave document
Viewers will learn how to use LFOs to modulate the sound of their Sampler instruments. Click the Modulation tab in Sampler: Choose one (or more) of the three available LFOs, and click the respective button to turn it on: Select a waveform, an LF…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

762 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

7 Experts available now in Live!

Get 1:1 Help Now