Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-11-2005, 09:03 AM   #1
jerryCLEMENT
Registered User
 
Join Date: Mar 2005
Posts: 1
Default HTML.txt ----> dynamic text box

Hey all,

I'm going crazy trying to get this right. Here's what i'm trying to do:

I have a small dynamic text box used for displaying news on a flash page. I want to be able to update it without going into my .fla file. The text file itself contains this text:

HTML Code:
news=<img src='test1.jpg'><br><align=right>This is my test paragraph. Filler
text here, a little more here, and finally some here.<br>Testing</align>
1. I understand MX 2004 supports <img> tags in dynamic text boxes.
2. The image itself spans across the width of the text box like a banner (one pixel shorter).
3. I want the text file, when loaded to display the image on top (like a banner) then below it have text.
4. The dynamic box is set to Multiline (wrapped) and "render text as HTML" selected.

I have tried numerous different codes in actionscript to get this to load but it will not. I have my dynamic text box named with an instance name and a variable name (news). Also, the text itself will not display according to the HTML code attached to it. The most i have gotten with all methods of AS is this..

Quote:
This is my test paragraph. Filler text here, a little more here, and finally some here.
Testing.
Flash will not format the text (even with align - right enabled on the dynamic text box) to the right side, and will not display my image either.

I have tried loadVariablesNum tag and most within this series of string.

Can someone please paste the code i would need to load this .txt file into my dynamic text box within flash?

Thanks so much in advance.
jerryCLEMENT is offline   Reply With Quote
Old 03-11-2005, 09:58 AM   #2
prt1
FlashScape
 
Join Date: Mar 2004
Posts: 139
Default

You need to put the align=right within the img, only relates to the image not the text
<img src='test1.jpg' align='right' >
Note the use of quotes for the values, you can also set the width and height of the image if required, width='100' etc but within the <img> like the align.
Publish parameters of the movie must be Flash 7 and actionscript 2

A valid example from within Flash would be
news.htmlText = "<img src='test1.jpg' align='right'>hello world<br>New line";

Hope this helps
prt1 is offline   Reply With Quote
Old 09-22-2009, 04:04 PM   #3
yenter
Registered User
 
Join Date: Sep 2009
Posts: 5
Default

you won't be able to load the image file, simply because you are trying to load images into a text field and that can't happen. if you are planning to have the whole thing aligned to the right always, you could use code (i don't know how to do it in as2)
yenter is offline   Reply With Quote
Old 09-23-2009, 05:56 PM   #4
msukow
Registered User
 
Join Date: Sep 2009
Posts: 1
Default

Actually, you can load an image:
myTextfield.htmlText = myTextfield.htmlText + 'Secretary-General <img width="10" src=\"images/soat_logo_sm3.png\" /> Ban Ki-moon challenged world leaders.';

This is the format needed - not the back slashes - very important. And it must be htmlText.
msukow is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:47 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.