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




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.



ActionScript.org Forums > Flash General Questions > Flash 8 General Questions
Posted on: 11-24-2006, 08:51 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

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

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.

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

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.

Dynamic Text Styling
I am trying to style my text box with CSS in Flash. I have the following AS.

stop();

var thePath:MovieClip = this.scroller_all.scroller_slider;
thePath.infoScroll.textbox.html = true;
thePath.infoScroll.textbox.autoSize = true;
thePath.infoScroll.textbox.condenseWhite = true;

var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.setStyle("h1", {fontWeight: "bold", color: "#000000"});

thePath.infoScroll.textbox.styleSheet = cssStyles;

//Text Scroller 01
var lvInfo:LoadVars = new LoadVars();
lvInfo.onData = function(sInfo:String):Void {
thePath.infoScroll.textbox.htmlText = sInfo;
}
lvInfo.load("info.html");



Why is this not working? The text loads, but does not get styled by the css.

Thanks a lot!

Styling Dynamic Text
How come I can't bold, italisize, or resize dynamic text? You can see the styles appear when making the movie, but when testing it, it is just plain text.

Styling Text In Dynamic Boxes
hi there

I have a dynamic text box which displays a combination of other input text boxes.

I 've scripted the following to show the information:

ViewScript_mc.script_txt.text = "CHARACTER A:" + a1 + "CHARACTER B:" + b1 +"STAGE DIRECTION" + sd1;


where a1, b1, & sd1 are the variables of the input text boxes

this displays the infomation in a continuous line, I want to be able to separate each section with a paragraph /line spacing.

I've seen the symbol /r in text copied from simpletext but this doesnt seem to be working when typed in.

is there a "tag" i can input into my actionscript to push the next line of text over ?

Is it possible to display it as html instead?

Id appreciate any help on this

Thanks a lot !

Rob

CSS Styling In Dynamic Text Boxes
Does any one know how I would combine these two codes?

CSS in text boxes:


Code:
var format = new TextField.StyleSheet();
var path = "http://www.kirupa.com/developer/mx2004/code/flash.css";
var quick = "<br><p class='one'>The quick Kirupa jumps over the lazy dog.</p><br><p class='two'>The quick Kirupa jumps over the lazy dog.</p><br><p class='three'>The quick Kirupa jumps over the lazy dog.</p><br><p class='four'>The quick Kirupa jumps over the lazy dog.</p>"
format.load(path);
format.onLoad = function(success) {
if (success) {
textbox.styleSheet = format;
textbox.text = quick;
} else {
output.text = "Error loading CSS file!";
}
};
Loading dynamic text:


Code:
loadVarsText = new LoadVars();
loadVarsText.load("about.txt");
loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");

textbox.htmlText = this.var1;
} else {
trace("not loaded");
}
};
I'd like to load dynamic text with CSS styling into my textbox.

Dynamic CSS Styling
Basically I'm trying to format some dynamically loaded text with CSS from a database via asp, I know that the asp works fine as it loads in, its just applying a style to the loaded text that doesn't work.

This is a modified version from the Kirupa tutorial, but I cannot get it to work after many, many hours. Help!!!!



Code:
var MediaAccess = new TextField.StyleSheet();
MediaAccess.load ("media.css");
MediaAccess.onLoad = function (loaded)
{
var info:TextField = _root.createTextField ("info", 4, 100, 50, 200, 30);
info.border = true;
info.html = true;
if (loaded)
{
info.styleSheet = MediaAccess;
newsData = new LoadVars();
newsData.load("getdetails.asp?Record=0");
newsData.onLoad = function (success){
if (success == true){
info.htmlText = unescape(this.Name);
}
}
} else {
info.text = "uh this is not working";
}
};

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

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;
}

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

Styling Text Box Of A Combobox
Hi --

I have a comboBox that I am styling using this code:

new_style.setStyle("embedFonts",true);
new_style.setStyle("fontFamily", "Gibraltar-Plain");
new_style.setStyle("color", 0x653a71);
new_style.setStyle("fontSize", 12);
new_style.setStyle("rollOverColor", 0x653a71);
new_style.setStyle("textRollOverColor", 0x000000);
new_style.setStyle("selectionColor", 0xDDDDDD);
new_style.setStyle("textSelectedColor", 0x000000);

forminputs_mc.states_cbx.setStyle("styleName","cbxStyle")


When I click on the drop down I see the items in the combo box but whenever
I select an item the item shown in the combo box is empty. If I change the
font to a non-embedded font it works fine. How do I set the "textField" to
have the embedded font so it displays properly?

Thanks

Rich

Styling Text On V2 Buttons
I am using the V2 button component and I have successfully skinned it via an AS script but I can't see how to style the text on my buttons so that the color of the text changes on rollover. I also can't see how to position the text on the button rather than allowing it to center itself on the button. The button is very wide and the text should be close to the left hand side. I'm hoping that someone with a deeper understanding of the component architecture can point me in the right direction.

Styling Text On V2 Buttons
I am using the V2 button component and I have successfully skinned it via an AS script but I can't see how to style the text on my buttons so that the color of the text changes on rollover. I also can't see how to position the text on the button rather than allowing it to center itself on the button. The button is very wide and the text should be close to the left hand side. I'm hoping that someone with a deeper understanding of the component architecture can point me in the right direction.

Styling A Text Field With CSS - URL Problem
I'm trying to load an XML file and a CSS file to style some text. So my code works perfectly fine like this:

Code:
var paramObj:String = stage.loaderInfo.parameters.xmldoc;
var textLoader:URLLoader = new URLLoader();
var textReq:URLRequest = new URLRequest(paramObj);
var cssLoader:URLLoader = new URLLoader();
var cssRequest:URLRequest = new URLRequest('alumniconnectionflash.css');
var style:StyleSheet = new StyleSheet();

function cssLoaded(evt:Event):void {
style.parseCSS(evt.target.data);
}

cssLoader.addEventListener(Event.COMPLETE, cssLoaded);
cssLoader.load(cssRequest);
description_txt.styleSheet = style;
textLoader.load(textReq);
As soon as I change the css file name to an absolute URL, which appears fine on the screen when I go to it, the CSS stops working. Any ideas as to why or how I can fix it?

Strange Text Styling Problems
http://www.musoka.ax86.net/flash/test.html

I have included some AS code to load data from a XML file(the left side "blog" area). The titles of the blog entries are styled incorrectly when exported. They come up looking like some strange version of Times New Roman rather than the Arial I set them to.

I dont understand what I did wrong. It has also happened in previous templates that I have added the XML/External data to.

Loading XML-text With Tags And Styling It
Hey! First post here!
I have a weird problem which occurs when I try to load in XML-data with HTML-formatting (links and other tags). I get unwanted row breaks in Flash when I do this. The weird thing is if I don't load it through XML and instead just write it in a string, it doesn't get any unwanted row breaks.

Here is the AS3 code (and then I just created a dynamic text field named theText)


Code:
var cssStyle:StyleSheet = new StyleSheet();

cssStyle.parseCSS("h1{ font-size: 16px; } a {font-weight:bold; text-decoration:underline} a:hover {font-weight:bold; text-decoration:underline;color:#999999}");

var xmlnamn:Number;

var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();

xmlLoader.addEventListener(Event.COMPLETE, LoadXML,false,0,true);
xmlLoader.load(new URLRequest("cont4.xml"));

function LoadXML(e:Event):void {
xmlData=new XML(e.target.data);
texten(xmlData);
}

function texten(inladdad:XML):void {
theText.styleSheet=cssStyle;
theText.htmlText=inladdad.text;
}
XML-file (cont4.xml)


HTML Code:
<content>
<text>Ett flitigt <a href='hej'>fingrande</a> på <b>mobilen</b> hör numera julen till. På julafton skickade svenskarna sms som aldrig förr. Noteringen blev över 60 miljoner meddelanden, men troligen slås rekordet redan vid nyår.<h1>Rubrik</h1>Alla de fyra operatörerna Telia Sonera, Tele 2, Tre och Telenor rapporterar nya högsta noteringar från julafton. Jämfört med julen 2007 ligger ökningarna på 20–30 procent. Ännu större är uppgången när det gäller bildmeddelandena mms – men de flesta julhälsningar med mms skickas under december före julafton.
Tydlig trend
</text>
</content>
Thanks in advance! Anyone else had this problem? Tried to google it and search the forum but couldn't find anything..

Loading External Text And Styling
Hi,

I have a couple of questions:

- im loading external text into my flash file. It loads no problem, but it wont render as html (yes i have the button selected. it just includes the <p>etc. tags as part of the text?? Have i missed something really basic? (very likely).

- can anyone suggest a good tutorial for attaching a css to external text? I have tried one, and im not sure whether it works or not because of the problem above!

ive attached my code below... if it helps!

cheers...


/*-loading the first bit of text-----------------------------*/
var dataabout:LoadVars = new LoadVars();
dataAbout.onLoad = function(success){
if (success){
_root.contentAbout_mc.contentAbout_txt.text = this.content;
}else{
_root.contentAbout_mc.contentAbout_txt.text = "error loading enviroguard content text";
}
};
dataAbout.load("text_files/about_enviroguard.xml");

/*-loading the CSS-----------------------------*/
var sheetCSS = new Textfield.Stylesheet();
var sheetLocation = "styles/flash.css";
sheetCSS.load(sheetLocation);
sheetCSS.onLoad = function(success){
if(success){
dataAbout.stylesheet=sheetCSS;
dataAbout.text = this.content;
}
}

stop();

Formatting/styling Dynamically Loaded Text
I'm using Flash MX and I've got text that's loaded externally from a .txt file into a text area set to receive dynamic text. I'd like to be able to format different parts of the text, like underline or colorize specific words or phrases.

I've attempted to have the text area render the loaded text as HTML, then I include text formatting tags in the file, (for instance <p color="blue">) but this only seems to color all of the text. I also tried linking a style sheet from the text file, but this doesn't work either.

Any suggestions?

-Scot

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?

Help Needed On Styling And Replicating Text Field
As a new AS3 coder I'm at a little bit of a loss on the most efficient way to replicate a styled text field.

I would like to use the following styled text info and load some text from an array. Do I need to create all this styling for every instance of the text in the array or can I create several new instances of the field in my function?

Thank you in advance for your help.


ActionScript Code:
var headlines:TextField = new TextField();var headline:TextFormat = new TextFormat();headline.size = 20;headline.font = new HelvBlack().fontName;headlines.alpha = 0;headlines.setTextFormat(headline);headlines.embedFonts = true;headlines.autoSize = TextFieldAutoSize.LEFT;

Styling A Combobox Dropdown Text When Highlighted
Hi!
I need to change the rollover color of the combobox's dropdown using AS3.



Code:

var textf:TextFormat = new TextFormat();
textf.font = "Arial";
textf.size = 11;
textf.color = 0xFFFFFF;
textf.bold = false;

drpCars.setStyle('themeColor', HighlightRenderer);
I've tried loads of different solutions, however the closest i got was to change the whole dropdown when rolled over by using a custom cell renderer. Is it possible to identify and modify the rendering of the currently highlighted dropdown option?

Any help would be greatly appriciated,
Cheers

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.

Form Field Styling (Input Text Formatting)
Is there a way to format multiple form fields (input text) at the same time? For instance, I have a form with 10 input text fields and I want all of them to have black borders and gray backgrounds. To do this, I've coded one as:
txtInput1.border = true;
txtInput1.borderColor = 0x000000;
txtInput1.background = true;
txtInput1.backgroundColor = 0xCCCCCC;

Is there a way for me to create a sort of "style" that I could apply all of these values to a text input easily, the way TextFormat can apply text styles?

Styling The <li>
Styling the <li> attribute is not supported - I thought I read something about it but... my memory banks are corrupted.
I know I can do something with an image but maybe someone can jog my memory?

Styling
How do you style radio buttons?

Styling Xml With Css In Flash
Hi,

I'm having problem with applying css to xml to display in flash.
Here is xml file:

<?xml version="1.0" encoding="iso-8859-1"?>s
<records>
<record>
<Special>Can be updated to reflect change</Special>
<Bonuses>
<Bonus>january bonus distribution</Bonus>
<Bonus>XML is always linked to allow</Bonus>
<Bonus>We will also be able to update7 </Bonus>
</Bonuses>
</record>
</records>
-----------------------------------

CSS file:

Bonus {
color: #FF0000;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 18px;
font-weight: bold;
display: block;
}

This style is not getting applied to <Bonus > node in xml which is bieng displayed is flash. But css is loading in flash.Is there any mistake in applying css to xml?. Please help...

Thanks in advance..

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.

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

Styling Font
Hello amigos/amigas. I am trying to style some font I'm importing from a simple .txt file. I know how to set the font family, size, etc. however, I want to change the style of the font as well as the family. The font I am defining is "frutiger", but I also want to add the style property "57 Condensed". How do I define that? I'll post my code here below. I know this is most likely a very simple answer - I'm learning.

I appreciate any help. Cheers.







Attach Code

var external_txt:TextField = new TextField();
var myFormat:TextFormat = new TextFormat();
var externalReq:URLRequest = new URLRequest("external.txt");
var externalLoad:URLLoader = new URLLoader();

externalLoad.load(externalReq);

externalLoad.addEventListener(Event.COMPLETE, textReady);
up_btn.addEventListener(MouseEvent.CLICK, scrollUp);
down_btn.addEventListener(MouseEvent.CLICK, scrollDown);

myFormat.font = "Frutiger";
myFormat.color = 0xFFFFFF;
myFormat.size = 14;
myFormat.bold = true;

external_txt.x = 0;
external_txt.y = 0;
external_txt.border = false;
external_txt.width = 600;
external_txt.height = 375;
external_txt.wordWrap = true;

addChild(external_txt);


function textReady(event:Event):void
{
external_txt.text = event.target.data;
external_txt.setTextFormat(myFormat);
}


function scrollUp(event:MouseEvent):void
{
external_txt.scrollV --;
}

function scrollDown(event:MouseEvent):void
{
external_txt.scrollV ++;
}

Styling A Scrollbar, How?
I'm back again with another question :-)

Does anyone know how I would go about changing a scrollbar component? Instead of having the big box with borders around it, I want something very simple. Basically just a scrollbar, even with that I don't want any arrows or anything just a little bar the user can dgar up and down.

I checked the site and found the great tutorial on using the scrollbar component with dynamic text. This is perfect for what I want, it's just I don't like the scrollbar style.

Can anyone help me out?

Importing Xml And Styling With 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;
}

Styling Combobox In AS2
Hi All

I'm trying to customise a combobox in AS2, and can't seem to get to where I want to. You can see an example if you click the "Buy online" button here:

http://linusdesign.co.uk/sites/mp3/mp3-player.html

There are a few things I can't figure out:

1) Why is there a 1px gap to the left of highlighted items? I'd be happy with a 1px gap all the way round, but can't figure out why there's just a 1px gap on that side. For reference, this is all the styling I have applied to it:


Code:
new_style.setStyle("fontFamily", "Lucida Grande");
new_style.setStyle("rollOverColor", "0xDDDDDD");
new_style.setStyle("selectionColor", "0xAAAAAA");
new_style.setStyle("textSelectedColor", "0xFFFFFF");
new_style.setStyle("textRollOverColor", "0xFFFFFF");
new_style.setStyle("selectionDuration", 0);
new_style.setStyle("borderStyle", "solid");
new_style.setStyle("borderColor" , "0x999999");
new_style.setStyle("themeColor" , "0x999999");
2) Is there a way to change the size of the rounded, button part of the comboBox? I've found how to cutomise the arrow part on the right, but not the left section. (Basically I just want to take a couple of pixels off it's height.)

3) Is there a way to hide the 1st item ("Buy online") in the drop-down list? Obviously for this kind of list you don't need it repeated in the list itself.

Many thanks for any help - these might seem like small things but I've been googling for ages and they're really annoying me!

Frank

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 :-)

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?

Styling A Link In HtmlText
Hi there.

I'm in a bit of a muddle. How do I style a link in an htmlText box. All I want to do is change the color. The htmlText is dynamic, so I can't do it by hand. Can I use CSS?

Thanks

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

CSS Styling From AS, Not External File
I'm trying to apply some simple CSS coding to an html'd dynamic text box, from *inside* Flash 8, with AS, rather than from an external .css doc.

I found the code below online; it is similar to many others I've seen. I think it should work, but doesn't. (I tried adding a period in front of customClass--nuthin'; I also tried taking out the fontFamily altogether, as I'm on a Mac and I've heard bad things.)

I'd like eventually to modify it to allow loading from an html'd external file, which I generally know how to do. I've tried coding that purports to apply ActionScript-based CSS styles in that circumstance, but I couldn't get them to work either.

Frankly, I've tried this on two other forums and no one's replied.

Any ideas? TIA.

/*
var styles = new TextField.StyleSheet();
styles.setStyle("p", {textDecoration:"none", color:"#000000"});
styles.setStyle("customClass", {fontFamily:"_serif",fontWeight:'bold', color:"#FF0000", fontSize:'24px'});
html_fld.html = true;
html_fld.styleSheet = this.styles;
html_fld.htmlText = "<p class='customClass'>Should be red</p><p>Should be black and <span class='customClass'>red again</a></span></p>";
*/

Flash Pop Up Photo Styling
Tried to learn this everywhere, can anyone help. Its killing me!

I am looking to create something similar to this: (http://www.centor.com.au/europe/gallery_folding.html) when you click on the images a pop up larger image is created. Can anyone show me how to do this or point me to a tutorial. I am pretty new to flash so any advice would be great.

If you click on any of the images (small thumbnails) they blow up through a nice flash sequence, each one to its own size??????????????

Please help me out here.

Help Styling A Checkbox Label
may seem silly, but I'm having a hard time finding a way to style labels for checkboxes

I've already got the checkboxes on the stage (dragged them on stage), and I need to style all of them the same way.

All that I've seen about loading a stylesheet refers to loading that "onto" an object, not multiple objects or the whole piece in general

Thanks for the help, sorry if this is a little basic.

Styling TextFields And DisplayObjects With CSS
Hello!

I'm currently working on a website in AS3 that will be multilingual and can have multiple themes.

The different themes consist of certain elements having different background colours, text colours, etc.

I found some code earlier today that loads in an external CSS file and styles DisplayObjects. The code is located here. Sadly it was built for AIR, but after some tweaking I got it kind of working.

The problem being, it only works on DisplayObjects, not TextFields, and even then, it's iffy at best.

What I am asking is, does anyone know of a preexisting package/class for altering DisplayObject properties and TextField CSS using 1 CSS file?

I bloody hope so or I'm going to have to make one

Simple Styling Issue
http://entertainment.signonsandiego.com/profile/218638

Hello all, I now have a problem with a little styling quirk. Perhaps you can help me? If you first scroll the MP3 player a little then mouse over the link to the song "Goodnight, Goodnight" you will see that all the text below it jumps to the right to align with it. I have set display to inline, but it still all jumps on mouseover. I wonder if it has something to do with the bullet images I am using. I wasn't able to style list items so they wouldn't be too far to the right. Would appreciate any tips you can offer.

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.

Styling & Skinning Best Practices
Hi,

I'm writing an ActionScript-only application (a single #include in the .fla file). I want users to be able to change the look of the application. Can you guys give me pointers on the best way to approach this.

For the color schemes, I'm thinking of using a css style sheet and use it to style both text and objects (lines, fill colors, etc.). For the icons and graphic elements, I'm not sure which way is the best. I want to keep the application as modular as possible. Basically I would like somebody to be able to skin the application by simply changing a style sheet and a library of icons.

Any recommendations ? TIA.

Styling One Element Of A Concatenation
A user types input into 5 or so text fields. Following this a button is clicked which triggers a concatenation of all the fields. The result (with added spaces and punctuation) is then displayed in another field. The catch is that one of the input fields has to displayed as italicized. I have set a new format for the specific input field that causes the input text to be displayed as italicized. However, when all the fields are added together and displayed in the new text field, the formatting is either dropped or the text Field instance name is displayed.

I can post specific code but basically it is this:

//create format for input field
var myformat_fmt:TextFormat = new TextFormat ();
myFormat _fmt.italic = true;

this.onEnterFrame = function () {
myTextField_txt.setTextFormat(myFormat _fmt);
}

//a button to cause concatenation and display of results
createTxt_btn.onRelease=function (){
var myStringA_str:String = new String(textField1_txt + " (");
var myStringB_str:String = new String(textField2+ "). ");

//concat field called "complete_txt is displayed, html properties are set
//this includes a botched attempt to add HTML formatting...crap ensues

complete_txt.html = true;
complete_txt.multiline = true;
complete_txt.wordWrap = true;
complete_txt.htmlText = myStringA_str + myStringB_str + "<i>myTextField_txt.</i>" +".";
}

The above code produces italic formating in the final string but I get the instance name (myTextField_txt) instead of the content of that field! Is there some operator that lets you use HTML tags with strings?

There seems to be no documentation that talks about this specific case. Even if I don't use the strings and set the htmlText to be a mega-concatenation the required italic formating is shown with the name of the text field.

(Meanwhile my cubicle neighbor keeps laughing and telling me to ditch Flash and use Java but that's another forum topic)

Any thoughts would be very helpful.

Bill

Styling Input Fields - AS2
I have a project in which I generate many different text fields which need to be styled using CSS. I have successfully attached style sheets to the dynamic fields and styled the text by adding HTML tags but is there a way that I can apply a style to an input field so that any text the user inputs will take that style.
Seems like it should be simple enough and I guess you could use TextFormat to do it but as I have my StyleSheet it seems silly not to use it.

Cheers all

[AS3] Styling HtmlText In TextArea
Hi,

How can I style my html content of a TextArea? I tried it like this but it keeps throwing errors:

var h1:Object = new Object();
h1.fontFamily = "DistrictThin";
h1.color = "#FFCC00";
h1.fontSize = 30;
h1.leading = 15;
h1.display = "block";

var css:StyleSheet = new StyleSheet();
css.setStyle("h1",h1);

var styledTxt:TextArea = new TextArea();
styledTxt.width = textBox.width;
styledTxt.height = textBox.height;
textBox.addChild(styledTxt);

styledTxt.styleSheet = css;
styledTxt.htmlText = '<h1>Lorem Ipsum</h1><p>dolor sit amet dolor sit amet dolor sit amet</p>';


--------------------------------------------------------------------------
Error: Error #2009: This method cannot be used on a text field with a style sheet.
at flash.text::TextField/set defaultTextFormat()
at mx.core::UITextField/set htmlText()[C:devGMCsdkframeworksmxcoreUITextField.as:3 14]
at mx.controls::TextArea/mx.controls:TextArea::commitProperties()[C:devGMCsdkframeworksmxcontrolsTextArea.as: 1787]
at mx.core::UIComponent/validateProperties()[C:devGMCsdkframeworksmxcoreUIComponent.as:5 218]
at mx.managers::LayoutManager/mx.managers:LayoutManager::validateProperties()[C:devGMCsdkframeworksmxmanagersLayoutManage r.as:517]
at mx.managers::LayoutManager/mx.managers:LayoutManager::doPhasedInstantiation()[C:devGMCsdkframeworksmxmanagersLayoutManage r.as:658]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/mx.core:UIComponent::callLaterDispatcher2()[C:devGMCsdkframeworksmxcoreUIComponent.as:7 789]
at mx.core::UIComponent/mx.core:UIComponent::callLaterDispatcher()[C:devGMCsdkframeworksmxcoreUIComponent.as:7 732]
at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
at flash.utils::Timer/flash.utils:Timer::tick()
--------------------------------------------------------------------------

Thanks!

CSS Styling From AS Not External File
I'm trying to apply some simple CSS coding to an html'd dynamic text box, from *inside* Flash, with AS, rather than from an external .css doc.

This code below should work, but doesn't. (I tried adding a period in front of customClass--nuthin'; I also tried taking out the fontFamily altogether, as I'm on a Mac and I've heard bad things.)

Any ideas? TIA.

/*
var styles = new TextField.StyleSheet();
styles.setStyle("p", {textDecoration:"none", color:"#000000"});
styles.setStyle("customClass", {fontFamily:"_serif",fontWeight:'bold', color:"#FF0000", fontSize:'24px'});
html_fld.html = true;
html_fld.styleSheet = this.styles;
html_fld.htmlText = "<p class='customClass'>Should be red</p><p>Should be black and <span class='customClass'>red again</a></span></p>";
*/

Copyright © 2005-08 www.BigResource.com, All rights reserved