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




Getting A Dynamic Text Box's Text From HTML-formatted Text?



Hey! You recognize me yet? I've got (hopefully) one last question for a while. Could somebody please tell me how do to get the text value of a text box with text that's formatted as HTML? ( it was formatted similar to "textBox.htmlText = "...";")

I tried "myVariable = textBox.htmlText", but it just gave me the formatting garbage it's using (<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="12" COLOR="#000000"></FONT></P></TEXTFORMAT>) without the actual text that my users see. I also tried "myVariable = textBox.text;", but it returned a blank variable.


Many thanks, me Flash bruthas
Furry



FlashKit > Flash Help > Flash MX
Posted on: 12-07-2002, 06:06 AM


View Complete Forum Thread with Replies

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

Can HTML Formatted Text In A Dynamic Text Target A MC On A Main Stage?
'Ello g'vnr

I've a dynamic textfield, into which I added HTML formatted texts.
I would like to add hyperlinks to the texts, which will activate a movie clip on a main stage,... Effectively creating a tell target like action. Is this possible?
Has anyone done this successfully?

Dynamic HTML Text Fields Do Not Display Formatted Text?
Flashkit.com,

In Flash MX I am developing a lot of movies using dynamically populated html text fields. When the user does not have a font I used on their machine swapping happens on all dynamic and input fields. Only static fields display the corrent font. I make sure the text field properties are embedding the fonts. Still all of the dynamic html text fields do not display the formatted text. I have .fla samples I can email to anyone.

I have tried these macromedia solutions with NO success:

http://www.macromedia.com/support/fl...t_outlines.htm

http://www.macromedia.com/support/fl...namic_text.htm

http://www.macromedia.com/support/fl...haredfonts.htm

Does anyone have a working sample .fla they can send me?

-Jimmy

Dynamic HTML Text Fields Do Not Display Formatted Text?
Flashkit.com,

In Flash MX I am developing a lot of movies using dynamically populated html text fields. When the user does not have a font I used on their machine swapping happens on all dynamic and input fields. Only static fields display the corrent font. I make sure the text field properties are embedding the fonts. Still all of the dynamic html text fields do not display the formatted text. I have .fla samples I can email to anyone.

I have tried these macromedia solutions with NO success:

http://www.macromedia.com/support/fl...t_outlines.htm

http://www.macromedia.com/support/fl...namic_text.htm

http://www.macromedia.com/support/fl...haredfonts.htm

Does anyone have a working sample .fla they can send me?

-Jimmy

HELP HTML Formatted Dynamic Text?
hey,

does anyone know if it's possible to have html-formatted text pulled from a .txt file into a dynamic text box?

Ext Dynamic Html Formatted Text
Hi, i'm making a flash interface cd-rom and want to know how to do what i want to do..

i have a html dynamic text box and want this text box display the text written on the cd if the user dont have an internet connection, and display the text from an external file located at a specific url if the user have an internet connection.

If some1 know a place or a tut explaining how to work with external html formating text, plz let me know where i could get the answer or a part of the answer..

thnx..

Formatted Dynamic Text? (not Html)
I was wondering if I can dynamically load a text file that has three columns and have it appear in Flash with those three columns the same way.

It's just three separate peices of information on each line, separated by a tab.

When loaded into Flash, it's all wrong.

Thanks.

Dynamic HTML-formatted Text Not Quite Working
I'm creating a product demo that pulls text from a text file, which is HTML-formatted. I want to use a font that not everyone has, so I embedded the outlines (the "[...]" button). Problem is, the bits of text that I've bolded and italicized in the HTML formatting don't show up at all. The plain text works just fine.

Hmmmm

Any thoughts?

thanks,
benjy

LoadVars And HTML-formatted Dynamic Text
Hi all,

I'm running into a bit of a snafu with a dynamic text ticker I'm building. The ticker displays several headlines loaded into LoadVars object from a text file, and it's working fine as it is. The problem is that now the client wants to put hyperlinks into the headlines. Formatting the text strings with HTML tags shouldn't be difficult, but for some reason, everything between the tags just disappears when it gets into the text field.

I suspect the problem has something to do with string conversions when the data is loaded into the LoadVars object...however, when I trace the contents of the LoadVars object, the tags appear just as they should. The text field is configured to render HTML, and text fields have been properly referenced as mytext.htmlText. What's the problem??


Here's the relevant AS:
headlines = new LoadVars();
headlines.load("headlines.txt", "GET");
headlineArray = new Array();
textColor1 = new TextFormat();
with(textColor1){
color = 0xFBAF3F;
}
textColor2 = new TextFormat();
with(textColor2){
color = 0xF26530;
}
headlines.onLoad = function() {
for(i=1;i<=100;i++){
nextHeadline = "headline"+i;
if(headlines[nextHeadline]==null){
totalHeadlines = i-1;
trace(totalHeadlines);
break;
}
else{
headlineArray[i-1] = headlines[nextHeadline];
}
}
trace(headlines.headline1);
loadHeadlines();
}
function loadHeadlines() {
for(i=1;i<=totalHeadlines;++i){
duplicateMovieClip(this.textBox,"textBox"+i,i*25);
newTextBox = "textBox"+i;
this[newTextBox]._x = initX;
this[newTextBox]._y = 0;
this[newTextBox].text1.htmlText = headlineArray[i-1];
if((i%2)==0){
this[newTextBox].text1.setTextFormat(textColor2);
}
else{
this[newTextBox].text1.setTextFormat(textColor1);
}
}
tickerCover.swapDepths(this[newTextBox]);
inPlace = false;
}

Here's the text file I'm using, exactly as written but with dummy headlines for testing purposes. All the stuff between the tags vanishes, so headline1 reads: The Corporation 3!

&headline1=The Corporation <b>Starts World War</b> 3!&z=

&headline2=The Corporation Invades Cambodia!&z=

&headline3=The Corporation Invents New Brainwashing Techniques!&z=

&headline4=The Corporation Destroys Small Planet!!!!&z=

&headline5=The Corporation Bangs Shoe on Table at U.N. Summit!&z=

&headline6=The Corporation Introduces New Designer Skin Grafts!&

Please, please help. I'm under a tight deadline here.

many thanks in advance,
David Conner

Using A Html Formatted Dynamic Text Box As A Mask
How do I do this?
I tried but it doesn't show.

Trouble With Html Formatted Dynamic Text Box
Hi, I am loading an external text file into flash and I cant get the text to format properly. I am using MX 2004 and have checked the "Render text as HTML" property but when I go to test the flash movie the text displays all the HTML tags and doesnt change the format.

Example of text file:

[HTML]news=<html><b>Title here</b> blah blah blah</html>
&[/HTML]

Example of code the text box frame:


Code:
loadText = new LoadVars();
loadText.load("news.txt");
loadText.onLoad = function() {
news.text = this.news;
};
What am I missing?

Cant Figure Out HTML Formatted Dynamic Text?
Hi there!

I really hope someone can help me. I have lots of pages of text for this flash project Im working on & I have put all the text into one text file & am using variables to dynamically load the text into a text box on each external swf.

My problem is that I have decided to format the text using html, just put things in itallic & bold etc and it doesnt seem to work. After the 1st html tag, the text just dissapears. I have the format as html button pressed & have searched these forums & still cant find the answer. Please help!

My code on the 1st frame of the external swf is...


Code:
//loads text
loadText = new LoadVars();
loadText.load("axios.txt");
loadText.onLoad = function(success) {
if (success) {
//trace(success);
box.html = true;
box.htmlText = this.corptext;
delete this.onEnterFrame;
}
};
And my text file looks like this....


Code:
&corptext=<b>Axios Systems</b> is a leading provider of consolidated IT Service Management software solutions.&
But any text between the html tags dissapears. What am I doing wrong?

Your help is much appreciated

Cant Figure Out HTML Formatted Dynamic Text?
Hi there!

I really hope someone can help me. I have lots of pages of text for this flash project Im working on & I have put all the text into one text file & am using variables to dynamically load the text into a text box on each external swf.

My problem is that I have decided to format the text using html, just put things in itallic & bold etc and it doesnt seem to work. After the 1st html tag, the text just dissapears. I have the format as html button pressed & have searched these forums & still cant find the answer. Please help!

My code on the 1st frame of the external swf is...


Code:
//loads text
loadText = new LoadVars();
loadText.load("axios.txt");
loadText.onLoad = function(success) {
if (success) {
//trace(success);
box.html = true;
box.htmlText = this.corptext;
delete this.onEnterFrame;
}
};
And my text file looks like this....


Code:
&corptext=<b>Axios Systems</b> is a leading provider of consolidated IT Service Management software solutions.&
But any text between the html tags dissapears. What am I doing wrong?

Your help is much appreciated

Formatted Php/html File In An MX Dynamic Text Window
Hi everyone,

I have looked all around the forum for a specific answer to this but couldn't find one -- so if someone can guide me - it would be really appreciated. Again, if this has been posted somewhere I apologize --> pointing me at it would be fine too.

What I want to do seems like it should be pretty straightforward, but I can't get it to go.

I have a php script that pulls froma db -->
http://www.mswebsolutions.com/hdawg/holly_index.php

I have a Flash/swf file (done in MX) with a dynamic text window here -->
http://www.mswebsolutions.com/hdawg/live.swf

basically what I want is to show the php script - formatted as is IN the dynamic text window. (The name of the window is "bianco" if that helps).

Thanks again
kordic27

[F8] Search/Find Dynamic Text Formatted As HTML
Hi,

I'm new to AS and have searched the forums for this but have not found an answer.

Is it possible to search a dynamic text area component that is set to display HTML?

I've been able to load and search a text file but when i switch the component to display html, the search function stops working.

Is this just a parameter I haven't added somewhere?
Thanks for any help,

-rm

HTML Formatted Dynamic Text Not Displaying Properly In Windows
I have externally loading HTML formatted .txt files that display a little square anywhere there is an <B>apostrophe "s"</B>.

here is the link

http://3d-images.com/beta/viu%202005_metal.html

Please help!!!

HTML Formatted Dynamic Text Box Screws Up Font Whaa?
ive got some text in a dynamic text box, so i can use 'asfunction' to link it to frame labels within the site.

BUT, choosing dynamic text changes the resulting look of the font! it also totally balls's up the formatting. It totally ignores where i have put a new line (ie pressed enter(return)key). And it misses out half the text. Where the text box in flash normally constrains it and creates a new line, the text just dissapoears. I've tried sticking <br> in there but no love.

I am not linking to a text file, i am just placing the text in there in flash 8.

Im using CORDIA UPC for the site, a very nice clean font, and suddenly, when i preview it in my browser, its now arial or some such crap. or maybe its still the smae font but it looks crappy! its uglying up the scene...

whats the scoop here?
am i destined to have crappy text and usefull links or is there a sweet way round this.. please
thanks

HTML Formatted Dynamic Text Box Screws Up Font Whaa?
ive got some text in a dynamic text box, so i can use 'asfunction' to link it to frame labels within the site.

BUT, choosing dynamic text changes the resulting look of the font! it also totally balls's up the formatting. It totally ignores where i have put a new line (ie pressed enter(return)key). And it misses out half the text. Where the text box in flash normally constrains it and creates a new line, the text just dissapoears. I've tried sticking <br> in there but no love.

I am not linking to a text file, i am just placing the text in there in flash 8.

Im using CORDIA UPC for the site, a very nice clean font, and suddenly, when i preview it in my browser, its now arial or some such crap. or maybe its still the smae font but it looks crappy! its uglying up the scene...

whats the scoop here?
am i destined to have crappy text and usefull links or is there a sweet way round this.. please
thanks

[F9] Load Html Formatted Text Into Text Box In CS3
Hi,

I am making a website where i want to be able to edit the text in some of my text boxes externally - without having to create a new SWF every time. I found a good tutorial on how to do this here - http://www.oman3d.com/tutorials/flash/loadvars_bc/ but when I created it i got a lot of errors. Im using CS3 and the tutorial is for an earlier version, but i have no idea how to change the code to Actionscript 3.0.

If anyone could help me do this or suggest another method to load html formatted text into a text box in flash CS3 i would appreciate it.

Thanks
Chris.

Masking Xml Formatted Text In Dynamic Text Box
I'm using loadTextContent, and then putting the contents of that xml file into a dynamic movie clip. Everything is good until I try to put a mask on that textbox. I've tried making movieclip symbols out of the masked object, and also out of the text box. Neither seems to matter. The textbox just comes up empty, whenever it's in a mask.

Is there any way to do this?

Html Formatted Text In XML Doc
I have all my css class formatting tags for a ton of text in an xml file. The BIG problem with this is having to escape all the brackets < and > with < and > respectively. The problem is, there is so much text and so much formatting going on...I'm getting lost in all these tags and it's driving me bonkers. Does anyone know how to put < and > inside of an xml bracket??

thanks,
morgan

HTML Formatted Text Problem
I'm having a problem with html formatted text in Flash MX. I created a dynamic text box named (sText) which renders text as html formatted text. In another frame in entered the following:

sText = "<b><font color='#999999'>Test</font></b>
";
sText += "Second Line
";
sText += "Third Line
";

I am should see the following (Test is bold and gray):

Test
Second Line
Third Line

Instead I'm seeing this (Test is bold and gray):

TestSecond Line
Third Line

It appears that the return "
" doesn't work if it directly follows html formatting. The funny thing is that it works in another movie. Am I missing something or is this a bug?

Loading Formatted Text (html?)
I am building a Flash site for another designer. We have dynamic loaded images loading into the main movie and we need to have blocks of formatted text load that corrisponds to the images. I figure that one way to do it is to have the main movie dynamically load in(into a target MC) a swf that contains formatted text. That way my client will only need to edit a flash file when he needs to edit/change the text. BUT...his request is to have the ability to use html to format the text (format being font, centering, text color...ect..)
Is there a way to load a chunk of html txt into Flash?

Loading Html Formatted Text
I am loading a .txt file that contains variables that hold HTML text. I am them using dynamic text boxes to display the code.

This all works fine except if the bold tag ( < b > ) is used, the text it is used on disappears!!!

I have the text box set to "render text as HTML" and here is the code that I use to put the variables in the text box:

myText.html = true;
_root.myText.htmlText = textHolder.htmlVar;//"textHolder" is the movie clip that I load the .txt into


All the other html tags work fine, Anyone got a gues here???

Cheers

External HTML-formatted Text
I'm loading text in HTML format from an external text file.

Some characters work when I do ALT+045 or whatever. I can't get + or & to work though. How do I do these characters?

Html Formatted Text Question
Hey-
-i have a dynamic text box that pulls in html formatted text from a text file. The font i'm current using is Arial. Question is, to get bullets to show up for an unordered list, do you have to use certain fonts? I have embedded all characters for the font, but the bullets dont wanna show up...

any ideas?
-myk

Html Formatted Text In A Textbox?
Hi folks,

I am attempting to display html formatted text in a text box. Can I just set .html to true, or do I have to combine that with .htmlText = (html string here)?

Moock's 'Actionscript for Flash MX' , pg 847, states:

Quote:





To include HTML source code in an HTML-enabled text field, convert the characters <, >, &, ", ', to their equivalent HTML entity values; <, >, &, ", and &apos;, as discussed at: http://moock.org/asdg/technotes/sourceInHtmlField






My html string is as follows:
<FONT COLOR=#B5BD8E>cool bands</FONT><BR><FONT COLOR=#FFFFFF><U><A HREF=http://www.agathacrawl.com>agathacrawl.com</A></U></FONT><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>< BR>

I built a function that converts it to this:
<FONT COLOR=#B5BD8E>cool bands</FONT><BR><FONT COLOR=#FFFFFF><U><A HREF=http://>agathacrawl.com</A></U></FONT><BR><BR><BR><BR>&l t;BR><BR><BR><BR><BR>&l t;BR><BR><BR>

Here is my code to create the text box and point it to the html string:

Code:
this.createTextField("linksA", 100, 10, 162, 150, 209);
this.linksA.html = true;
this.linksA.htmlText = _root.Astring;
this.linksA.type = "dynamic";
this.linksA.embedFonts = true;
//this.linksA.setTextFormat(_root.typewriter12);
this.linksA.multiline = true;
this.linksA.wordWrap = true;


It displays the string but includes all the formatting tags, if I just point it to the regular html string, it displays nothing.

example at: http://thetradeonline.com > Links
Your help is GREATLY appreciated!

Loading Html Formatted Text? Help
MAn, I tried a couple tutorials on this and I can't seem to get it to work right.

I just want to load the text preferably on certain keyframes.

I want to eventually embed my fonts so the look right but the problem now is just getting trhem to display

Html Formatted Text Roll Over?
I have a text field that i am loading in html hrefs. Is there a way to add a roll over effect to that html formatted text field?

HTML Formatted Text Links
I have a bunch of dynamically loading text that is formatted with html tags for links etc, in the txt files. Everything is working great except when your over a link in one of the text fields, you do not get a 'hand'. I am afraid users will not realize that it is a link so I was hoping for either avice on how to get the 'hand' to appear.. or how to use CSS for a:hover states etc..



HTML Formatted Loaded Text Problem?
I have a button that when clicked, loads some text.

The text field has the 'render as html' option clicked.

The script is:

on (release) {
loadVarsText = new LoadVars();
loadVarsText.load("assets/September2/SatyaBrink/bio.xpq");
loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");
_root.display.text = this.var1;
_root.displayhead.text.setNewTextFormat();

_root.displayhead.text = this.var0;
_root.displayname.text = this.var2;
_root.displaydate.text = this.var3;
_root.displaytype.text = this.var4;
} else {
trace("not loaded");
}
};
}

But the loaded text does not seem to format to HTML. Anyone have any hints?


RJ

Loaded HTML Formatted Text Question
Hi,

I dont know how to put my question, so lemme do a bit of explaining..

HTML Enabled Dynamic TextField can load textual data and display basic HTML tags correctly. One of the coolest feature is you can actually have links by adding the proper HTML tags on your text such us:

<a href=........

Now my question is, is there a way to use such linking techniques, NOT TO LINK to a URL, but TO ACTUALLY CONTROL, or send commands to the Flash Movie???

For example:
I want to load a hyperlinked text data into my dynamic textfield.. something like a "click here" text..
but instead of the usual linking to urls, i want the movie to go to a certain frame when that text is clicked..

got me so far?

I know it can be done coz i saw this function i a book before, but I forgot which book was it, and i cant seem to find it. it's something like:

(in your *.txt)

<a href=actionScript:function()>click here</a>


or someting like that..

I would really appreciate help.

Thank you!

Loading HTML-formatted Text Files (a La PHP)?
I don't know much about PHP, but in the past I've used it to load text files with HTML coding in the body of my webpages.

I'm more or less switching over to Flash, now, though. AFAIK, since my webpages won't be mixed Flash / HTML, I could simply use links to acheive the same effect.

However, I wanted to avoid refreshing the page to give it that effect that it's integrated into Flash. If it has to refresh, it simply doesn't flow well with the rest of my webpage.

Basically I'm just looking for a simple way to load the content of my pages without refreshing (and without the use of frames). Can anyone point me towards what I'm looking for?

Thanks!

External Text - Dymanic HTML Formatted
Hi,

ok I have tried to find something current about this topic with no luck. What I wish to do is load a external text file with minor html formatting in it. I have the text file loading and I have the render HTML button clicked. Inside my text file reads the following.

var1=<html><body><B>Welcome test message</b>
this is some sample text to test html formatting in flash.
<b>i want this text bold</b>
<i>this text italic</i>
all done
</body></html>

now when the text file loads in flash I see all the code. I want the format to come through. I have also had a bit of a look on the macromedia website for current support HTML tags. I am using MX and the only document i can find is for version 5.

can anyone help me out here?

thanks

Wolfie

Problem Importing HTML Formatted Text
Hi. I am attempting to create an animation using a sequence of dynamic text fields which will contain colored html ascii characters. Here's what I've done so far:

I've taken a video clip and exported it into a sequence of jpeg image files. Then, I've taken each of the image files and run them through a jpeg to html converter (found at: http://www.text-image.com/convert ).

I would now like to take this dynamic html formatted text and import it into separate text fields within Flash.

I found what looked like it would solve my problems - a document on Macromedia's site explaining how use HTML text formatting. The URL I'm referring to is: http://www.macromedia.com/support/fl...s/htmltext.htm

I have gotten so far as to set the text field to "dynamic text," set the "render text as html" on, and give the text field a variable name. I then inserted a "set variable" action in the first frame of my movie, typed the text field name into the "variable" section and inserted the html (that was outputted from the jpg2html converter) into the "value" section.

I am still having no luck. Any suggestions? Thanks.

-Adam Newton

Input Textfield To---) HTML-formatted Text
I know about how you can load HTML formatted text in a Dynamic Textfield, like this. Thats easy, like this:


Code:
textField.htmlText = "<p align='left'>This uses single quotes</p>"
BUT what i want to know, if i have a "multiline input textfield", and i type some text with and skip lines with ENTER. How do i get the <br></br> tags in that typed text ???.

Does anyone have a clue?

Thanx allready
Extremefun1

HTML Formatted Text Missing In Linux
I've got a swf (version 7, as 2) that loads HTML formatted text (with corresponding CSS tags) from a .txt file, and everything seems to work well on Windows (so far I have tried Opera, Mozilla, Firefox, IE). But when I just tried to run it on a Linux dist (Ubuntu) all text is missing. It is just empty!

The CSS tags I used, just look similar to the one that follows:


ActionScript Code:
flashStyle.setStyle("headertext", {color: "#543314", fontFamily: "Arial,Helvetica,sans-serif", fontSize: "13px", fontWeight: "bold"});

I also tried to remove the fontFamily, but nothing seemed to happen. Does anyone have any thoughts? I found a rather similar thread thread, but i didnt get any wiser by reading it. Is it impossible to use HTML/CSS and Linux??

HTML Formatted External Text In Flash Bug?
Hi folks,

I have no issues with loading text etc. However I am noticing a strange thing happen when parsing in html code.

I have a text file which looks similar to:

Code:
&sectionCopy=<font size="16">blah blah big text</font>
blah blah blah <b>bolded text</b> more text.
the font size increases where asked to however the bold doesn't work. instead the contents of the bold tag are not output at all. as if it is working like a trim or similar.

has anyone else come accross this in MX04?

[MX 2004 Pro] HTML Formatted Text Area
I'm trying to load html-formatted text in from a file to put in a text area (which is set to render text as html text). The htmlFile instance is of XML type and it reads in the file correctly (I traced it) but when I assign it to the text area it reads as plain text instead of html-text. I use this code on loading event:


Code:
htmlFile.onLoad = function(success)
{
_root.txtArea.text=htmlFile;
_root.txtArea.html=true;
}
the text field reads a file like this:

Code:
this is an <b>html</b> file
and displays:
"this is an <b>html</b> file"
instead of:
"this is an html file"

What am I doing wrong?

Including Characters And Using Html Formatted Text
Is there a way to include characters AND use html formatted text in dynamic txt fields? Or, is there a way to include a font so that the text doesn't render all crappy looking?

Copy HTML Formatted Text Across TextFields
If you have two text fields and want to devide text content between those, how can you keep the HTML formatting? I use getLineText() to get the not visible text in the first text field and put it in the second field, but getLineText() donīt return the HTML formatting...

Scrolling HTML Formatted Text In Flash
Greetings, all!

I'm using the techniques discussed in this thread on ActionScript.org to load formatted HTML text into flash. I also want to scroll said text, and for that purpose I'd like to use Flashscaper's scrollbar. I've run into a bit of a snag, however.

The text displays fine. However, the scrollbar does not appear when initiated and the mask (a red rectangle) can be seen on the right side of the content area; not the entire thing, just a red area about 5-10 pixels wide. The text can be scrolled using the mouse wheel, so the scrollbar functionality is intact. I think this has something to do with the transition within the ContentText function, but when I comment that out, the text doesn't display at all, nor does the scrollbar. Listed below are the three components to this project.

ContentText.as:

Code:
package
{
import flash.display.MovieClip;
import flash.text.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.text.StyleSheet;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.*;


public class ContentText extends MovieClip
{
private var myURLLoader:URLLoader;
private var myURLRequest:URLRequest;
private var bodyTextField:TextField;
public var contentPage:String;
public var myTransitionManager:TransitionManager;

public function ContentText(paraString:String)
{
contentPage = paraString;
myURLLoader = new URLLoader();
myURLRequest = new URLRequest("data/styles.css");
myURLLoader.addEventListener(Event.COMPLETE, onLoadCSS);
myURLLoader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
myURLLoader.load(myURLRequest);
}
private function ioErrorHandler(evt:IOErrorEvent):void
{
trace('download failed');
}
private function onLoadCSS(event:Event):void
{
bodyTextField = new TextField();
var css:StyleSheet = new StyleSheet();
css.parseCSS(event.target.data);

myURLRequest = new URLRequest(contentPage);

bodyTextField.x = 50;
bodyTextField.y = 50;
bodyTextField.width = 200;
bodyTextField.height = 200;
bodyTextField.multiline = true;
bodyTextField.wordWrap = true;
bodyTextField.autoSize = TextFieldAutoSize.LEFT;
bodyTextField.selectable = false;
bodyTextField.styleSheet = css;
bodyTextField.condenseWhite = true;
addChild(bodyTextField);
myURLLoader.removeEventListener(Event.COMPLETE, onLoadCSS);
myURLLoader.addEventListener(Event.COMPLETE, onHTMLLoaded);
myURLLoader.load(myURLRequest);
}
private function onHTMLLoaded(evt:Event):void
{
// trace(evt.target.data);
bodyTextField.htmlText = evt.target.data;
myTransitionManager = new TransitionManager(this);
myTransitionManager.startTransition({type:Wipe, direction:Transition.IN, duration:5.5, easing:None.easeOut});
}
}
}
Scrollbar.as:

Code:
/**
* Flashscaper Scrollbar Component
* Customizable Scrollbar
*
* @author Li Jiansheng
* @version 1.0.0
* @private
* @website http://www.flashscaper
*/

package {

import caurina.transitions.*;
import flash.display.*;
import flash.events.*;
import flash.geom.*;

public class Scrollbar extends MovieClip {

private var target:MovieClip;
private var top:Number;
private var bottom:Number;
private var dragBot:Number;
private var range:Number;
private var ratio:Number;
private var sPos:Number;
private var sRect:Rectangle;
private var ctrl:Number;//This is to adapt to the target's position
private var trans:String;
private var timing:Number;
private var isUp:Boolean;
private var isDown:Boolean;
private var isArrow:Boolean;
private var arrowMove:Number;
private var upArrowHt:Number;
private var downArrowHt:Number;
private var sBuffer:Number;

public var scroller:MovieClip;
public var track:MovieClip;
public var downArrow:MovieClip;
public var upArrow:MovieClip;

public function Scrollbar():void {
scroller.addEventListener(MouseEvent.MOUSE_DOWN, dragScroll);
}
//
public function init(t:MovieClip, tr:String,tt:Number,sa:Boolean,b:Number):void {
target = t;
trans = tr;
timing = tt;
isArrow = sa;
sBuffer = b;
if (target.height <= track.height) {
this.visible = false;
}
scroller.addEventListener(MouseEvent.MOUSE_OUT, stopScroll);
scroller.addEventListener(MouseEvent.MOUSE_UP, stopScroll);
stage.addEventListener(MouseEvent.MOUSE_WHEEL,mouseWheelHandler);

//
upArrowHt = upArrow.height;
downArrowHt = downArrow.height;
if (isArrow) {
top = scroller.y;
dragBot = (scroller.y + track.height) - scroller.height;
bottom = track.height - (scroller.height/sBuffer);

} else {
top = scroller.y;
dragBot = (scroller.y + track.height) - scroller.height;
bottom = track.height - (scroller.height/sBuffer);

upArrowHt = 0;
downArrowHt = 0;
removeChild(upArrow);
removeChild(downArrow);
}
range = bottom - top;
sRect = new Rectangle(0,top,0,dragBot);
ctrl = target.y;
//set Mask
isUp = false;
isDown = false;
arrowMove = 10;

if (isArrow) {
upArrow.addEventListener(Event.ENTER_FRAME, upArrowHandler);
upArrow.addEventListener(MouseEvent.MOUSE_DOWN, upScroll);
upArrow.addEventListener(MouseEvent.MOUSE_UP, stopScroll);
//
downArrow.addEventListener(Event.ENTER_FRAME, downArrowHandler);
downArrow.addEventListener(MouseEvent.MOUSE_DOWN, downScroll);
downArrow.addEventListener(MouseEvent.MOUSE_UP, stopScroll);
}
var square:Sprite = new Sprite();
square.graphics.beginFill(0xFF0000);
square.graphics.drawRect(target.x, target.y, target.width+5, (track.height+upArrowHt+downArrowHt));
parent.addChild(square);
target.mask = square;

}
public function upScroll(event:MouseEvent):void {
isUp = true;
}
public function downScroll(event:MouseEvent):void {
isDown = true;
}
public function upArrowHandler(event:Event):void {
if (isUp) {
if (scroller.y > top) {
scroller.y-=arrowMove;
if (scroller.y < top) {
scroller.y = top;
}
startScroll();
}
}
}
//
public function downArrowHandler(event:Event):void {
if (isDown) {
if (scroller.y < dragBot) {
scroller.y+=arrowMove;
if (scroller.y > dragBot) {
scroller.y = dragBot;
}
startScroll();
}
}
}
//
public function dragScroll(event:MouseEvent):void {
scroller.startDrag(false, sRect);
stage.addEventListener(MouseEvent.MOUSE_MOVE, moveScroll);
}
//
public function mouseWheelHandler(event:MouseEvent):void {
if (event.delta < 0) {
if (scroller.y < dragBot) {
scroller.y-=(event.delta*2);
if (scroller.y > dragBot) {
scroller.y = dragBot;
}
startScroll();
}
} else {
if (scroller.y > top) {
scroller.y-=(event.delta*2);
if (scroller.y < top) {
scroller.y = top;
}
startScroll();
}
}
}
//
public function stopScroll(event:MouseEvent):void {
isUp = false;
isDown = false;
scroller.stopDrag();

stage.removeEventListener(MouseEvent.MOUSE_MOVE, moveScroll);
}
//
public function moveScroll(event:MouseEvent):void {
startScroll();

}
public function startScroll():void {
ratio = (target.height - range)/range;
sPos = (scroller.y * ratio)-ctrl;

Tweener.addTween(target, {y:-sPos, time:timing, transition:trans});
}
}
}
texttext.fla:

Code:
import ContentText;
var ct:ContentText;
var sb:MovieClip;
ct = new ContentText("data/loremipsum.htm");
ct.x = 100.0;
ct.y = 50.0;
addChild(ct);
sb = new Scrollbar;
sb.x = 500.0;
sb.y = 50.0;
addChild(sb);
sb.init(ct,"easeOutSine",2,true,2);
I know it's a lot of code, but any help that you can provide would be greatly appreciated!

As an update, I did get this sort of working by adding a button that brings in the scrollbar as a separate function. This works after the text's transition has completed. Perhaps I can simply tie the scrollbar function to a timer that fires when the text begins to load?

HTML Formatted External Text In Flash Bug?
Hi folks,

I have no issues with loading text etc. However I am noticing a strange thing happen when parsing in html code.

I have a text file which looks similar to:

Code:
&sectionCopy=<font size="16">blah blah big text</font>
blah blah blah <b>bolded text</b> more text.
the font size increases where asked to however the bold doesn't work. instead the contents of the bold tag are not output at all. as if it is working like a trim or similar.

has anyone else come accross this in MX04?

[MX 2004 Pro] HTML Formatted Text Area
I'm trying to load html-formatted text in from a file to put in a text area (which is set to render text as html text). The htmlFile instance is of XML type and it reads in the file correctly (I traced it) but when I assign it to the text area it reads as plain text instead of html-text. I use this code on loading event:


Code:
htmlFile.onLoad = function(success)
{
_root.txtArea.text=htmlFile;
_root.txtArea.html=true;
}
the text field reads a file like this:

Code:
this is an <b>html</b> file
and displays:
"this is an <b>html</b> file"
instead of:
"this is an html file"

What am I doing wrong?

HTML Formatted Text Vs. Unquoted Attributes
I'm having trouble loading HTML formatted text from an external file where some of the attributes of some of the html tags are not in quotes.

These two work fine...

Code:
<a href="linkhere.html">myLink</a>
<a href="linkhere.html" target="_blank">myLink</a>
This next one on the other hand just shows up as nothing... notice the lack of quotes around the "target" attribute.

Code:
<a href="linkhere.html" target=_blank>myLink</a>
Obviously I should just quote the attributes but the content is being loaded from a database populated with the use of a web based wysiwyg editor that just happens not to put quotes around the attributes.

Any ideas would be much appreciated.

Problem Importing HTML Formatted Text
Hi. I am attempting to create an animation using a sequence of dynamic text fields which will contain colored html ascii characters. Here's what I've done so far:

I've taken a video clip and exported it into a sequence of jpeg image files. Then, I've taken each of the image files and run them through a jpeg to html converter (found at: http://www.text-image.com/convert ).

I would now like to take this dynamic html formatted text and import it into separate text fields within Flash.

I found what looked like it would solve my problems - a document on Macromedia's site explaining how use HTML text formatting. The URL I'm referring to is: http://www.macromedia.com/support/fl...s/htmltext.htm

I have gotten so far as to set the text field to "dynamic text," set the "render text as html" on, and give the text field a variable name. I then inserted a "set variable" action in the first frame of my movie, typed the text field name into the "variable" section and inserted the html (that was outputted from the jpg2html converter) into the "value" section.

I am still having no luck. Any suggestions? Thanks.

-Adam Newton

Parsing HTML Formatted Text Via XML To Flash
Can anyone shed some light on this for me cause it has me stuck.

I am attempting to parse HTML formatted text to flash MX with XML as a string but Flash is getting confused when it brings it in, any suggestions??

Dynamic Formatted Text
Surely there is a way to be able to create a word document that is dynamiclly loaded in flash such as a loaded text file. IS THERE ANY BODY OUT THERE WHO CAN SHOW ME A STEP BY STEP PATTERN or send me an FLA AND .doc file for an example? PLEASE PERTTY PLEASE....

CSS Formatted Dynamic Text
Wsup.
First time, first thread.
I have a movie(let's call it movie B) with a dynamic text box. I'm formatting the text with an external css file. It all works fine until I load movie B into a parent movie(let's call the parent movie, movie A). Then the css doesn't work...? I've tried everything(I can think of) but it just doesn't work. Anybody out there with an idea on what my issue might be? I can send over my code if need be.

What's Wrong With My HTML Formatted Externally Loading Text?
I am trying to load in a text file into a flash movie which has some HTML formatting to it - there's very little i can find out about this on the web - it kinda works..

here's my external text file..

history=<B>History of BodyTalk</B>

<B>World Wide Focus</B>
The International Association (IA) <a href="http://www.bodytalksystem.com" target="_blank"> <font color="#0099FF"> www.bodytalksystem.com </font></a>

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