Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Styling Text In A List Component (or Components In General)


Hey,

I need to style a list to have the following format (it lists a bunch of products)...

A
then a bunch of products that start with the letter A
B
then a bunch of products that start with the letter B
C
then a bunch of products that start with the letter C


and so forth... I think you get the idea

The letters A,B,C, etc need to have their own line as well as their own font size, as well as be centered in the list.

How can I achieve this effect?

BTW all my data will come from a XML file.




FlashKit > Flash Help > Actionscript 3.0
Posted on: 04-22-2008, 08:09 PM


View Complete Forum Thread with Replies

Sponsored Links:

Styling The Text Inside Of A List Component
I need to style some elements of the list in one way, and some of the other elements in another way.

All the elements are text brought in via XML.

How can I do this?

View Replies !    View Related
Styling List Component
Hi guys, I am looking to style the list component and I haven't been able to do what I am looking for.

Is there anyway to control the height of each line? IE: I need to condense the line height so the list isn't so spread out. I find that there is too much room above each item in the list.
Also, there is a left-margin that I would like to get rid of.

Any tips or links regarding re-styling the list component would be of great help. Thanks!

View Replies !    View Related
List Component Styling Question
Hey everyone,
I'm currently skinning and styling a List component. I'd like the text color of the items to change on a rollover but I'm not sure what the most efficient way of doing that is. I guess I could setup event listeners and use change the cellRenderer property when the event is triggered but that seems like reinventing the wheel to me. Is there an easier way to do it?

I thought of extending the CellRenderer but I do not know what methods to overwrite to include changing text color. Any ideas?

View Replies !    View Related
Targeting/Styling Items In List Component
Hello all,
This question specifically deals with AS3 and list components.

I've got an XML/Flash Video player that lists the videos with a thumbnail and description in a list component. I got the source files from an Adobe tutorial: http://www.adobe.com/devnet/flash/ar..._playlist.html.

I'm able to style everything the way I want it. The problem comes when I try to attribute a specific text style to a selected item. I understand how the information is being taken from the XML and looped into the list component. What I don't get is how you reference a particular item in the list and whether or not you can attribute a different style to that item when the event listener fires.

Here's the AS code referring to the event listener for a selected item:

Code:
public function initMediaPlayer(event:Event):void {

var myXML:XML = new XML(xmlLoader.data);
var item:XML;
for each(item in myXML.vid) { // populate playlist.
var thumb:String;
if(item.hasOwnProperty("@thumb")>0) thumb = item.@thumb;
tileList.addItem({label:item.attribute("desc").toXMLString(),
data:item.attribute("src").toXMLString(),
source:thumb});

}

tileList.selectedIndex = 0; // Select the first video.
tileList.addEventListener(Event.CHANGE, listListener);// Listen for item selection.

myVid.source = tileList.selectedItem.data;// And automatically load it into myVid.
myVid.pause();// Pause video until selected or played.
}


// Detect when new video is selected, and play it
function listListener(event:Event):void {
myVid.play(event.target.selectedItem.data);

//DEFINE STYLES FOR SELECTED ITEM
textStyleOn = new TextFormat();
textStyleOn.font = "Arial";
textStyleOn.color = 0x97b9f9;
textStyleOn.size = 10;

// HERE'S WHERE I'D LIKE TO REFERENCE THE ITEM SELECTED
// AND CHANGE IT'S STYLES. QUESTION IS, HOW DO I REFERENCE
// ONLY THIS LIST ITEM?

}
In the interest of full disclosure, there's another AS file being referenced that grabs the thumbnailed images for the list

Yo!

View Replies !    View Related
Targeting/Styling Items In List Component
Hello all,
This question specifically deals with AS3 and list components and styling a selected item, if that's even possible.

I've got an XML/Flash Video player that lists the videos with a thumbnail and description in a list component. I got the source files from an Adobe tutorial: http://www.adobe.com/devnet/flash/ar..._playlist.html.

I'm able to style everything the way I want it. The problem comes when I try to attribute a specific text style to a selected item. I understand how the information is being taken from the XML and looped into the list component. What I don't get is how you reference a particular item in the list and whether or not you can attribute a different style to that item when the event listener fires.

Here's the AS code referring to the event listener for a selected item:

Code:
public function initMediaPlayer(event:Event):void {

var myXML:XML = new XML(xmlLoader.data);
var item:XML;
for each(item in myXML.vid) { // populate playlist.
var thumb:String;
if(item.hasOwnProperty("@thumb")>0) thumb = item.@thumb;
tileList.addItem({label:item.attribute("desc").toXMLString(),
data:item.attribute("src").toXMLString(),
source:thumb});

}

tileList.selectedIndex = 0; // Select the first video.
tileList.addEventListener(Event.CHANGE, listListener);// Listen for item selection.

myVid.source = tileList.selectedItem.data;// And automatically load it into myVid.
myVid.pause();// Pause video until selected or played.
}


// Detect when new video is selected, and play it
function listListener(event:Event):void {
myVid.play(event.target.selectedItem.data);

//DEFINE STYLES FOR SELECTED ITEM
textStyleOn = new TextFormat();
textStyleOn.font = "Arial";
textStyleOn.color = 0x97b9f9;
textStyleOn.size = 10;

// HERE'S WHERE I'D LIKE TO REFERENCE THE ITEM SELECTED
// AND CHANGE IT'S STYLES. QUESTION IS, HOW DO I REFERENCE
// ONLY THIS LIST ITEM?

}
In the interest of full disclosure, there's another AS file being referenced that grabs the thumbnailed images for the list

Yo!

View Replies !    View Related
Embedinf Font In Flash Components (List Component)
Is there a possibility to embed font trough ActionScript in FlashComponents, especially List component ?

thanks,

Bojan

View Replies !    View Related
Embedinf Font In Flash Components (List Component)
Is there a possibility to embed font trough ActionScript in FlashComponents, especially List component ?

thanks,

Bojan

View Replies !    View Related
Styling Components
Can someone give me some general examples of how to apply style to components? I already have components on the stage (so not generating them new from classes in ActionScript). Specifically, I need to designate the display text for both the checkbox and the radiobutton.

View Replies !    View Related
Styling A LIST Box Via AS
Hi --

I would like to make a simple change to the default List box. I want to
remove the border and change the type face. I have tried using the setStyle
on the instance but it does not work. I assume this is because I need to
reference the "text field" inside the list? Is there a SIMPLE way to do this
without creating a whole new CellRenderer class?

Thanks

Rich

View Replies !    View Related
Up For A Challenge? Styling Components W AS...
OK, here's the code I'm using:

var oListener:Object = new Object();
oListener.onSetFocus = function(oldFocus, newFocus) {

trace("oldFocus: " + oldFocus);
trace("newFocus: " + newFocus);
trace("Selection.getFocus(): " + Selection.getFocus());
trace("");

};

Selection.addListener(oListener);

Clicking on any input field in my form triggers the function, as it should. The challenge is, I want to get the name of the field. What the function returns for newFocus is:

_level0.subject_txt.label

But I can't target it correctly with "label" on there:

What I want to do is target the setStyle property, like this:

_level0.name_txt.setStyle("backgroundColor", "0x000000");

Does anyone have any idea how to do this?

Thanks,
Elliott

View Replies !    View Related
Styling Components In Flash 8
Hello,

I have a progress bar on the timeline for a SWF I am loading. I want to style the progress bar with a specific HEX colour. I've viewed and tried a number of tutorials on the subject, yet each tme I apply the actionscript nothing changes. I've placed the actionscrtipt in the first frame of the first layer in the first scene of my FLA. I'm loading SWFs at different intervals along the timeline using frame labels.

Is it possible to create one preloader for each of these SWFs so that I can reuse it for each. If so, how would I incorporate the preloader into the main timeline given that I'm using frame labels to differentiate each loader.

Thanks

View Replies !    View Related
Styling Flash Form Components
How ould I go about changing the fonts, colours , sizes etc of Flash form components, and is there a way of turning the drop down (combo box) to the Flash equivalent of an HTML select multiple="true" to allow the user to control click multiple options?

Thanks,
Paul

View Replies !    View Related
Components Styling: Guru Needed
I think I need some help in explaining styling components, or otherwise the Flash documentation is just plain wrong

What I'm trying to do is style the checkbox component.
More specifically I want to change the color of the checkbox.
According to the docs I could do it like this:

ActionScript Code:
my_cb.style.setStyle("symbolColor", 0xff0000);

But....it's a no go.

Any ideas?

View Replies !    View Related
Custom Styling Your UI Components(combobox Help)
hey all,

i want to apply a graphic that i have created as my new skin for this component is this possible? or how do you go about styling??

Cheers in advance peeps

View Replies !    View Related
Text Color In List Components?
Hallo,

Just switched over to CS3, still adjusting to the many many changes.

How on earth do you change the text color styles of a List component in AS3? I know it was easier to directly access the .color, .rollOverColor properties in AS2, but I can't find *ANY* comparable feature in AS3. I can see how everything else is skinned, by navigating the layers of symbols within the component. Can anyone help me, or explain how I'm thinking about this wrong?

Thanks,
Dylan

View Replies !    View Related
Changing Text Color In List Components
Hallo,

Just switched over to CS3, still adjusting to the many many changes.

How on earth do you change the text color styles of a List component in AS3? I know it was easier to directly access the .color, .rollOverColor properties in AS2, but I can't find *ANY* comparable feature in AS3. I can see how everything else is skinned, by navigating the layers of symbols within the component. Can anyone help me, or explain how I'm thinking about this wrong?

Thanks,
Dylan

View Replies !    View Related
Custom Component Styling Help
Hi

i'm trying to create a component , everything is working so far , except for one problem.
i had my class inherit from the FUIComponents Class so i could easily use skins in my component.

i have a skin called window_mc

it has three skin elements. i used something like
component.registerSkinElement(background_mc, "background");
to register them.


i have added this to the first frame in the timeline
mycomponent.setStyleProperty("background", 0x000099);

and it works ! the thing turns blue.

the problem now is if i add 2 instances of the component on the stage.
if i then set the components to 2 different colors
they will show the correct 2 different colors in my live preview movie but not when i publish it. both the component will have the same color if you test the movie.

if have tested alot , the components have other variables that do work with more than 1 instance. even alpha works seperate , only the styles are messed up.

i know that this is probably a what the **** is this guy saying to a lot of people , but i'm hoping some of you actually know what i'm talkin about

here is the link to the fla if you want to check it out
http://users.pandora.be/dreams/component_test.fla

here is a link to the html if you just want to preview it
http://users.pandora.be/dreams/component_test.html

so to summarise :
the components colors work inside the fla , but not when you view the swf. in the swf they all have the same color.

i'm not totally expecting an answer on this one , but sure am hoping :-)

View Replies !    View Related
Styling 04's Button Component
currently the mouseover highlight is green, which doesnt work too well with most sites designs / colour schemes ...

so how would i change the green highlight to blue?

View Replies !    View Related
More Component Skinning/styling ?'s
more component skinning/styling ?'s

I cant seem to find out how to:

1.) change my drop down box to have SQURE corners instead of the halo ones.. I want 'simple' ones I guess..

2.) cant figure how to change the BORDER of the comboBox..I can change it for the drop down of the comboBox..but not the comboBox itself.


and 3.. I still cant figure out how to change the scrollbar in the tree component.

PLEASE..anyone..throw me a bone here..

View Replies !    View Related
Scrollpane Component Styling
Ok, I've got so far as to style my scrollbar in the Scrollpane component by editing the themes dragged into the fla library. I want to give the scrollthumb ( ie. the bit that you click and drag ) a different colour to the scrolltrack.

Problem is this: no matter how I edit the theme movie clips they always end up being the same colour. I have even tried setting the component instance styles in the actionscript - but no change.

Does anyone have any experience with this, have any ideas/clues on how to solve the problem please? All I've read on the net is that the Scrollpane component is a nightmare to customise, and so far I have to concur.

View Replies !    View Related
Styling Button Component
How do you style a button Component(how ever you spell it)?

I want to chang the default text and size.

View Replies !    View Related
List Component That Calls Text File To Text Area
flash mx pro

How would i load externel text files into a scrollable textfield using a listbox component as a menu to select and load the different .txt files on my server.

Please see my attempt so far which "does not work" at the following link:

http://www.miamicrab.com/untitled0.htm

View Replies !    View Related
How To Add Text To UI Component - List Box
I am stumped as to how to add text to one of the UI Components the scrolling list box. I want to insert scrolling text not lists.

The actions frame of the list box movie clip references a movie clip (flistItem)

Do I drop the mc UI Component List Box onto the stage and then go to the mc and edit it putting text in one of the layers and call the text "flistitem."

View Replies !    View Related
Can't See Text In List Component
I'm adding an XML-driven list component to a page in a Flash template and I can't see text in the list or text box components. The boxes are visible - the text is not. However, the text is there because you can mouse over and select it and you get the appropriate hilight behavior. I also added a "trace" button that outputs the contents of one of the text boxes and it shows that the correct text is there, you just can't see it on the screen.

I'm using a movie clip object (called trackList) to hold the XML connector and the list boxes. I can cut and paste the trackList object into another FLA file and it works fine - the text is visible. But when I add a trackList instance to one of the pages in the template, I can't see the text. So it seems like there's some global setting in the template that's hiding the text in the list boxes and text boxes. The XML connector is working because I get the correct output in the trace statement when I select the invisible text (because, of course, I know what the hidden text is).

Any suggestions on where to look or what to do? I'm relatively new to Flash and ActionScript so my guess is that it's something simple...

Thanks,

rgames

View Replies !    View Related
Xml In List Component And Dyn Text
Hi there -- excellent site, excellent info in thte tutorials.

I have gond thru the xml list tutorial, and it is working fine. Wondering how to go about pulling some info about each linked file into dyn text boxes, like on the gotoandlearn site tutorials. Would like to have the component with the list of FLV URLs, and in dyn text boxes elsewhere on the stage, feed in info in the selected file (probably just a description and the FLV duration.

Thanks!

View Replies !    View Related
[F8] Text Color In A List Component
I have searched for this and nobody seems to know the answer!

I have a list and want to change the text color of individual rows.

The background color can be changed thus:

Code:
list.setPropertiesAt(number, {backgroundColor:0x999999});
but replace 'backgroundColor' with 'textColor' or even just 'color' and nothing happens! Surely I am not alone in thinking that changing the text color would be more desirable than changing the background color!

Anyone got any thoughts?

View Replies !    View Related
[F8] Label Text List Component
Does anyone know what file needs to be modified in the componentFLA folder to manually edit the label field on the List Component?

OR

Does anyone know if it is possible to have the label text in a List Component wrap on two lines? My text is longer than the width of the List Component and the text gets cut-off. Is there a parameter for text wrap or something?

Thanks,
Michael

View Replies !    View Related
Text Color In A List Component
I have searched for this and nobody seems to know the answer!

I have a list and want to change the text color of individual rows.

The background color can be changed thus:

Code:
list.setPropertiesAt(number, {backgroundColor:0x999999});
but replace 'backgroundColor' with 'textColor' or even just 'color' and nothing happens! Surely I am not alone in thinking that changing the text color would be more desirable than changing the background color!

Anyone got any thoughts?

View Replies !    View Related
Text To Wrap On List Component
How can I get text to wrap in a list component?

View Replies !    View Related
Wrap Text In A List Component?
I'm building a default flv movie player for a series of software tutorials. The movie's cue points go into a List component for chapter navigation, and those titles greatly vary in length, so I have some of them longer than the List's width.

Is there a way to wrap the text? I searched in the docs and couldn't find anything to help me.

Thanks for any help.

View Replies !    View Related
Formatting Text In A List Component
Is it possible to format the XML attributes that make up the contents of a list component? I know you can format the entire list with _global.setStyle, but I want to make the Header bold and red, and the text below a smaller font. I heard you can do this with XSLT or CSS2, but I haven't been able to figure out how. Anybody got any pointers?

View Replies !    View Related
Display List General Question
Hi,

I'm working on a window component that will have other components/text/graphics etc. nested.
I was wondering whats the best way to set this up.

Have every component added as a seperate displayObject or have one Sprite for the window component and add there all the other displayObjects I need?

thanks
stelios

View Replies !    View Related
Anti-Aliased Text In List Component?
Is there any action script that can make the text in a list component from anti-aliased? thanks.

View Replies !    View Related
[CS3] Changing Text Color In List Component?
Hallo,

Just switched over to CS3, still adjusting to the many many changes.

How on earth do you change the text color styles of a List component in AS3? I know it was easier to directly access the .color, .rollOverColor properties in AS2, but I can't find *ANY* comparable feature in AS3. I can see how everything else is skinned, by navigating the layers of symbols within the component. Can anyone help me, or explain how I'm thinking about this wrong?

Thanks,
Dylan

View Replies !    View Related
HELP Arrays, List & Text Field Component
I made an Arrays with a couple of Site Names, their URL and Information. The Array is a dataProvider for a List Component which takes the values to their respective TextBoxes when clicked, and a Button to Open the Browser to that URL!

HELP!...
I need a Text Field Component to Search the Array and update the current List with the new values... and when the Text Field is Empty, put the original Array values into the List...

I aint got no idas in Coding, Just a little Bit Tho. So can someone give me some ideas... ...

You can see the SWF @ http://www.geocities.com/thefjk/web_list.swf (Search Button doesnt work...)

The FJK!

View Replies !    View Related
List Component Text Disappearing At Runtime
I really need help with this - I have been trying to get this to work for 2 weeks now and so far no one has been able to help. I am attempting to use components in my flash movie, but when I test the movie, none of the labels show up.

The components are placed into a movie clip that is instantiated and manipulated at runtime - in other words, it exists only in the library and is called into existence at runtime through the attachMovie method.

On the side of the screen are buttons that make this MC move around the screen.

These components I am trying to use are not being rotated, just moved (because they are inside a MC that is being moved). I've tested this and have determined that moving a component at runtime does not cause the text to disappear - only rotating it does.

If you need it, I have uploaded the source file. Just run it and you'll see the component - with no text displaying. The rows should be labeled "1" "2" and "3". Thanks in advance for any help!

If you get this far (downloading and looking at the source fla) I will go the distance here and point you directly to where this object is located. Simply open the fla's library and double click on the searchAreaContent MC inside the search panel folder. You will find the component in there.

View Replies !    View Related
Changing The Text Color On The List Component
It's my understanding that using listInstance.setStyle( "color", myColor ); should change the colour of the text in my list component, but I'm having a difficult time getting this to work. I've tried a variety of different things where 'myColor' is but nothing seems to be working.

View Replies !    View Related
List Component Text Color RollOver
Ahhhhrrrrg!!!!!

For the life of me i cannot figure this out or cannot find simple straight forward documentation.

Previously in AS2, to set the style for a List Component when the mouse was over an item you would simple set it with
Code:

setStyle("rollOverColor", 0x000000);



I've been trying to find info on how the heck you do this in AS3, cause the above dont work.

i've been playing with the following code, but it does not have a rollOver property

Code:


var tf:TextFormat = new TextFormat();
tf.color = 0x00FF00;
tf.font = "Andale Mono";
tf.size = 14;



So please help, does anyone have a clue?

PS, normally when a programing language is changed, is is done at an easing speed, but AHHH! NO!!! not with AS3, it has changed 101%

Sorry just letting some frustration out.

Thanks for the help.

View Replies !    View Related
Try To Display Bold Or Italic Text In List Component
hi all,
I use list, tree and datagrid components to display my data. Some of them are Medical names and they have to be in italic or bold style. How can I do this? Is it possible to use a different font family or a font style only to some special characters of my data?

Thank you in advance
Yiannis

View Replies !    View Related
Styling Text
Hi,
I have attached a file that has problems, such as:
- the bullets are not the same eventhought they all have the same font & size the second line always comes different
- the bullets are left intented 10 pt but once I output that they are aligned the same way.

Please advise.

Regards

View Replies !    View Related
General Component Problem
I am a relative newbie .. just beginning to play around with components.

When I drag a simple button, or for that matter, any component, onto my stage ... it looks fine; i can access params, properties, etc... but when i export the swf or preview it ... i do not see the comopnent .. just a white rectangle that is the same size as the component ... with no interior detail at all ... just white ... like a white cat eating marshmallows in a snowdrift.

To prove that I am not a nincompoop, I can create a new flash document, drag a component out, and it appears just fine. It is only on my original document, mentioned above, that i get the whiteout.

So, my question comes down to this: is there anything you can do to a flash document to mess it up so that components dont' show up on the swf, but are whited out?

Thanks very much in advance.

View Replies !    View Related
[F8] General Component Question
Hey all. I'm 'new' around here (used to be a regular years ago). I have a project I'm working on for a client where I will setup the site and they will maintain it when the design is done. I use about 3 components in the site right now and my question is this: If I have the components in use and create the .fla on my computer will my client need those components installed on their computer as well in order to publish the movie successfully? My guess is no, because every component shows up in the library. I just want to make sure before I hand it over and say "it's all yours". Thanks for the help!

View Replies !    View Related
Styling Components: _global.styles.Label.setStyle("autoSize", "true"); Does Not Work
According to the Flash 8 Actionscript Bible, it is possible to set a style that will affect all instances of a certain component class by typing the following code:
ActionScript Code:
import mx.controls.*;
import mx.styles.CSSStyleDeclaration;
_global.styles.componentClassName = new CSSStyleDeclaration();
_global.styles.componentClassName.setStyle("styleAttribute", "value");



A disclaimer says that "[this style technique] will work with almost all of the component classes. However, the following classes will not allow you to set a class style object: List, DataGrid, Tree, and Menu." (ch 29, pg 644)

So why does the following do nothing:
_global.styles.Label = new CSSStyleDeclaration();
_global.styles.Label.setStyle("autoSize", "true");

??

View Replies !    View Related
(Flash MX Or 8) List/List Component Issues
Hello all.

I recently completed Kirupa's "Creating a Listbox" tutorial, (http://www.kirupa.com/developer/mx/listbox.htm) but have been having a difficult time modifying the event attributes of each list item. Basically, I want to click on an item and have an object on the stage move to a unique xy coordinate. I can get the object to move already (object._x = object._x +10, but unfortunately ALL items on the list execute this script command. I've tried fooling around with the code to get each item to do a unique movement but...well, clearly I haven't succeeded yet.

I'm a Flash nooby and help in the form of specifics would be greatly appreciated. If you can provided modified code from the tutorial to move an object to a unique positions that's even better.

Thanks.

David

View Replies !    View Related
List Component. Help. Looked Everywhere. Button And List.
Trying to use a list component and a button. When user selects something from list component and clicks button it takes them to new page, if user doesnt select something from list and hits button, (this is where my question lies) I want it to do nothing and setFocus to list component.

Here is how I am going about it now: New if statement (however it still transfers user if nothing is selected from list component) How can I get it to not transfer? I have tried rewritting this many ways, searched all over the nets, and Nada.


Code:
var arUrl:Array=["/browsecategory.aspx?cat=1","/browsecategory.aspx?cat=2","/browsecategory.aspx?cat=3","/browsecategory.aspx?cat=4"];

var provider:Array=[{label:"Option 1",data:0},{label:"Option 2",data:1},{label:"Option 3",data:2},{label:"Option 4",data:3} ];

mcList.dataProvider=provider;
var obj:Object={};
obj.click=function(eo:Object)
{
var count:Number=mcList.selectedItem.data;
getURL(arUrl[count],"_blank");
trace("count="+arUrl[count]);
}
but.mcSubmit.addEventListener("click",obj);/////here is where I am sending off
if(mcList.selectedIndex == undefined) {
setFocus.mcList;
}
So this thing works perfectly, however if user hasnt selected anything how can I get it to not transfer and setFocus?

I have tried setting if to check it for - 1 (since starts at 0) set to 0? Any ideas please help. Thanks in advance MT

View Replies !    View Related
Styling Dynamic Text?
Hi,

I have a large MC filled with text that I want to add a scrollbar to, the problem is, you can only add a scrollbar to a dynamic text box! Unfortunately the moment I convert static text to dynamic text it messes up all my carefuly styled copy!

Is there some way I can keep my headings (14px Arial Bold Red) and my body copy (11px Arial Plain Black) looking nice and stylish in a dynamic text box?

When I make it a dynamic text box, it previews everything as 14px Arial Bold Red (aargh!)

-- spiral

View Replies !    View Related
Styling Dynamic Text, How?
I have a dynamic text field that I load an external txt file into, and that works just perfectly. The problem occurs when I try to style my text with an external CSS file. I know I have to load the CSS file first or it won't get applied to the text field and I have made sure to do that, but I still can't get it to work. plz could someone tell me what's wrong with my actionscript? I would really appriciate it:


Code:
// ----------------<load CSS>----------------- \
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.load("styles/styles.css");
cssStyles.onLoad = function(success) {
if (success) {
loadedInfo.syleSheet = cssStyles;
_level0.myLV.load("vars/mainTxt.txt");
} else {
loadedInfo.text = "There has been an error loading the requested information. Please contact the webmaster and report your error.";
}
}
// ----------------</load CSS>----------------- \


and here's an exerpret from my text file:

Code:
info=<textformat leading="3"><p><span class="hilight">(1) This is found on Mission 2,</span> . . . . </p></textformat>


and lastly here's my CSS file:

Code:
p {
font-family: sans-serif;
font-size: 11px;
}

.hilight {
font-weight: bold;
}

a:link {
color: #A9A9A9;
text-decoration: underline;
}

a:hover {
text-decoration: none;
}


thx in advnace.

View Replies !    View Related
Styling Dynamic Text
Hi everyone I have created a dynamic text field which scrolls, my problem is I want to add some style to the text, but when i edit one thing e.g a title the whole text changes, how do i go about just styling single pieces of text? any help is greatly appreciated.

Thanks

View Replies !    View Related
Dynamic Text Styling
I am using a dynamic text field with some text inside it. I would like to make some headings within the text BOLD and a different Colour then the rest of the text. Is this possible? I am also scrolling the text field using the generic scroll bar.


Thank You.

View Replies !    View Related
Styling Xml Imported Text Via Css
I'm trying to just figure out how to style text imported via xml with css. Here's the code I have. It imports the XML just fine, but there is no style. I've also included the xml + css files.

Any ideas?

Actionscript:

ActionScript Code:
import flash.text.StyleSheet;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;

loadCSS();

function loadCSS() {
    trace("loadCSS");
    var cssLoader:URLLoader = new URLLoader();
    cssLoader.load(new URLRequest("test.css"));
    cssLoader.addEventListener(Event.COMPLETE, cssComplete);
}

function cssComplete(e:Event) {
    trace("cssComplete");
    var sheet:StyleSheet = new StyleSheet();
    sheet.parseCSS(e.target.data);
    textObj.styleSheet = sheet;
   
    loadXML();
}

function loadXML() {
    trace("loadXML");
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.load(new URLRequest("forcss.xml"));
    xmlLoader.addEventListener(Event.COMPLETE, xmlComplete);
}

function xmlComplete(e:Event):void {
    trace("xmlComplete");
    var xml:XML = new XML(e.target.data);
    textObj.htmlText = xml.point[0];
}

XML:

Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<data>
<point><=!=[=C=D=A=T=A=[<h1 class="test">Test</h1><br><br><p>test test test test </p><p>test test etst ste</p>]=]=></point>
</data>
CSS:

Code:
.test {
font-size: 20px;
color: #0000ff;
}

View Replies !    View Related
Styling Text With Script?
Hi,

I have a text field that reads data in from an array, that is displayed randomly in my flash movie, however id like to style it so that the second part of the array is displayed bold and on a new line.

the array with the text looks like the following:-


Code:
_global.homeInfo = new Array(
"Travel and tourism" + "Visa",
"Leading industry analysts" + "unknown",
"An estimated 12m Britons" + "Interactive Media",
"Online retail is currently worth £19bn." + "BMRB",
to display the text on the screen i use the following (text box is info_text)


Code:
info_txt.text = homeInfo[int(Math.random()*homeInfo.length)];
is it possible to have the second part of the array i.e. visa, or unknown, to be displayed BOLD, on a new line, but in the same info_txt text box?

will i be able to contain it all in one text box and apply style or will i have to break it up, any help would be ace, been puzzled too long and its late...

Hope this makes sense,

cheers

Will

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved