Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)

Reply
 
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
Old 08-02-2003, 06:54 AM   #1
puckett_jw
Registered User
 
Join Date: Aug 2003
Posts: 4
Default Help with HTML in dynamic text field...

I have a very simple banner that loads services from a database, which fade up, pause, and fade down at a random spot on stage--repeat with next service. I load them from a asp page the gives:

&Services=Service+1,Service+2,...,Service+N&status =1&

I would like to make the Text a link to the section of my site, so I have modified the asp file to give:

&Services=Service+1,Service+2,...,Service+N&servic es_links=link1,link2,...,linkn&status=1&

all of the links are relative URLS and they have been URLEncoded, so all special characters have been escaped.

I have changed my working code from:
ActionScript Code:
Services_mc.Services_text_mc.Services_txt.text = Services_array[count]; trace("Text Width = "+Services_mc.Services_text_mc.Services_txt.textWidth); trace("Text Height = "+Services_mc.Services_text_mc.Services_txt.textHeight); //Move the text feild to a random position on the stage, but make //sure that the entire text will fit Services_mc._x = Math.random() * (Scene_Width - Services_mc.Services_text_mc.Services_txt.textWidth); Services_mc._y = Math.random() * (Scene_Height - Services_mc.Services_text_mc.Services_txt.textHeight);
to:
ActionScript Code:
//Build html to go in text field from the two arrays that are built from the database //where count is the index of the values that we are on Services_mc.Services_text_mc.Services_txt.autoSize = true; Services_mc.Services_text_mc.Services_txt.html = true; Services_mc.Services_text_mc.Services_txt.htmlText = "<A HREF=\""+Services_Links_array[count]+"\">"+Services_array[count]+"</A>"; trace("Text Width = "+Services_mc.Services_text_mc.Services_txt.textWidth); trace("Text Height = "+Services_mc.Services_text_mc.Services_txt.textHeight); trace("HTML Text = "+"<A HREF=\""+Services_Links_array[count]+"\">"+Services_array[count]+"</A>"); //Move the text feild to a random position on the stage, but make //sure that the entire text will fit Services_mc._x = Math.random() * (Scene_Width - Services_mc.Services_text_mc.Services_txt.textWidth); Services_mc._y = Math.random() * (Scene_Height - Services_mc.Services_text_mc.Services_txt.textHeight);

Additionally, I have checked the "Render text as HTML" button for the text field., and changed "Embed Font Outlines For" to "No Character" from "All Characters". However, I have tested it both ways.

When I test the movie, I get nothing on the stage, and this is the output from the trace:

PHP Code:
Text Width 0
Text Height 
28
HTML Text 
= <A HREF="1">Service 1</A>
Text Width 0
Text Height 
28
HTML Text 
= <A HREF="11">Service 11</A>
Text Width 0
Text Height 
28
HTML Text 
= <A HREF="111">Service 111</A>
Text Width 0
Text Height 
28
HTML Text 
= <A HREF="1111">Service 1111</A>
(
Repeat...) 
And this is a "List Objects" dump:
PHP Code:
Level #0:
Variable _level0.$version "WIN 6,0,21,0"
Variable _level0.Services "Service 1,Service 11,Service 111,Service 1111"
Variable _level0.services_links "1,11,111,1111"
Variable _level0.status "1"
Variable _level0.Services_array = [object #1, class 'Array'] [
    
0:"Service 1",
    
1:"Service 11",
    
2:"Service 111",
    
3:"Service 1111"
  
]
Variable _level0.Services_Links_array = [object #2, class 'Array'] [
    
0:"1",
    
1:"11",
    
2:"111",
    
3:"1111"
  
]
Variable _level0.Scene_Width 483
Variable _level0
.Scene_Height 115
Variable _level0
.count 0
Movie Clip
Target="_level0.Services_mc"
Movie ClipTarget="_level0.Services_mc.Services_text_mc"
Variable _level0.Services_mc.Services_text_mc.Services_text "<P ALIGN=\"LEFT\"></P>"
Edit TextTarget="_level0.Services_mc.Services_text_mc.Services_txt"
    
variable "Services_text",
    
text "\r",
    
htmlText "<P ALIGN=\"LEFT\"><FONT FACE=\"Arial\" SIZE=\"25\" COLOR=\"#F4F4F4\"></FONT></P>",
    
html truetextWidth 0textHeight 28maxChars null,
    
borderColor 0x000000backgroundColor 0xFFFFFFtextColor 0xF4F4F4border false,
    
background falsewordWrap falsepassword falsemultiline false,
    
selectable falsescroll 1hscroll 0maxscroll 1,
    
maxhscroll 0bottomScroll 1,
    
type "dynamic",
    
embedFonts falserestrict nulllength 1tabIndex undefined,
    
autoSize "left",
    
condenseWhite false 
I thought that you might not be able to get the text widht and height of htmlText, so I hard codded _x and _y to 20, and I still do not see anything on the stage. Could someone please help. If I am doing something stupid, pleaes point it out. I have attached my fla and txt file, just incase someone wants to look it over.

Thanks,
Jimmy Puckett
Attached Files
File Type: zip motion.zip (37.3 KB, 529 views)
puckett_jw is offline   Reply With Quote
Old 08-02-2003, 01:11 PM   #2
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

need to add a font symbol

see attached

cheers
Attached Files
File Type: zip motion folder.zip (64.7 KB, 664 views)
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 08-03-2003, 09:30 AM   #3
puckett_jw
Registered User
 
Join Date: Aug 2003
Posts: 4
Default

Thank you so much. I had seen another thread where you talked about making a Font Symbol, and had even tried it, but it did/does not work for me. I ran your correct version, and it does exactly as I need it to. However, I must be completly stupid or blind, because I opened my orginal, Picked "New Font..." from the menu in the upper right hand corner of the Library. I named it "MyArial", just like the Tech Note on Macormedia's site, and picked Arial for the font. I then right clicked on the name, and selected "Linkage", where I checked "Export for ActionScript" and "Export in first frame". I would assume that you have to do something to associate the front symbol with the text box, but I have not seen anything about that, and I could not find any thing in your version, so I tested my movie, and I still do not see the text.

If you would please point out what I am over looking


Thanks,
Jimmy Puckett
puckett_jw is offline   Reply With Quote
Old 08-03-2003, 10:14 AM   #4
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

make sure you turn off the embeded font for the text box
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 08-03-2003, 10:22 AM   #5
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

that wasn't very clear

- select the text box
- in the property inspector turn off "embed font"
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 08-03-2003, 03:15 PM   #6
puckett_jw
Registered User
 
Join Date: Aug 2003
Posts: 4
Default

I do have it set to "No Characters"? Please see attached. All I have done is add the font to the Library.


Thanks,
Jimmy
Attached Files
File Type: zip motion-font-symbol.zip (37.6 KB, 516 views)
puckett_jw is offline   Reply With Quote
Old 08-03-2003, 05:09 PM   #7
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

removing the text box's variable name seems to fix it

cheers
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T is offline   Reply With Quote
Old 08-03-2003, 10:25 PM   #8
puckett_jw
Registered User
 
Join Date: Aug 2003
Posts: 4
Default

Wounderfull!!! Removing the Var name from the text field fixed the problem. I cannot see why that does, but it does. I really appricate you working with me as much as you have. I hope that someday I can return the favor. I mostly do server admin & network design. Plese let me know if I can ever be of help.


Jimmy Puckett
puckett_jw is offline   Reply With Quote
Old 08-04-2003, 12:58 AM   #9
Billy T
Oops I did it again
 
Billy T's Avatar
 
Join Date: Oct 2001
Location: Melbourne
Posts: 8,579
Default

no worries
__________________
Billy
Online Galleries
iPhone Safety App - iStaySafe
Free Flash Video Tutorials
Photo Website Template

Don't email or PM me questions...
Billy T 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 09:32 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.