Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Rotate a List component AND STILL view the data.

Posted on 2010-09-22
12
Medium Priority
?
398 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
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 

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 2000 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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
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 the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

705 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